diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-08-02 14:55:08 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-08-02 14:55:08 +0000 |
commit | efd092f3c57ca1acecabadf41c0804ec2a2cc4f3 (patch) | |
tree | 60ac76e618836461ad24d9238984fb2222853176 /gcc | |
parent | de8fc50999ccee71817f6ffa059dfb77cbc61d85 (diff) | |
download | gcc-efd092f3c57ca1acecabadf41c0804ec2a2cc4f3.tar.gz |
* config.gcc: Don't include mips/abi64.h in $tm_file.
* hard-reg-set.h (call_really_used_regs): Declare.
* config/mips/abi64.h: Remove file.
* config/mips/linux.h,
* config/mips/iris6.h: Don't include it.
* config/mips/mips-protos.h (mips_conditional_register_usage): Declare.
* config/mips/mips.h (CONDITIONAL_REGISTER_USAGE): Use it.
(REG_PARM_STACK_SPACE, STACK_BOUNDARY, STRICT_ARGUMENT_NAMING,
FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_PADDING,
FUNCTION_ARG_CALLEE_COPIES, MUST_PASS_IN_STACK, MIPS_STACK_ALIGN):
Bring across definitions from abi64.h.
(GP_ARG_LAST, FP_ARG_LAST): Use MAX_ARGS_IN_REGISTERS.
(BIGGEST_MAX_ARGS_IN_REGISTERS): New.
(struct mips_args): Use it.
* config/mips/mips.c (mips_conditional_register_usage): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55986 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 18 | ||||
-rw-r--r-- | gcc/config.gcc | 8 | ||||
-rw-r--r-- | gcc/config/mips/abi64.h | 132 | ||||
-rw-r--r-- | gcc/config/mips/iris6.h | 1 | ||||
-rw-r--r-- | gcc/config/mips/linux.h | 2 | ||||
-rw-r--r-- | gcc/config/mips/mips-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 56 | ||||
-rw-r--r-- | gcc/config/mips/mips.h | 149 | ||||
-rw-r--r-- | gcc/hard-reg-set.h | 4 |
9 files changed, 145 insertions, 226 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6480ba94aef..8c76df3198f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,21 @@ +2002-08-02 Richard Sandiford <rsandifo@redhat.com> + + * config.gcc: Don't include mips/abi64.h in $tm_file. + * hard-reg-set.h (call_really_used_regs): Declare. + * config/mips/abi64.h: Remove file. + * config/mips/linux.h, + * config/mips/iris6.h: Don't include it. + * config/mips/mips-protos.h (mips_conditional_register_usage): Declare. + * config/mips/mips.h (CONDITIONAL_REGISTER_USAGE): Use it. + (REG_PARM_STACK_SPACE, STACK_BOUNDARY, STRICT_ARGUMENT_NAMING, + FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_PADDING, + FUNCTION_ARG_CALLEE_COPIES, MUST_PASS_IN_STACK, MIPS_STACK_ALIGN): + Bring across definitions from abi64.h. + (GP_ARG_LAST, FP_ARG_LAST): Use MAX_ARGS_IN_REGISTERS. + (BIGGEST_MAX_ARGS_IN_REGISTERS): New. + (struct mips_args): Use it. + * config/mips/mips.c (mips_conditional_register_usage): Define. + 2002-08-02 Jason Merrill <jason@redhat.com> * langhooks-def.h (LANG_HOOKS_EXPR_SIZE): New macro. diff --git a/gcc/config.gcc b/gcc/config.gcc index d00e2649cfe..127ae910752 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1895,18 +1895,18 @@ mips-*-ecoff* | mipsel-*-ecoff*) tmake_file=mips/t-ecoff ;; mipsisa32-*-elf* | mipsisa32el-*-elf*) - tm_file="${tm_file} mips/elf.h mips/abi64.h" + tm_file="${tm_file} mips/elf.h" tmake_file=mips/t-isa3264 tm_defines="MIPS_ISA_DEFAULT=32 MIPS_ABI_DEFAULT=ABI_MEABI" ;; mipsisa64-*-elf* | mipsisa64el-*-elf*) - tm_file="${tm_file} mips/elf.h mips/abi64.h" + tm_file="${tm_file} mips/elf.h" tmake_file=mips/t-isa3264 target_cpu_default="MASK_64BIT|MASK_FLOAT64|MASK_GAS" tm_defines="MIPS_ISA_DEFAULT=64 MIPS_ABI_DEFAULT=ABI_MEABI" ;; mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*) - tm_file="${tm_file} mips/elf.h mips/abi64.h" + tm_file="${tm_file} mips/elf.h" tmake_file=mips/t-elf target_cpu_default="MASK_64BIT|MASK_FLOAT64|MASK_GAS" tm_defines="MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sb1\\\" MIPS_ABI_DEFAULT=ABI_O64" @@ -1948,7 +1948,7 @@ mips*-*-rtems*) fi ;; mipstx39-*-elf* | mipstx39el-*-elf*) - tm_file="${tm_file} mips/r3900.h mips/elf.h mips/abi64.h" + tm_file="${tm_file} mips/r3900.h mips/elf.h" tmake_file=mips/t-r3900 ;; mmix-knuth-mmixware) diff --git a/gcc/config/mips/abi64.h b/gcc/config/mips/abi64.h deleted file mode 100644 index 86b8aa819d1..00000000000 --- a/gcc/config/mips/abi64.h +++ /dev/null @@ -1,132 +0,0 @@ -/* Definitions of target machine for GNU compiler. 64 bit ABI support. - Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -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, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Macros to implement the 64 bit ABI. This file is meant to be included - after mips.h. */ - -#undef STACK_BOUNDARY -#define STACK_BOUNDARY \ - ((mips_abi == ABI_32 || mips_abi == ABI_O64 || mips_abi == ABI_EABI) \ - ? 64 : 128) - -#undef MIPS_STACK_ALIGN -#define MIPS_STACK_ALIGN(LOC) \ - ((mips_abi == ABI_32 || mips_abi == ABI_O64 || mips_abi == ABI_EABI) \ - ? ((LOC) + 7) & ~7 \ - : ((LOC) + 15) & ~15) - -#undef GP_ARG_LAST -#define GP_ARG_LAST ((mips_abi == ABI_32 || mips_abi == ABI_O64) \ - ? GP_REG_FIRST + 7 : GP_REG_FIRST + 11) -#undef FP_ARG_LAST -#define FP_ARG_LAST ((mips_abi == ABI_32 || mips_abi == ABI_O64) \ - ? FP_REG_FIRST + 15 : FP_REG_FIRST + 19) - -#undef SUBTARGET_CONDITIONAL_REGISTER_USAGE -#define SUBTARGET_CONDITIONAL_REGISTER_USAGE \ -{ \ - /* fp20-23 are now caller saved. */ \ - if (mips_abi == ABI_64) \ - { \ - int regno; \ - for (regno = FP_REG_FIRST + 20; regno < FP_REG_FIRST + 24; regno++) \ - call_really_used_regs[regno] = call_used_regs[regno] = 1; \ - } \ - /* odd registers from fp21 to fp31 are now caller saved. */ \ - if (mips_abi == ABI_N32 || mips_abi == ABI_MEABI) \ - { \ - int regno; \ - for (regno = FP_REG_FIRST + 21; regno <= FP_REG_FIRST + 31; regno+=2) \ - call_really_used_regs[regno] = call_used_regs[regno] = 1; \ - } \ -} - -#undef MAX_ARGS_IN_REGISTERS -#define MAX_ARGS_IN_REGISTERS ((mips_abi == ABI_32 || mips_abi == ABI_O64) \ - ? 4 : 8) - -#undef REG_PARM_STACK_SPACE -#define REG_PARM_STACK_SPACE(FNDECL) \ - ((mips_abi == ABI_32 || mips_abi == ABI_O64) \ - ? (MAX_ARGS_IN_REGISTERS*UNITS_PER_WORD) - FIRST_PARM_OFFSET (FNDECL) \ - : 0) - -#define FUNCTION_ARG_PADDING(MODE, TYPE) \ - (! BYTES_BIG_ENDIAN \ - ? upward \ - : (((MODE) == BLKmode \ - ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ - && int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT))\ - : (GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY \ - && (mips_abi == ABI_32 \ - || mips_abi == ABI_O64 \ - || mips_abi == ABI_EABI \ - || GET_MODE_CLASS (MODE) == MODE_INT))) \ - ? downward : upward)) - -/* Modified version of the macro in expr.h. */ -#define MUST_PASS_IN_STACK(MODE,TYPE) \ - ((TYPE) != 0 \ - && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ - || TREE_ADDRESSABLE (TYPE) \ - || ((MODE) == BLKmode \ - && mips_abi != ABI_32 && mips_abi != ABI_O64 \ - && ! ((TYPE) != 0 && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ - && 0 == (int_size_in_bytes (TYPE) \ - % (PARM_BOUNDARY / BITS_PER_UNIT))) \ - && (FUNCTION_ARG_PADDING (MODE, TYPE) \ - == (BYTES_BIG_ENDIAN ? upward : downward))))) - -#define STRICT_ARGUMENT_NAMING (mips_abi != ABI_32 && mips_abi != ABI_O64) - -/* A C expression that indicates when an argument must be passed by - reference. If nonzero for an argument, a copy of that argument is - made in memory and a pointer to the argument is passed instead of the - argument itself. The pointer is passed in whatever way is appropriate - for passing a pointer to that type. */ -#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ - function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED) - -/* A C expression that indicates when it is the called function's - responsibility to make a copy of arguments passed by invisible - reference. Normally, the caller makes a copy and passes the - address of the copy to the routine being called. When - FUNCTION_ARG_CALLEE_COPIES is defined and is nonzero, the caller - does not make a copy. Instead, it passes a pointer to the "live" - value. The called function must not modify this value. If it can - be determined that the value won't be modified, it need not make a - copy; otherwise a copy must be made. */ -#define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) \ - (mips_abi == ABI_EABI && (NAMED) \ - && FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, NAMED)) - -/* ??? Unimplemented stuff follows. */ - -/* ??? Add support for 16 byte/128 bit long doubles here when - mips_abi != ABI32. */ - -/* ??? Make main return zero if user did not specify return value. */ - -/* ??? Add support for .interfaces section, so as to get linker warnings - when stdarg functions called without prototype in scope? */ - -/* ??? Could optimize structure passing by putting the right register rtx - into the field decl, so that if we use the field, we can take the value from - a register instead of from memory. */ diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h index e42fa541ec1..4761aa5a883 100644 --- a/gcc/config/mips/iris6.h +++ b/gcc/config/mips/iris6.h @@ -32,7 +32,6 @@ Boston, MA 02111-1307, USA. */ #endif #include "mips/iris5.h" -#include "mips/abi64.h" /* Irix6 assembler does handle DWARF2 directives. Override setting in irix5.h file. */ diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h index 71de1611699..5564ad1e273 100644 --- a/gcc/config/mips/linux.h +++ b/gcc/config/mips/linux.h @@ -18,8 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "mips/abi64.h" - #undef WCHAR_TYPE #define WCHAR_TYPE "int" diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h index 01bd254bc13..d9b12ba02dc 100644 --- a/gcc/config/mips/mips-protos.h +++ b/gcc/config/mips/mips-protos.h @@ -104,6 +104,7 @@ extern const char *mips_restore_gp PARAMS ((rtx *, rtx)); extern const char *output_block_move PARAMS ((rtx, rtx *, int, enum block_move_type)); extern void override_options PARAMS ((void)); +extern void mips_conditional_register_usage PARAMS ((void)); extern void print_operand_address PARAMS ((FILE *, rtx)); extern void print_operand PARAMS ((FILE *, rtx, int)); extern int double_memory_operand PARAMS ((rtx,enum machine_mode)); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index f4b4e012275..c0795dc6cb4 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -5408,6 +5408,62 @@ override_options () init_machine_status = &mips_init_machine_status; } +/* Implement CONDITIONAL_REGISTER_USAGE. */ + +void +mips_conditional_register_usage () +{ + if (!TARGET_HARD_FLOAT) + { + int regno; + + for (regno = FP_REG_FIRST; regno <= FP_REG_LAST; regno++) + fixed_regs[regno] = call_used_regs[regno] = 1; + for (regno = ST_REG_FIRST; regno <= ST_REG_LAST; regno++) + fixed_regs[regno] = call_used_regs[regno] = 1; + } + else if (! ISA_HAS_8CC) + { + int regno; + + /* We only have a single condition code register. We + implement this by hiding all the condition code registers, + and generating RTL that refers directly to ST_REG_FIRST. */ + for (regno = ST_REG_FIRST; regno <= ST_REG_LAST; regno++) + fixed_regs[regno] = call_used_regs[regno] = 1; + } + /* In mips16 mode, we permit the $t temporary registers to be used + for reload. We prohibit the unused $s registers, since they + are caller saved, and saving them via a mips16 register would + probably waste more time than just reloading the value. */ + if (TARGET_MIPS16) + { + fixed_regs[18] = call_used_regs[18] = 1; + fixed_regs[19] = call_used_regs[19] = 1; + fixed_regs[20] = call_used_regs[20] = 1; + fixed_regs[21] = call_used_regs[21] = 1; + fixed_regs[22] = call_used_regs[22] = 1; + fixed_regs[23] = call_used_regs[23] = 1; + fixed_regs[26] = call_used_regs[26] = 1; + fixed_regs[27] = call_used_regs[27] = 1; + fixed_regs[30] = call_used_regs[30] = 1; + } + /* fp20-23 are now caller saved. */ + if (mips_abi == ABI_64) + { + int regno; + for (regno = FP_REG_FIRST + 20; regno < FP_REG_FIRST + 24; regno++) + call_really_used_regs[regno] = call_used_regs[regno] = 1; + } + /* odd registers from fp21 to fp31 are now caller saved. */ + if (mips_abi == ABI_N32 || mips_abi == ABI_MEABI) + { + int regno; + for (regno = FP_REG_FIRST + 21; regno <= FP_REG_FIRST + 31; regno+=2) + call_really_used_regs[regno] = call_used_regs[regno] = 1; + } +} + /* Allocate a chunk of memory for per-function machine-dependent data. */ static struct machine_function * mips_init_machine_status () diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 3fae4ec37bf..7bdee66074f 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -77,11 +77,9 @@ enum processor_type { /* Recast the cpu class to be the cpu attribute. */ #define mips_cpu_attr ((enum attr_cpu)mips_tune) -/* Which ABI to use. These are constants because abi64.h must check their - value at preprocessing time. - - ABI_32 (original 32, or o32), ABI_N32 (n32), ABI_64 (n64) are all - defined by SGI. ABI_O64 is o32 extended to work on a 64 bit machine. */ +/* Which ABI to use. ABI_32 (original 32, or o32), ABI_N32 (n32), + ABI_64 (n64) are all defined by SGI. ABI_O64 is o32 extended + to work on a 64 bit machine. */ #define ABI_32 0 #define ABI_N32 1 @@ -868,73 +866,7 @@ extern void sbss_section PARAMS ((void)); #define OVERRIDE_OPTIONS override_options () -/* 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. - - If the usage of an entire class of registers depends on the target - flags, you may indicate this to GCC by using this macro to modify - `fixed_regs' and `call_used_regs' to 1 for each of the registers in - the classes which should not be used by GCC. Also define the macro - `REG_CLASS_FROM_LETTER' to return `NO_REGS' if it is called with a - letter for a class that shouldn't be used. - - (However, if this class is not included in `GENERAL_REGS' and all - of the insn patterns whose constraints permit this class are - controlled by target switches, then GCC will automatically avoid - using these registers when the target switches are opposed to - them.) */ - -#define CONDITIONAL_REGISTER_USAGE \ -do \ - { \ - if (!TARGET_HARD_FLOAT) \ - { \ - int regno; \ - \ - for (regno = FP_REG_FIRST; regno <= FP_REG_LAST; regno++) \ - fixed_regs[regno] = call_used_regs[regno] = 1; \ - for (regno = ST_REG_FIRST; regno <= ST_REG_LAST; regno++) \ - fixed_regs[regno] = call_used_regs[regno] = 1; \ - } \ - else if (! ISA_HAS_8CC) \ - { \ - int regno; \ - \ - /* We only have a single condition code register. We \ - implement this by hiding all the condition code registers, \ - and generating RTL that refers directly to ST_REG_FIRST. */ \ - for (regno = ST_REG_FIRST; regno <= ST_REG_LAST; regno++) \ - fixed_regs[regno] = call_used_regs[regno] = 1; \ - } \ - /* In mips16 mode, we permit the $t temporary registers to be used \ - for reload. We prohibit the unused $s registers, since they \ - are caller saved, and saving them via a mips16 register would \ - probably waste more time than just reloading the value. */ \ - if (TARGET_MIPS16) \ - { \ - fixed_regs[18] = call_used_regs[18] = 1; \ - fixed_regs[19] = call_used_regs[19] = 1; \ - fixed_regs[20] = call_used_regs[20] = 1; \ - fixed_regs[21] = call_used_regs[21] = 1; \ - fixed_regs[22] = call_used_regs[22] = 1; \ - fixed_regs[23] = call_used_regs[23] = 1; \ - fixed_regs[26] = call_used_regs[26] = 1; \ - fixed_regs[27] = call_used_regs[27] = 1; \ - fixed_regs[30] = call_used_regs[30] = 1; \ - } \ - SUBTARGET_CONDITIONAL_REGISTER_USAGE \ - } \ -while (0) - -/* This is meant to be redefined in the host dependent files. */ -#define SUBTARGET_CONDITIONAL_REGISTER_USAGE +#define CONDITIONAL_REGISTER_USAGE mips_conditional_register_usage () /* Show we can debug even without a frame pointer. */ #define CAN_DEBUG_WITHOUT_FP @@ -2552,8 +2484,10 @@ extern enum reg_class mips_char_to_class[256]; in register. In case an argument list is of form GF used registers are a0 (a2,a3), but we should push over a1... */ -#define REG_PARM_STACK_SPACE(FNDECL) \ - ((MAX_ARGS_IN_REGISTERS*UNITS_PER_WORD) - FIRST_PARM_OFFSET (FNDECL)) +#define REG_PARM_STACK_SPACE(FNDECL) \ + ((mips_abi == ABI_32 || mips_abi == ABI_O64) \ + ? (MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD) - FIRST_PARM_OFFSET (FNDECL) \ + : 0) /* Define this if it is the responsibility of the caller to allocate the area reserved for arguments passed in registers. @@ -2562,10 +2496,9 @@ extern enum reg_class mips_char_to_class[256]; `current_function_outgoing_args_size'. */ #define OUTGOING_REG_PARM_STACK_SPACE -/* Align stack frames on 64 bits (Double Word ). */ -#ifndef STACK_BOUNDARY -#define STACK_BOUNDARY 64 -#endif +#define STACK_BOUNDARY \ + ((mips_abi == ABI_32 || mips_abi == ABI_O64 || mips_abi == ABI_EABI) \ + ? 64 : 128) /* Make sure 4 words are always allocated on the stack. */ @@ -2613,14 +2546,19 @@ extern enum reg_class mips_char_to_class[256]; #define GP_RETURN (GP_REG_FIRST + 2) #define FP_RETURN ((TARGET_SOFT_FLOAT) ? GP_RETURN : (FP_REG_FIRST + 0)) +#define MAX_ARGS_IN_REGISTERS \ + ((mips_abi == ABI_32 || mips_abi == ABI_O64) ? 4 : 8) + +/* Largest possible value of MAX_ARGS_IN_REGISTERS. */ + +#define BIGGEST_MAX_ARGS_IN_REGISTERS 8 + /* Symbolic macros for the first/last argument registers. */ #define GP_ARG_FIRST (GP_REG_FIRST + 4) -#define GP_ARG_LAST (GP_REG_FIRST + 7) +#define GP_ARG_LAST (GP_ARG_FIRST + MAX_ARGS_IN_REGISTERS - 1) #define FP_ARG_FIRST (FP_REG_FIRST + 12) -#define FP_ARG_LAST (FP_REG_FIRST + 15) - -#define MAX_ARGS_IN_REGISTERS 4 +#define FP_ARG_LAST (FP_ARG_FIRST + MAX_ARGS_IN_REGISTERS - 1) /* Define how to find the value returned by a library function assuming the value has mode MODE. Because we define @@ -2683,6 +2621,8 @@ extern enum reg_class mips_char_to_class[256]; #define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT +#define STRICT_ARGUMENT_NAMING (mips_abi != ABI_32 && mips_abi != ABI_O64) + /* 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 @@ -2757,7 +2697,7 @@ typedef struct mips_args { the shift patterns, and function_arg, which returns them when given a VOIDmode argument. */ unsigned int num_adjusts; - rtx adjust[MAX_ARGS_IN_REGISTERS]; + rtx adjust[BIGGEST_MAX_ARGS_IN_REGISTERS]; } CUMULATIVE_ARGS; /* Initialize a variable CUM of type CUMULATIVE_ARGS @@ -2812,6 +2752,39 @@ typedef struct mips_args { ? PARM_BOUNDARY \ : GET_MODE_ALIGNMENT(MODE))) +#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ + function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED) + +#define FUNCTION_ARG_PADDING(MODE, TYPE) \ + (! BYTES_BIG_ENDIAN \ + ? upward \ + : (((MODE) == BLKmode \ + ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ + && int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT))\ + : (GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY \ + && (mips_abi == ABI_32 \ + || mips_abi == ABI_O64 \ + || mips_abi == ABI_EABI \ + || GET_MODE_CLASS (MODE) == MODE_INT))) \ + ? downward : upward)) + +#define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) \ + (mips_abi == ABI_EABI && (NAMED) \ + && FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, NAMED)) + +/* Modified version of the macro in expr.h. */ +#define MUST_PASS_IN_STACK(MODE,TYPE) \ + ((TYPE) != 0 \ + && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ + || TREE_ADDRESSABLE (TYPE) \ + || ((MODE) == BLKmode \ + && mips_abi != ABI_32 && mips_abi != ABI_O64 \ + && ! ((TYPE) != 0 && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ + && 0 == (int_size_in_bytes (TYPE) \ + % (PARM_BOUNDARY / BITS_PER_UNIT))) \ + && (FUNCTION_ARG_PADDING (MODE, TYPE) \ + == (BYTES_BIG_ENDIAN ? upward : downward))))) + /* True if using EABI and varargs can be passed in floating-point registers. Under these conditions, we need a more complex form of va_list, which tracks GPR, FPR and stack arguments separately. */ @@ -2826,10 +2799,12 @@ typedef struct mips_args { || (regno == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed) \ || (regno == (GP_REG_FIRST + 31) && regs_ever_live[GP_REG_FIRST + 31])) -/* ALIGN FRAMES on double word boundaries */ -#ifndef MIPS_STACK_ALIGN -#define MIPS_STACK_ALIGN(LOC) (((LOC) + 7) & ~7) -#endif +/* Treat LOC as a byte offset from the stack pointer and round it up + to the next fully-aligned offset. */ +#define MIPS_STACK_ALIGN(LOC) \ + ((mips_abi == ABI_32 || mips_abi == ABI_O64 || mips_abi == ABI_EABI) \ + ? ((LOC) + 7) & ~7 \ + : ((LOC) + 15) & ~15) /* Define the `__builtin_va_list' type for the ABI. */ diff --git a/gcc/hard-reg-set.h b/gcc/hard-reg-set.h index e80f39e4575..9cdd96835c9 100644 --- a/gcc/hard-reg-set.h +++ b/gcc/hard-reg-set.h @@ -405,6 +405,10 @@ extern HARD_REG_SET fixed_reg_set; extern char call_used_regs[FIRST_PSEUDO_REGISTER]; +#ifdef CALL_REALLY_USED_REGISTERS +extern char call_really_used_regs[]; +#endif + /* The same info as a HARD_REG_SET. */ extern HARD_REG_SET call_used_reg_set; |