Commit 7f9be256 by Thiemo Seufer Committed by Richard Sandiford

mips.h (TARGET_OLDABI): Define.

	* config/mips/mips.h (TARGET_OLDABI): Define. Use TARGET_NEWABI and
	TARGET_LODABI consistently.
	* config/mips/mips.c (function_arg,mips_setup_incoming_varargs,
	mips_va_arg,override_options,compute_frame_size,
	mips_initial_elimination_offset,mips16_fp_args,build_mips16_call_stub
	,mips_return_in_memory,mips_strict_argument_naming): Use TARGET_NEWABI
	and TARGET_LODABI consistently.
	* config/mips/mips.md (exception_receiver): Likewise.
	* config/mips/linux64.h: Likewise.

From-SVN: r77643
parent 6d0ef01e
2004-02-11 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* config/mips/mips.h (TARGET_OLDABI): Define. Use TARGET_NEWABI and
TARGET_LODABI consistently.
* config/mips/mips.c (function_arg,mips_setup_incoming_varargs,
mips_va_arg,override_options,compute_frame_size,
mips_initial_elimination_offset,mips16_fp_args,build_mips16_call_stub
,mips_return_in_memory,mips_strict_argument_naming): Use TARGET_NEWABI
and TARGET_LODABI consistently.
* config/mips/mips.md (exception_receiver): Likewise.
* config/mips/linux64.h: Likewise.
2004-02-11 Hartmut Penner <hpenner@de.ibm.com> 2004-02-11 Hartmut Penner <hpenner@de.ibm.com>
* gcc/config/rs6000/rs6000.c (rs6000_override_options) * gcc/config/rs6000/rs6000.c (rs6000_override_options)
......
...@@ -74,8 +74,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -74,8 +74,7 @@ Boston, MA 02111-1307, USA. */
%{mabi=32:-melf32%{EB:b}%{EL:l}tsmip}" %{mabi=32:-melf32%{EB:b}%{EL:l}tsmip}"
#undef LOCAL_LABEL_PREFIX #undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX ((mips_abi == ABI_32 || mips_abi == ABI_O64) \ #define LOCAL_LABEL_PREFIX (TARGET_OLDABI ? "$" : ".")
? "$" : ".")
/* The size in bytes of a DWARF field indicating an offset or length /* The size in bytes of a DWARF field indicating an offset or length
relative to a debug info section, specified to be 4 bytes in the DWARF-2 relative to a debug info section, specified to be 4 bytes in the DWARF-2
......
...@@ -3795,7 +3795,7 @@ function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode, ...@@ -3795,7 +3795,7 @@ function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode,
if (type != 0 if (type != 0
&& TREE_CODE (type) == RECORD_TYPE && TREE_CODE (type) == RECORD_TYPE
&& (mips_abi == ABI_N32 || mips_abi == ABI_64) && TARGET_NEWABI
&& TYPE_SIZE_UNIT (type) && TYPE_SIZE_UNIT (type)
&& host_integerp (TYPE_SIZE_UNIT (type), 1) && host_integerp (TYPE_SIZE_UNIT (type), 1)
&& named) && named)
...@@ -4002,7 +4002,7 @@ mips_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, ...@@ -4002,7 +4002,7 @@ mips_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
} }
} }
} }
if (mips_abi == ABI_32 || mips_abi == ABI_O64) if (TARGET_OLDABI)
{ {
/* No need for pretend arguments: the register parameter area was /* No need for pretend arguments: the register parameter area was
allocated by the caller. */ allocated by the caller. */
...@@ -4392,8 +4392,7 @@ mips_va_arg (tree valist, tree type) ...@@ -4392,8 +4392,7 @@ mips_va_arg (tree valist, tree type)
that alignments <= UNITS_PER_WORD are preserved by the va_arg that alignments <= UNITS_PER_WORD are preserved by the va_arg
increment mechanism. */ increment mechanism. */
if ((mips_abi == ABI_N32 || mips_abi == ABI_64) if (TARGET_NEWABI && TYPE_ALIGN (type) > 64)
&& TYPE_ALIGN (type) > 64)
align = 16; align = 16;
else if (TARGET_64BIT) else if (TARGET_64BIT)
align = 8; align = 8;
...@@ -4742,7 +4741,7 @@ override_options (void) ...@@ -4742,7 +4741,7 @@ override_options (void)
} }
} }
if (mips_abi != ABI_32 && mips_abi != ABI_O64) if (!TARGET_OLDABI)
flag_pcc_struct_return = 0; flag_pcc_struct_return = 0;
#if defined(USE_COLLECT2) #if defined(USE_COLLECT2)
...@@ -6425,7 +6424,7 @@ compute_frame_size (HOST_WIDE_INT size) ...@@ -6425,7 +6424,7 @@ compute_frame_size (HOST_WIDE_INT size)
/* Add in space reserved on the stack by the callee for storing arguments /* Add in space reserved on the stack by the callee for storing arguments
passed in registers. */ passed in registers. */
if (mips_abi != ABI_32 && mips_abi != ABI_O64) if (!TARGET_OLDABI)
total_size += MIPS_STACK_ALIGN (current_function_pretend_args_size); total_size += MIPS_STACK_ALIGN (current_function_pretend_args_size);
/* Save other computed information. */ /* Save other computed information. */
...@@ -6496,7 +6495,7 @@ mips_initial_elimination_offset (int from, int to) ...@@ -6496,7 +6495,7 @@ mips_initial_elimination_offset (int from, int to)
case ARG_POINTER_REGNUM: case ARG_POINTER_REGNUM:
offset = cfun->machine->frame.total_size; offset = cfun->machine->frame.total_size;
if (mips_abi == ABI_N32 || mips_abi == ABI_64) if (TARGET_NEWABI)
offset -= current_function_pretend_args_size; offset -= current_function_pretend_args_size;
break; break;
...@@ -7854,7 +7853,7 @@ mips16_fp_args (FILE *file, int fp_code, int from_fp_p) ...@@ -7854,7 +7853,7 @@ mips16_fp_args (FILE *file, int fp_code, int from_fp_p)
unsigned int f; unsigned int f;
/* This code only works for the original 32 bit ABI and the O64 ABI. */ /* This code only works for the original 32 bit ABI and the O64 ABI. */
if (mips_abi != ABI_32 && mips_abi != ABI_O64) if (!TARGET_OLDABI)
abort (); abort ();
if (from_fp_p) if (from_fp_p)
...@@ -8051,7 +8050,7 @@ build_mips16_call_stub (rtx retval, rtx fn, rtx arg_size, int fp_code) ...@@ -8051,7 +8050,7 @@ build_mips16_call_stub (rtx retval, rtx fn, rtx arg_size, int fp_code)
/* This code will only work for o32 and o64 abis. The other ABI's /* This code will only work for o32 and o64 abis. The other ABI's
require more sophisticated support. */ require more sophisticated support. */
if (mips_abi != ABI_32 && mips_abi != ABI_O64) if (!TARGET_OLDABI)
abort (); abort ();
/* We can only handle SFmode and DFmode floating point return /* We can only handle SFmode and DFmode floating point return
...@@ -9357,7 +9356,7 @@ mips_hard_regno_nregs (int regno, enum machine_mode mode) ...@@ -9357,7 +9356,7 @@ mips_hard_regno_nregs (int regno, enum machine_mode mode)
static bool static bool
mips_return_in_memory (tree type, tree fndecl ATTRIBUTE_UNUSED) mips_return_in_memory (tree type, tree fndecl ATTRIBUTE_UNUSED)
{ {
if (mips_abi == ABI_32 || mips_abi == ABI_O64) if (TARGET_OLDABI)
return (TYPE_MODE (type) == BLKmode); return (TYPE_MODE (type) == BLKmode);
else else
return ((int_size_in_bytes (type) > (2 * UNITS_PER_WORD)) return ((int_size_in_bytes (type) > (2 * UNITS_PER_WORD))
...@@ -9367,7 +9366,7 @@ mips_return_in_memory (tree type, tree fndecl ATTRIBUTE_UNUSED) ...@@ -9367,7 +9366,7 @@ mips_return_in_memory (tree type, tree fndecl ATTRIBUTE_UNUSED)
static bool static bool
mips_strict_argument_naming (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED) mips_strict_argument_naming (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED)
{ {
return (mips_abi != ABI_32 && mips_abi != ABI_O64); return !TARGET_OLDABI;
} }
static int static int
......
...@@ -347,6 +347,7 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -347,6 +347,7 @@ extern const struct mips_cpu_info *mips_tune_info;
#define TUNE_SB1 (mips_tune == PROCESSOR_SB1) #define TUNE_SB1 (mips_tune == PROCESSOR_SB1)
#define TUNE_SR71K (mips_tune == PROCESSOR_SR71000) #define TUNE_SR71K (mips_tune == PROCESSOR_SR71000)
#define TARGET_OLDABI (mips_abi == ABI_32 || mips_abi == ABI_O64)
#define TARGET_NEWABI (mips_abi == ABI_N32 || mips_abi == ABI_64) #define TARGET_NEWABI (mips_abi == ABI_N32 || mips_abi == ABI_64)
/* IRIX specific stuff. */ /* IRIX specific stuff. */
...@@ -798,9 +799,7 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -798,9 +799,7 @@ extern const struct mips_cpu_info *mips_tune_info;
/* True if the ABI can only work with 64-bit integer registers. We /* True if the ABI can only work with 64-bit integer registers. We
generally allow ad-hoc variations for TARGET_SINGLE_FLOAT, but generally allow ad-hoc variations for TARGET_SINGLE_FLOAT, but
otherwise floating-point registers must also be 64-bit. */ otherwise floating-point registers must also be 64-bit. */
#define ABI_NEEDS_64BIT_REGS (mips_abi == ABI_64 \ #define ABI_NEEDS_64BIT_REGS (TARGET_NEWABI || mips_abi == ABI_O64)
|| mips_abi == ABI_O64 \
|| mips_abi == ABI_N32)
/* Likewise for 32-bit regs. */ /* Likewise for 32-bit regs. */
#define ABI_NEEDS_32BIT_REGS (mips_abi == ABI_32) #define ABI_NEEDS_32BIT_REGS (mips_abi == ABI_32)
...@@ -1334,8 +1333,7 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -1334,8 +1333,7 @@ extern const struct mips_cpu_info *mips_tune_info;
#define FLOAT_TYPE_SIZE 32 #define FLOAT_TYPE_SIZE 32
#define DOUBLE_TYPE_SIZE 64 #define DOUBLE_TYPE_SIZE 64
#define LONG_DOUBLE_TYPE_SIZE \ #define LONG_DOUBLE_TYPE_SIZE (TARGET_NEWABI ? 128 : 64)
(mips_abi == ABI_N32 || mips_abi == ABI_64 ? 128 : 64)
/* long double is not a fixed mode, but the idea is that, if we /* long double is not a fixed mode, but the idea is that, if we
support long double, we also want a 128-bit integer type. */ support long double, we also want a 128-bit integer type. */
...@@ -1358,8 +1356,8 @@ extern const struct mips_cpu_info *mips_tune_info; ...@@ -1358,8 +1356,8 @@ extern const struct mips_cpu_info *mips_tune_info;
#define POINTERS_EXTEND_UNSIGNED 0 #define POINTERS_EXTEND_UNSIGNED 0
/* Allocation boundary (in *bits*) for storing arguments in argument list. */ /* Allocation boundary (in *bits*) for storing arguments in argument list. */
#define PARM_BOUNDARY ((mips_abi == ABI_O64 || mips_abi == ABI_N32 \ #define PARM_BOUNDARY ((mips_abi == ABI_O64 \
|| mips_abi == ABI_64 \ || TARGET_NEWABI \
|| (mips_abi == ABI_EABI && TARGET_64BIT)) ? 64 : 32) || (mips_abi == ABI_EABI && TARGET_64BIT)) ? 64 : 32)
...@@ -2164,7 +2162,7 @@ extern enum reg_class mips_char_to_class[256]; ...@@ -2164,7 +2162,7 @@ extern enum reg_class mips_char_to_class[256];
/* o32 and o64 reserve stack space for all argument registers. */ /* o32 and o64 reserve stack space for all argument registers. */
#define REG_PARM_STACK_SPACE(FNDECL) \ #define REG_PARM_STACK_SPACE(FNDECL) \
((mips_abi == ABI_32 || mips_abi == ABI_O64) \ (TARGET_OLDABI \
? (MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD) \ ? (MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD) \
: 0) : 0)
...@@ -2175,10 +2173,7 @@ extern enum reg_class mips_char_to_class[256]; ...@@ -2175,10 +2173,7 @@ extern enum reg_class mips_char_to_class[256];
`current_function_outgoing_args_size'. */ `current_function_outgoing_args_size'. */
#define OUTGOING_REG_PARM_STACK_SPACE #define OUTGOING_REG_PARM_STACK_SPACE
#define STACK_BOUNDARY \ #define STACK_BOUNDARY ((TARGET_OLDABI || mips_abi == ABI_EABI) ? 64 : 128)
((mips_abi == ABI_32 || mips_abi == ABI_O64 || mips_abi == ABI_EABI) \
? 64 : 128)
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
...@@ -2188,8 +2183,7 @@ extern enum reg_class mips_char_to_class[256]; ...@@ -2188,8 +2183,7 @@ extern enum reg_class mips_char_to_class[256];
#define GP_RETURN (GP_REG_FIRST + 2) #define GP_RETURN (GP_REG_FIRST + 2)
#define FP_RETURN ((TARGET_SOFT_FLOAT) ? GP_RETURN : (FP_REG_FIRST + 0)) #define FP_RETURN ((TARGET_SOFT_FLOAT) ? GP_RETURN : (FP_REG_FIRST + 0))
#define MAX_ARGS_IN_REGISTERS \ #define MAX_ARGS_IN_REGISTERS (TARGET_OLDABI ? 4 : 8)
((mips_abi == ABI_32 || mips_abi == ABI_O64) ? 4 : 8)
/* Largest possible value of MAX_ARGS_IN_REGISTERS. */ /* Largest possible value of MAX_ARGS_IN_REGISTERS. */
...@@ -2373,7 +2367,7 @@ typedef struct mips_args { ...@@ -2373,7 +2367,7 @@ typedef struct mips_args {
/* Treat LOC as a byte offset from the stack pointer and round it up /* Treat LOC as a byte offset from the stack pointer and round it up
to the next fully-aligned offset. */ to the next fully-aligned offset. */
#define MIPS_STACK_ALIGN(LOC) \ #define MIPS_STACK_ALIGN(LOC) \
((mips_abi == ABI_32 || mips_abi == ABI_O64 || mips_abi == ABI_EABI) \ ((TARGET_OLDABI || mips_abi == ABI_EABI) \
? ((LOC) + 7) & ~7 \ ? ((LOC) + 7) & ~7 \
: ((LOC) + 15) & ~15) : ((LOC) + 15) & ~15)
...@@ -2396,7 +2390,7 @@ typedef struct mips_args { ...@@ -2396,7 +2390,7 @@ typedef struct mips_args {
fprintf (FILE, "\t.set\tnoat\n"); \ fprintf (FILE, "\t.set\tnoat\n"); \
fprintf (FILE, "\tmove\t%s,%s\t\t# save current return address\n", \ fprintf (FILE, "\tmove\t%s,%s\t\t# save current return address\n", \
reg_names[GP_REG_FIRST + 1], reg_names[GP_REG_FIRST + 31]); \ reg_names[GP_REG_FIRST + 1], reg_names[GP_REG_FIRST + 31]); \
if (mips_abi != ABI_N32 && mips_abi != ABI_64) \ if (!TARGET_NEWABI) \
{ \ { \
fprintf (FILE, \ fprintf (FILE, \
"\t%s\t%s,%s,%d\t\t# _mcount pops 2 words from stack\n", \ "\t%s\t%s,%s,%d\t\t# _mcount pops 2 words from stack\n", \
...@@ -3386,9 +3380,7 @@ while (0) ...@@ -3386,9 +3380,7 @@ while (0)
/* See mips_expand_prologue's use of loadgp for when this should be /* See mips_expand_prologue's use of loadgp for when this should be
true. */ true. */
#define DONT_ACCESS_GBLS_AFTER_EPILOGUE (TARGET_ABICALLS \ #define DONT_ACCESS_GBLS_AFTER_EPILOGUE (TARGET_ABICALLS && !TARGET_OLDABI)
&& mips_abi != ABI_32 \
&& mips_abi != ABI_O64)
#define DFMODE_NAN \ #define DFMODE_NAN \
......
...@@ -8318,7 +8318,7 @@ ld\t%2,%1-%S1(%2)\;daddu\t%2,%2,$31\;%*j\t%2%/" ...@@ -8318,7 +8318,7 @@ ld\t%2,%1-%S1(%2)\;daddu\t%2,%2,$31\;%*j\t%2%/"
(define_insn "exception_receiver" (define_insn "exception_receiver"
[(set (reg:SI 28) [(set (reg:SI 28)
(unspec_volatile:SI [(const_int 0)] UNSPEC_EH_RECEIVER))] (unspec_volatile:SI [(const_int 0)] UNSPEC_EH_RECEIVER))]
"TARGET_ABICALLS && (mips_abi == ABI_32 || mips_abi == ABI_O64)" "TARGET_ABICALLS && TARGET_OLDABI"
{ {
operands[0] = pic_offset_table_rtx; operands[0] = pic_offset_table_rtx;
operands[1] = mips_gp_save_slot (); operands[1] = mips_gp_save_slot ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment