This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to kill config/mips/abi64.h
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 30 Jul 2002 21:32:58 +0100
- Subject: Patch to kill config/mips/abi64.h
This patch moves stuff from config/mips/abi64.h into config/mips/mips.h.
There's no point having it in a separate file now that every config
understands -mabi.
I took the opportunity to move CONDITIONAL_REGISTER_USAGE into
mips.c since it was getting a bit unwieldly as a macro. Other
than that, and fixing a couple of formatting niggles, the macros
have been copied across as-is. Also defined BIGGEST_MAX_ARGS_IN_
REGISTERS for the benefit of struct mips_args.
Tested on mips-elf (big/little endian, hard/soft float).
No regressions. OK to install?
Richard
* 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.
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.229
diff -c -d -p -r1.229 config.gcc
*** config.gcc 29 Jul 2002 22:21:40 -0000 1.229
--- config.gcc 30 Jul 2002 20:29:53 -0000
*************** mips-*-ecoff* | mipsel-*-ecoff*)
*** 1883,1894 ****
tmake_file=mips/t-ecoff
;;
mipsisa32-*-elf* | mipsisa32el-*-elf*)
! tm_file="${tm_file} mips/elf.h mips/abi64.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"
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"
--- 1883,1894 ----
tmake_file=mips/t-ecoff
;;
mipsisa32-*-elf* | mipsisa32el-*-elf*)
! 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"
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"
*************** mips*-*-rtems*)
*** 1930,1936 ****
fi
;;
mipstx39-*-elf* | mipstx39el-*-elf*)
! tm_file="${tm_file} mips/r3900.h mips/elf.h mips/abi64.h"
tmake_file=mips/t-r3900
;;
mmix-knuth-mmixware)
--- 1930,1936 ----
fi
;;
mipstx39-*-elf* | mipstx39el-*-elf*)
! tm_file="${tm_file} mips/r3900.h mips/elf.h"
tmake_file=mips/t-r3900
;;
mmix-knuth-mmixware)
Index: hard-reg-set.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/hard-reg-set.h,v
retrieving revision 1.15
diff -c -d -p -r1.15 hard-reg-set.h
*** hard-reg-set.h 16 Jul 2002 05:54:07 -0000 1.15
--- hard-reg-set.h 30 Jul 2002 20:29:54 -0000
*************** extern HARD_REG_SET fixed_reg_set;
*** 405,410 ****
--- 405,414 ----
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;
Index: config/mips/abi64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/abi64.h,v
retrieving revision 1.27
diff -c -d -p -r1.27 abi64.h
*** config/mips/abi64.h 25 Jul 2002 10:15:58 -0000 1.27
--- config/mips/abi64.h 30 Jul 2002 20:29:54 -0000
***************
*** 1,132 ****
- /* 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. */
--- 0 ----
Index: config/mips/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/linux.h,v
retrieving revision 1.50
diff -c -d -p -r1.50 linux.h
*** config/mips/linux.h 29 Jul 2002 22:21:41 -0000 1.50
--- config/mips/linux.h 30 Jul 2002 20:29:54 -0000
*************** along with GNU CC; see the file COPYING.
*** 18,25 ****
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"
--- 18,23 ----
Index: config/mips/iris6.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/iris6.h,v
retrieving revision 1.52
diff -c -d -p -r1.52 iris6.h
*** config/mips/iris6.h 25 Jul 2002 10:15:59 -0000 1.52
--- config/mips/iris6.h 30 Jul 2002 20:29:54 -0000
*************** Boston, MA 02111-1307, USA. */
*** 32,38 ****
#endif
#include "mips/iris5.h"
- #include "mips/abi64.h"
/* Irix6 assembler does handle DWARF2 directives. Override setting in
irix5.h file. */
--- 32,37 ----
Index: config/mips/mips-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips-protos.h,v
retrieving revision 1.27
diff -c -d -p -r1.27 mips-protos.h
*** config/mips/mips-protos.h 17 Jul 2002 09:24:08 -0000 1.27
--- config/mips/mips-protos.h 30 Jul 2002 20:29:54 -0000
*************** extern const char *mips_restore_gp
*** 104,109 ****
--- 104,110 ----
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));
Index: config/mips/mips.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.h,v
retrieving revision 1.205
diff -c -d -p -r1.205 mips.h
*** config/mips/mips.h 30 Jul 2002 19:08:23 -0000 1.205
--- config/mips/mips.h 30 Jul 2002 20:29:54 -0000
*************** extern void sbss_section PARAMS ((void)
*** 866,938 ****
#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
/* Show we can debug even without a frame pointer. */
#define CAN_DEBUG_WITHOUT_FP
--- 866,872 ----
#define OVERRIDE_OPTIONS override_options ()
! #define CONDITIONAL_REGISTER_USAGE mips_conditional_register_usage ()
/* Show we can debug even without a frame pointer. */
#define CAN_DEBUG_WITHOUT_FP
*************** extern enum reg_class mips_char_to_class
*** 2550,2557 ****
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 this if it is the responsibility of the caller to
allocate the area reserved for arguments passed in registers.
--- 2484,2493 ----
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) \
! ((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.
*************** extern enum reg_class mips_char_to_class
*** 2560,2569 ****
`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
/* Make sure 4 words are always allocated on the stack. */
--- 2496,2504 ----
`current_function_outgoing_args_size'. */
#define OUTGOING_REG_PARM_STACK_SPACE
! #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. */
*************** extern enum reg_class mips_char_to_class
*** 2611,2624 ****
#define GP_RETURN (GP_REG_FIRST + 2)
#define FP_RETURN ((TARGET_SOFT_FLOAT) ? GP_RETURN : (FP_REG_FIRST + 0))
/* 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 FP_ARG_FIRST (FP_REG_FIRST + 12)
! #define FP_ARG_LAST (FP_REG_FIRST + 15)
!
! #define MAX_ARGS_IN_REGISTERS 4
/* Define how to find the value returned by a library function
assuming the value has mode MODE. Because we define
--- 2546,2564 ----
#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_ARG_FIRST + MAX_ARGS_IN_REGISTERS - 1)
#define FP_ARG_FIRST (FP_REG_FIRST + 12)
! #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
*************** extern enum reg_class mips_char_to_class
*** 2681,2686 ****
--- 2621,2628 ----
#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
*************** typedef struct mips_args {
*** 2755,2761 ****
the shift patterns, and function_arg, which returns them when given
a VOIDmode argument. */
unsigned int num_adjusts;
! rtx adjust[MAX_ARGS_IN_REGISTERS];
} CUMULATIVE_ARGS;
/* Initialize a variable CUM of type CUMULATIVE_ARGS
--- 2697,2703 ----
the shift patterns, and function_arg, which returns them when given
a VOIDmode argument. */
unsigned int num_adjusts;
! rtx adjust[BIGGEST_MAX_ARGS_IN_REGISTERS];
} CUMULATIVE_ARGS;
/* Initialize a variable CUM of type CUMULATIVE_ARGS
*************** typedef struct mips_args {
*** 2810,2815 ****
--- 2752,2790 ----
? 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. */
*************** typedef struct mips_args {
*** 2824,2833 ****
|| (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
/* Define the `__builtin_va_list' type for the ABI. */
--- 2799,2810 ----
|| (regno == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed) \
|| (regno == (GP_REG_FIRST + 31) && regs_ever_live[GP_REG_FIRST + 31]))
! /* 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. */
Index: config/mips/mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.219
diff -c -d -p -r1.219 mips.c
*** config/mips/mips.c 29 Jul 2002 22:21:41 -0000 1.219
--- config/mips/mips.c 30 Jul 2002 20:29:54 -0000
*************** override_options ()
*** 5405,5410 ****
--- 5405,5466 ----
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 ()