Mercurial > hg > CbC > CbC_gcc
diff gcc/config/m32r/m32r.h @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | 77e2b8dfacca |
children | 04ced10e8804 |
line wrap: on
line diff
--- a/gcc/config/m32r/m32r.h Tue May 25 18:58:51 2010 +0900 +++ b/gcc/config/m32r/m32r.h Tue Mar 22 17:18:12 2011 +0900 @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, Renesas M32R cpu. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of GCC. @@ -22,9 +22,6 @@ - longlong.h? */ -#undef SWITCH_TAKES_ARG -#undef WORD_SWITCH_TAKES_ARG -#undef HANDLE_SYSV_PRAGMA #undef SIZE_TYPE #undef PTRDIFF_TYPE #undef WCHAR_TYPE @@ -94,12 +91,6 @@ #define TARGET_VERSION fprintf (stderr, " (m32r)") #endif -/* Switch Recognition by gcc.c. Add -G xx support. */ - -#undef SWITCH_TAKES_ARG -#define SWITCH_TAKES_ARG(CHAR) \ -(DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G') - /* Names to predefine in the preprocessor for this target machine. */ /* __M32R__ is defined by the existing compiler so we use that. */ #define TARGET_CPU_CPP_BUILTINS() \ @@ -177,7 +168,7 @@ /* Options to pass on to the assembler. */ #undef ASM_SPEC -#define ASM_SPEC "%{v} %(asm_cpu) %(relax) %{fpic|fpie:-K PIC} %{fPIC|fPIE:-K PIC}" +#define ASM_SPEC "%(asm_cpu) %(relax) %{fpic|fpie:-K PIC} %{fPIC|fPIE:-K PIC}" #define LINK_SPEC "%{v} %(link_cpu) %(relax)" @@ -302,52 +293,9 @@ #define MULTILIB_DEFAULTS { "mmodel=small" SUBTARGET_MULTILIB_DEFAULTS } #endif -/* Sometimes certain combinations of command options do not make - sense on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - Don't use this macro to turn on various extra optimizations for - `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ - #ifndef SUBTARGET_OVERRIDE_OPTIONS #define SUBTARGET_OVERRIDE_OPTIONS #endif - -#define OVERRIDE_OPTIONS \ - do \ - { \ - /* These need to be done at start up. \ - It's convenient to do them here. */ \ - m32r_init (); \ - SUBTARGET_OVERRIDE_OPTIONS \ - } \ - while (0) - -#ifndef SUBTARGET_OPTIMIZATION_OPTIONS -#define SUBTARGET_OPTIMIZATION_OPTIONS -#endif - -#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \ - do \ - { \ - if (LEVEL == 1) \ - flag_regmove = TRUE; \ - \ - if (SIZE) \ - { \ - flag_omit_frame_pointer = TRUE; \ - } \ - \ - SUBTARGET_OPTIMIZATION_OPTIONS \ - } \ - while (0) - -/* Define this macro if debugging can be performed even without a - frame pointer. If this macro is defined, GCC will turn on the - `-fomit-frame-pointer' option whenever `-O' is specified. */ -#define CAN_DEBUG_WITHOUT_FP /* Target machine storage layout. */ @@ -362,12 +310,6 @@ numbered. */ #define WORDS_BIG_ENDIAN (TARGET_LITTLE_ENDIAN == 0) -/* Define this macro if WORDS_BIG_ENDIAN is not constant. This must - be a constant value with the same meaning as WORDS_BIG_ENDIAN, - which will be used only when compiling libgcc2.c. Typically the - value will be set based on preprocessor defines. */ -/*#define LIBGCC2_WORDS_BIG_ENDIAN 1*/ - /* Width of a word, in units (bytes). */ #define UNITS_PER_WORD 4 @@ -514,30 +456,6 @@ #define CALL_REALLY_USED_REGISTERS CALL_USED_REGISTERS -/* Zero or more C statements that may conditionally modify two variables - `fixed_regs' and `call_used_regs' (both of type `char []') after they - have been initialized from the two preceding macros. - - This is necessary in case the fixed or call-clobbered registers depend - on target flags. - - You need not define this macro if it has no work to do. */ - -#ifdef SUBTARGET_CONDITIONAL_REGISTER_USAGE -#define CONDITIONAL_REGISTER_USAGE SUBTARGET_CONDITIONAL_REGISTER_USAGE -#else -#define CONDITIONAL_REGISTER_USAGE \ - do \ - { \ - if (flag_pic) \ - { \ - fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ - call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ - } \ - } \ - while (0) -#endif - /* If defined, an initializer for a vector of integers, containing the numbers of hard registers in the order in which GCC should prefer to use them (from most preferred to least). */ @@ -687,12 +605,6 @@ #define REGNO_OK_FOR_INDEX_P(REGNO) REGNO_OK_FOR_BASE_P(REGNO) -/* Given an rtx X being reloaded into a reg required to be - in class CLASS, return the class of reg to actually use. - In general this is just CLASS; but on some machines - in some cases it is preferable to use a more restrictive class. */ -#define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS) - /* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. */ #define CLASS_MAX_NREGS(CLASS, MODE) \ @@ -823,14 +735,6 @@ increase the stack frame size by this amount. */ #define ACCUMULATE_OUTGOING_ARGS 1 -/* 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(DECL, FUNTYPE, SIZE) 0 - /* Define a data type for recording info about an argument list during the scan of that argument list. This data type should hold all necessary information about the function itself @@ -851,81 +755,9 @@ #define FUNCTION_ARG_REGNO_P(N) \ ((unsigned) (N) < M32R_MAX_PARM_REGS) -/* The ROUND_ADVANCE* macros are local to this file. */ -/* Round SIZE up to a word boundary. */ -#define ROUND_ADVANCE(SIZE) \ - (((SIZE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) - -/* Round arg MODE/TYPE up to the next word boundary. */ -#define ROUND_ADVANCE_ARG(MODE, TYPE) \ - ((MODE) == BLKmode \ - ? ROUND_ADVANCE ((unsigned int) int_size_in_bytes (TYPE)) \ - : ROUND_ADVANCE ((unsigned int) GET_MODE_SIZE (MODE))) - -/* Round CUM up to the necessary point for argument MODE/TYPE. */ -#define ROUND_ADVANCE_CUM(CUM, MODE, TYPE) (CUM) - -/* Return boolean indicating arg of type TYPE and mode MODE will be passed in - a reg. This includes arguments that have to be passed by reference as the - pointer to them is passed in a reg if one is available (and that is what - we're given). - This macro is only used in this file. */ -#define PASS_IN_REG_P(CUM, MODE, TYPE) \ - (ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE)) < M32R_MAX_PARM_REGS) - -/* Determine where to put an argument to a function. - Value is zero to push the argument on the stack, - or a hard register in which to store the argument. - - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. - CUM is a variable of type CUMULATIVE_ARGS which gives info about - the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). */ -/* On the M32R the first M32R_MAX_PARM_REGS args are normally in registers - and the rest are pushed. */ -#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ - (PASS_IN_REG_P ((CUM), (MODE), (TYPE)) \ - ? gen_rtx_REG ((MODE), ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE))) \ - : 0) - -/* Update the data in CUM to advance over an argument - of mode MODE and data type TYPE. - (TYPE is null for libcalls where that information may not be available.) */ -#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - ((CUM) = (ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE)) \ - + ROUND_ADVANCE_ARG ((MODE), (TYPE)))) - -/* If defined, a C expression that gives the alignment boundary, in bits, - of an argument with the specified mode and type. If it is not defined, - PARM_BOUNDARY is used for all arguments. */ -#if 0 -/* We assume PARM_BOUNDARY == UNITS_PER_WORD here. */ -#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \ - (((TYPE) ? TYPE_ALIGN (TYPE) : GET_MODE_BITSIZE (MODE)) <= PARM_BOUNDARY \ - ? PARM_BOUNDARY : 2 * PARM_BOUNDARY) -#endif /* Function results. */ -/* Define how to find the value returned by a function. - VALTYPE is the data type of the value (as a tree). - If the precise function being called is known, FUNC is its FUNCTION_DECL; - otherwise, FUNC is 0. */ -#define FUNCTION_VALUE(VALTYPE, FUNC) gen_rtx_REG (TYPE_MODE (VALTYPE), 0) - -/* Define how to find the value returned by a library function - assuming the value has mode MODE. */ -#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0) - -/* 1 if N is a possible register number for a function value - as seen by the caller. */ -/* ??? What about r1 in DI/DF values. */ -#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0) - /* Tell GCC to use TARGET_RETURN_IN_MEMORY. */ #define DEFAULT_PCC_STRUCT_RETURN 0 @@ -1026,109 +858,6 @@ && (GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF || GET_CODE (XEXP (XEXP (X, 0), 0)) == LABEL_REF) \ && CONST_INT_P (XEXP (XEXP (X, 0), 1)) \ && (unsigned HOST_WIDE_INT) INTVAL (XEXP (XEXP (X, 0), 1)) > 32767)) - -/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx - and check its validity for a certain class. - We have two alternate definitions for each of them. - The usual definition accepts all pseudo regs; the other rejects - them unless they have been allocated suitable hard regs. - The symbol REG_OK_STRICT causes the latter definition to be used. - - Most source files want to accept pseudo regs in the hope that - they will get allocated to the class that the insn wants them to be in. - Source files for reload pass need to be strict. - After reload, it makes no difference, since pseudo regs have - been eliminated by then. */ - -#ifdef REG_OK_STRICT - -/* Nonzero if X is a hard reg that can be used as a base reg. */ -#define REG_OK_FOR_BASE_P(X) GPR_P (REGNO (X)) -/* Nonzero if X is a hard reg that can be used as an index. */ -#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X) - -#else - -/* Nonzero if X is a hard reg that can be used as a base reg - or if it is a pseudo reg. */ -#define REG_OK_FOR_BASE_P(X) \ - (GPR_P (REGNO (X)) \ - || (REGNO (X)) == ARG_POINTER_REGNUM \ - || REGNO (X) >= FIRST_PSEUDO_REGISTER) -/* Nonzero if X is a hard reg that can be used as an index - or if it is a pseudo reg. */ -#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X) - -#endif - -/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression - that is a valid memory address for an instruction. - The MODE argument is the machine mode for the MEM expression - that wants to use this address. */ - -/* Local to this file. */ -#define RTX_OK_FOR_BASE_P(X) (REG_P (X) && REG_OK_FOR_BASE_P (X)) - -/* Local to this file. */ -#define RTX_OK_FOR_OFFSET_P(X) \ - (CONST_INT_P (X) && INT16_P (INTVAL (X))) - -/* Local to this file. */ -#define LEGITIMATE_OFFSET_ADDRESS_P(MODE, X) \ - (GET_CODE (X) == PLUS \ - && RTX_OK_FOR_BASE_P (XEXP (X, 0)) \ - && RTX_OK_FOR_OFFSET_P (XEXP (X, 1))) - -/* Local to this file. */ -/* For LO_SUM addresses, do not allow them if the MODE is > 1 word, - since more than one instruction will be required. */ -#define LEGITIMATE_LO_SUM_ADDRESS_P(MODE, X) \ - (GET_CODE (X) == LO_SUM \ - && (MODE != BLKmode && GET_MODE_SIZE (MODE) <= UNITS_PER_WORD)\ - && RTX_OK_FOR_BASE_P (XEXP (X, 0)) \ - && CONSTANT_P (XEXP (X, 1))) - -/* Local to this file. */ -/* Is this a load and increment operation. */ -#define LOAD_POSTINC_P(MODE, X) \ - (((MODE) == SImode || (MODE) == SFmode) \ - && GET_CODE (X) == POST_INC \ - && REG_P (XEXP (X, 0)) \ - && RTX_OK_FOR_BASE_P (XEXP (X, 0))) - -/* Local to this file. */ -/* Is this an increment/decrement and store operation. */ -#define STORE_PREINC_PREDEC_P(MODE, X) \ - (((MODE) == SImode || (MODE) == SFmode) \ - && (GET_CODE (X) == PRE_INC || GET_CODE (X) == PRE_DEC) \ - && REG_P (XEXP (X, 0)) \ - && RTX_OK_FOR_BASE_P (XEXP (X, 0))) - -#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ - do \ - { \ - if (RTX_OK_FOR_BASE_P (X)) \ - goto ADDR; \ - if (LEGITIMATE_OFFSET_ADDRESS_P ((MODE), (X))) \ - goto ADDR; \ - if (LEGITIMATE_LO_SUM_ADDRESS_P ((MODE), (X))) \ - goto ADDR; \ - if (LOAD_POSTINC_P ((MODE), (X))) \ - goto ADDR; \ - if (STORE_PREINC_PREDEC_P ((MODE), (X))) \ - goto ADDR; \ - } \ - while (0) - -/* Go to LABEL if ADDR (a legitimate address expression) - has an effect that depends on the machine mode it is used for. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ - do \ - { \ - if (GET_CODE (ADDR) == LO_SUM) \ - goto LABEL; \ - } \ - while (0) /* Condition code usage. */ @@ -1138,16 +867,6 @@ /* Costs. */ -/* Compute extra cost of moving data between one register class - and another. */ -#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) 2 - -/* Compute the cost of moving data between registers and memory. */ -/* Memory is 3 times as expensive as registers. - ??? Is that the right way to look at it? */ -#define MEMORY_MOVE_COST(MODE,CLASS,IN_P) \ -(GET_MODE_SIZE (MODE) <= UNITS_PER_WORD ? 6 : 12) - /* The cost of a branch insn. */ /* A value of 2 here causes GCC to avoid using branches in comparisons like while (a < N && a). Branches aren't that expensive on the M32R so @@ -1274,24 +993,6 @@ SUBTARGET_ADDITIONAL_REGISTER_NAMES \ } -/* A C expression which evaluates to true if CODE is a valid - punctuation character for use in the `PRINT_OPERAND' macro. */ -extern char m32r_punct_chars[256]; -#define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \ - m32r_punct_chars[(unsigned char) (CHAR)] - -/* Print operand X (an rtx) in assembler syntax to file FILE. - CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified. - For `%' followed by punctuation, CODE is the punctuation and X is null. */ -#define PRINT_OPERAND(FILE, X, CODE) \ - m32r_print_operand (FILE, X, CODE) - -/* A C compound statement to output to stdio stream STREAM the - assembler syntax for an instruction operand that is a memory - reference whose address is ADDR. ADDR is an RTL expression. */ -#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \ - m32r_print_operand_address (FILE, ADDR) - /* If defined, C string expressions to be used for the `%R', `%L', `%U', and `%I' options of `asm_fprintf' (see `final.c'). These are useful when a single `md' file must support multiple assembler @@ -1370,7 +1071,8 @@ do \ { \ if (! TARGET_SDATA_NONE \ - && (SIZE) > 0 && (SIZE) <= g_switch_value) \ + && (SIZE) > 0 \ + && (SIZE) <= (unsigned HOST_WIDE_INT) g_switch_value) \ fprintf ((FILE), "%s", SCOMMON_ASM_OP); \ else \ fprintf ((FILE), "%s", COMMON_ASM_OP); \ @@ -1383,7 +1085,8 @@ do \ { \ if (! TARGET_SDATA_NONE \ - && (SIZE) > 0 && (SIZE) <= g_switch_value) \ + && (SIZE) > 0 \ + && (SIZE) <= (unsigned HOST_WIDE_INT) g_switch_value) \ switch_to_section (get_named_section (NULL, ".sbss", 0)); \ else \ switch_to_section (bss_section); \