--- gcc/config/clipper/clipper.h 2018/04/24 18:14:06 1.1.1.2 +++ gcc/config/clipper/clipper.h 2018/04/24 18:27:50 1.1.1.4 @@ -1,6 +1,5 @@ /* Definitions of target machine for GNU compiler. Clipper version. - Copyright (C) 1987, 1988, 1991, 1993 Free Software Foundation, Inc. - + Copyright (C) 1987, 88, 91, 93, 94, 1995 Free Software Foundation, Inc. Contributed by Holger Teutsch (holger@hotbso.rhein-main.de) This file is part of GNU CC. @@ -17,7 +16,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ extern struct rtx_def *clipper_builtin_saveregs (); extern int clipper_frame_size (); @@ -52,17 +52,8 @@ extern int target_flags; #define TARGET_DEFAULT TARGET_C300 #endif -/* Omit frame pointer at -O2. Inline functions at -O3. */ - -#define OPTIMIZATION_OPTIONS(LEVEL) \ -{ \ - if ((LEVEL) >= 2) \ - { \ - flag_omit_frame_pointer = 1; \ - } \ - if ((LEVEL) >= 3) \ - flag_inline_functions = 1; \ -} +/* Show that we can debug generated code without a frame pointer. */ +#define CAN_DEBUG_WITHOUT_FP /* Target machine storage layout */ @@ -137,7 +128,7 @@ extern int target_flags; /* Let's keep the stack somewhat aligned. */ #define STACK_BOUNDARY 64 -/* Define this macro if it is advisible to hold scalars in registers +/* Define this macro if it is advisable to hold scalars in registers in a wider mode than that declared by the program. In such cases, the value is constrained to be within the bounds of the declared type, but kept valid in the wider mode. The signedness of the @@ -389,11 +380,12 @@ enum reg_class { NO_REGS, GENERAL_REGS, /* Value is the number of bytes of arguments automatically popped when returning from a subroutine call. + FUNDECL is the declaration node of the function (as a tree), FUNTYPE is the data type of the function (as a tree), or for a library call it is an identifier node for the subroutine name. SIZE is the number of bytes of arguments passed on the stack. */ -#define RETURN_POPS_ARGS(FUNTYPE,SIZE) 0 +#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0 /* Define how to find the value returned by a function. VALTYPE is the data type of the value (as a tree). @@ -423,9 +415,11 @@ enum reg_class { NO_REGS, GENERAL_REGS, ((N) == 0 || (N) == 1 || (N) == 16 || (N) == 17) /* Define this if PCC uses the nonreentrant convention for returning - structure and union values. */ + structure and union values. Old Green Hills C-Clipper returns static + structs but the newer Apogee compiler passes structs as hidden arg 0. + Structs etc are always passed in memory */ -#define PCC_STATIC_STRUCT_RETURN +/* #define PCC_STATIC_STRUCT_RETURN */ /* Define a data type for recording info about an argument list @@ -474,9 +468,10 @@ struct _clipper_cum_args { int num; int /* internal helper : size of an argument */ #define CLIPPER_ARG_SIZE(MODE, TYPE) \ -((MODE) != BLKmode \ - ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \ - : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) +(((MODE) != BLKmode \ + ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \ + : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) \ + * UNITS_PER_WORD) /* Update the data in CUM to advance over an argument of mode MODE and data type TYPE. @@ -490,6 +485,7 @@ do \ if ((CUM).num < 2 \ && (GET_MODE_CLASS(MODE)==MODE_INT || GET_MODE_CLASS(MODE)==MODE_FLOAT) \ && (GET_MODE_SIZE (MODE) <= 8) \ + && ((TYPE) == NULL || !AGGREGATE_TYPE_P(TYPE)) \ && ((MODE) != DImode || (CUM).num == 0)) \ { \ reg = 1; \ @@ -503,7 +499,7 @@ do \ { \ int align = FUNCTION_ARG_BOUNDARY (MODE, TYPE) / BITS_PER_UNIT; \ (CUM).size += align - 1; \ - (CUM).size &= align - 1; \ + (CUM).size &= ~(align - 1); \ (CUM).size += CLIPPER_ARG_SIZE (MODE, TYPE); \ } \ } while (0) @@ -529,6 +525,7 @@ do \ (((CUM).num < 2 \ && (GET_MODE_CLASS(MODE)==MODE_INT || GET_MODE_CLASS(MODE)==MODE_FLOAT) \ && (GET_MODE_SIZE (MODE) <= 8) \ + && ((TYPE) == NULL || !AGGREGATE_TYPE_P(TYPE)) \ && ((MODE) != DImode || (CUM).num == 0)) \ ? gen_rtx (REG, (MODE), \ GET_MODE_CLASS(MODE) == MODE_FLOAT ? (CUM).num+16 : (CUM).num) \ @@ -607,17 +604,18 @@ do \ #define TRAMPOLINE_TEMPLATE(FILE) \ { \ - fputs ("\tcall sp,.+4\n", FILE); \ + fputs ("\t.word 0x459F,0x0004\t# call sp,.+4\n", FILE); \ fputs ("\tmovw (sp),r3\n", FILE); \ fputs ("\taddq $4,sp\n", FILE); \ - fputs ("\tloadw 32(r3),r2\n", FILE); \ - fputs ("\tloadw 36(r3),r3\n", FILE); \ + fputs ("\tloadw 20(r3),r2\n", FILE); \ + fputs ("\tloadw 24(r3),r3\n", FILE); \ fputs ("\tb (r3)\n", FILE); \ + fputs ("\t.long 0,0\n", FILE); \ } /* Length in units of the trampoline for entering a nested function. */ -#define TRAMPOLINE_SIZE 44 +#define TRAMPOLINE_SIZE 32 /* Alignment required for a trampoline. 128 is used to find the beginning of a line in the instruction cache and to allow for @@ -635,8 +633,8 @@ do \ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 36)), CXT); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 40)), FNADDR); \ + emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 24)), CXT); \ + emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 28)), FNADDR); \ } /* Addressing modes, and classification of registers for them. */ @@ -888,7 +886,6 @@ do \ case MOD: \ case UMOD: \ return COSTS_N_INSNS (40); \ - case LSHIFT: \ case ASHIFT: \ case LSHIFTRT: \ case ASHIFTRT: \