X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fconfig%2Fm32r%2Fm32r.h;h=add59b3c036e5f7c26e49228c75b0c3713b9a1a2;hb=d6b2e5a0ecc06fc359b35d34e4728ec647238039;hp=b515e778bb6ec7d6e764e3580c4b6b3cc9cb80f5;hpb=0d3fde44f270f6dfeda960c216c5fbae30d6a605;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h index b515e778bb6..add59b3c036 100644 --- a/gcc/config/m32r/m32r.h +++ b/gcc/config/m32r/m32r.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, Renesas M32R cpu. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -30,7 +30,6 @@ #undef PTRDIFF_TYPE #undef WCHAR_TYPE #undef WCHAR_TYPE_SIZE -#undef ASM_OUTPUT_EXTERNAL_LIBCALL #undef TARGET_VERSION #undef CPP_SPEC #undef ASM_SPEC @@ -115,6 +114,7 @@ do \ { \ builtin_define ("__M32R__"); \ + builtin_define ("__m32r__"); \ builtin_assert ("cpu=m32r"); \ builtin_assert ("machine=m32r"); \ builtin_define (TARGET_BIG_ENDIAN \ @@ -183,6 +183,8 @@ { "relax", RELAX_SPEC }, \ SUBTARGET_EXTRA_SPECS +#define CPP_SPEC "%(cpp_cpu)" + #undef CC1_SPEC #define CC1_SPEC "%{G*} %(cc1_cpu)" @@ -240,18 +242,23 @@ extern int target_flags; /* Support extended instruction set of m32r2. */ #define TARGET_M32R2_MASK (1 << 6) -#define TARGET_M32R2 (target_flags & TARGET_M32RX_MASK) +#define TARGET_M32R2 (target_flags & TARGET_M32R2_MASK) #undef TARGET_M32R #define TARGET_M32R (! TARGET_M32RX && ! TARGET_M32R2) -/* Big Endian Flag. */ -#define BIG_ENDIAN_BIT (1 << 7) -#define TARGET_BIG_ENDIAN (target_flags & BIG_ENDIAN_BIT) - /* Little Endian Flag. */ -#define LITTLE_ENDIAN_BIT (1 << 8) -#ifndef TARGET_LITTLE_ENDIAN /* See little.h */ -#define TARGET_LITTLE_ENDIAN (target_flags & LITTLE_ENDIAN_BIT) +#define LITTLE_ENDIAN_BIT (1 << 7) +#define TARGET_LITTLE_ENDIAN (target_flags & LITTLE_ENDIAN_BIT) +#define TARGET_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN) + +/* This defaults us to big-endian. */ +#ifndef TARGET_ENDIAN_DEFAULT +#define TARGET_ENDIAN_DEFAULT 0 +#endif + +/* This defaults us to m32r. */ +#ifndef TARGET_CPU_DEFAULT +#define TARGET_CPU_DEFAULT 0 #endif /* Macro to define tables used to set the flags. @@ -265,7 +272,7 @@ extern int target_flags; #endif #ifndef TARGET_DEFAULT -#define TARGET_DEFAULT 0 +#define TARGET_DEFAULT (TARGET_CPU_DEFAULT | TARGET_ENDIAN_DEFAULT) #endif #define TARGET_SWITCHES \ @@ -497,15 +504,6 @@ extern enum m32r_sdata m32r_sdata; (MODE) = SImode; \ } -/* Define this macro if the promotion described by `PROMOTE_MODE' - should also be done for outgoing function arguments. */ -/*#define PROMOTE_FUNCTION_ARGS*/ - -/* Likewise, if the function return value is promoted. - If defined, FUNCTION_VALUE must perform the same promotions done by - PROMOTE_MODE. */ -/*#define PROMOTE_FUNCTION_RETURN*/ - /* Allocation boundary (in *bits*) for storing arguments in argument list. */ #define PARM_BOUNDARY 32 @@ -744,7 +742,7 @@ enum reg_class #define N_REG_CLASSES ((int) LIM_REG_CLASSES) -/* Give names of register classes as strings for dump file. */ +/* Give names of register classes as strings for dump file. */ #define REG_CLASS_NAMES \ { "NO_REGS", "CARRY_REG", "ACCUM_REGS", "GENERAL_REGS", "ALL_REGS" } @@ -1020,9 +1018,6 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER]; /* Function argument passing. */ -/* When a prototype says `char' or `short', really pass an `int'. */ -#define PROMOTE_PROTOTYPES 1 - /* If defined, the maximum amount of space required for outgoing arguments will be computed and placed into the variable `current_function_outgoing_args_size'. No space will be pushed @@ -1038,7 +1033,7 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER]; SIZE is the number of bytes of arguments passed on the stack. */ #define RETURN_POPS_ARGS(DECL, FUNTYPE, SIZE) 0 -/* Nonzero if we do not know how to pass TYPE solely in registers. */ +/* Nonzero if we do not know how to pass TYPE solely in registers. */ #define MUST_PASS_IN_STACK(MODE, TYPE) \ ((TYPE) != 0 \ && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ @@ -1054,7 +1049,7 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER]; /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a function whose data type is FNTYPE. For a library call, FNTYPE is 0. */ -#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \ +#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ ((CUM) = 0) /* The number of registers used for parameter passing. Local to this file. */ @@ -1147,36 +1142,6 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER]; ? PARM_BOUNDARY : 2 * PARM_BOUNDARY) #endif -/* This macro offers an alternative - to using `__builtin_saveregs' and defining the macro - `EXPAND_BUILTIN_SAVEREGS'. Use it to store the anonymous register - arguments into the stack so that all the arguments appear to have - been passed consecutively on the stack. Once this is done, you - can use the standard implementation of varargs that works for - machines that pass all their arguments on the stack. - - The argument ARGS_SO_FAR is the `CUMULATIVE_ARGS' data structure, - containing the values that obtain after processing of the named - arguments. The arguments MODE and TYPE describe the last named - argument--its machine mode and its data type as a tree node. - - The macro implementation should do two things: first, push onto the - stack all the argument registers *not* used for the named - arguments, and second, store the size of the data thus pushed into - the `int'-valued variable whose name is supplied as the argument - PRETEND_SIZE. The value that you store here will serve as - additional offset for setting up the stack frame. - - If the argument NO_RTL is nonzero, it means that the - arguments of the function are being analyzed for the second time. - This happens for an inline function, which is not actually - compiled until the end of the source file. The macro - `SETUP_INCOMING_VARARGS' should not generate any instructions in - this case. */ - -#define SETUP_INCOMING_VARARGS(ARGS_SO_FAR, MODE, TYPE, PRETEND_SIZE, NO_RTL) \ - m32r_setup_incoming_varargs (& ARGS_SO_FAR, MODE, TYPE, & PRETEND_SIZE, NO_RTL) - /* Implement `va_arg'. */ #define EXPAND_BUILTIN_VA_ARG(valist, type) \ m32r_va_arg (valist, type) @@ -1198,19 +1163,8 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER]; /* ??? What about r1 in DI/DF values. */ #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0) -/* A C expression which can inhibit the returning of certain function - values in registers, based on the type of value. A nonzero value says - to return the function value in memory, just as large structures are - always returned. Here TYPE will be a C expression of type `tree', - representing the data type of the value. */ -#define RETURN_IN_MEMORY(TYPE) m32r_pass_by_reference (TYPE) - -/* Tell GCC to use RETURN_IN_MEMORY. */ +/* Tell GCC to use TARGET_RETURN_IN_MEMORY. */ #define DEFAULT_PCC_STRUCT_RETURN 0 - -/* Register in which address to store a structure value - is passed to a function, or 0 to use `invisible' first argument. */ -#define STRUCT_VALUE 0 /* Function entry and exit. */ @@ -1776,15 +1730,6 @@ extern char m32r_punct_chars[256]; for the index in the tablejump instruction. */ #define CASE_VECTOR_MODE (flag_pic ? SImode : Pmode) -/* Define as C expression which evaluates to nonzero if the tablejump - instruction expects the table to contain offsets from the address of the - table. - Do not define this if the table should contain absolute addresses. */ -/* It's not clear what PIC will look like or whether we want to use -fpic - for the embedded form currently being talked about. For now require -fpic - to get pc relative switch tables. */ -/*#define CASE_VECTOR_PC_RELATIVE 1 */ - /* Define if operations between registers always perform the operation on the full register even if a narrower mode is specified. */ #define WORD_REGISTER_OPERATIONS @@ -1824,7 +1769,7 @@ extern char m32r_punct_chars[256]; extern struct rtx_def * m32r_compare_op0; extern struct rtx_def * m32r_compare_op1; -/* M32R function types. */ +/* M32R function types. */ enum m32r_function_type { M32R_FUNCTION_UNKNOWN, M32R_FUNCTION_NORMAL, M32R_FUNCTION_INTERRUPT