Commit b2d8cf33 by Jim Wilson

Add -mabi=n32 support.

(ABI_64BIT): Delete.
(TARGET_OPTIONS, INITIAL_ELIMINATION_OFFSET, GO_IF_LEGITIMATE_ADDRESS,
CONSTANT_ADDRESS_P, LEGITIMATE_CONSTANT_P, LEGITIMIZE_ADDRESS,
ASM_OUTPUT_ADDR_DIFF_ELT): Modify.
(enum mips_abi_type, SUBTARGET_TARGET_OPTIONS): Define.
(mips_abi, mips_abi_string): Declare.

From-SVN: r12131
parent 694aa3f2
...@@ -74,6 +74,22 @@ enum processor_type { ...@@ -74,6 +74,22 @@ enum processor_type {
/* Recast the cpu class to be the cpu attribute. */ /* Recast the cpu class to be the cpu attribute. */
#define mips_cpu_attr ((enum attr_cpu)mips_cpu) #define mips_cpu_attr ((enum attr_cpu)mips_cpu)
/* Which ABI to use. This is only used by the Irix 6 port currently. */
enum mips_abi_type {
ABI_32,
ABI_N32,
ABI_64
};
#ifndef MIPS_ABI_DEFAULT
/* We define this away so that there is no extra runtime cost if the target
doesn't support multiple ABIs. */
#define mips_abi ABI_32
#else
extern enum mips_abi_type mips_abi;
#endif
/* Whether to emit abicalls code sequences or not. */ /* Whether to emit abicalls code sequences or not. */
enum mips_abicalls_type { enum mips_abicalls_type {
...@@ -119,6 +135,7 @@ extern enum mips_abicalls_type mips_abicalls;/* for svr4 abi pic calls */ ...@@ -119,6 +135,7 @@ extern enum mips_abicalls_type mips_abicalls;/* for svr4 abi pic calls */
extern int mips_isa; /* architectural level */ extern int mips_isa; /* architectural level */
extern char *mips_cpu_string; /* for -mcpu=<xxx> */ extern char *mips_cpu_string; /* for -mcpu=<xxx> */
extern char *mips_isa_string; /* for -mips{1,2,3,4} */ extern char *mips_isa_string; /* for -mips{1,2,3,4} */
extern char *mips_abi_string; /* for -misa={32,n32,64} */
extern int dslots_load_total; /* total # load related delay slots */ extern int dslots_load_total; /* total # load related delay slots */
extern int dslots_load_filled; /* # filled load delay slots */ extern int dslots_load_filled; /* # filled load delay slots */
extern int dslots_jump_total; /* total # jump related delay slots */ extern int dslots_jump_total; /* total # jump related delay slots */
...@@ -450,10 +467,14 @@ extern char *mktemp (); ...@@ -450,10 +467,14 @@ extern char *mktemp ();
#define TARGET_OPTIONS \ #define TARGET_OPTIONS \
{ \ { \
SUBTARGET_TARGET_OPTIONS \
{ "cpu=", &mips_cpu_string }, \ { "cpu=", &mips_cpu_string }, \
{ "ips", &mips_isa_string } \ { "ips", &mips_isa_string } \
} }
/* This is meant to be redefined in the host dependent files. */
#define SUBTARGET_TARGET_OPTIONS
/* Macros to decide whether certain features are available or not, /* Macros to decide whether certain features are available or not,
depending on the instruction set architecture level. */ depending on the instruction set architecture level. */
...@@ -530,7 +551,7 @@ do \ ...@@ -530,7 +551,7 @@ do \
} \ } \
while (0) while (0)
/* This is meant to be redefined in the host dependent files */ /* This is meant to be redefined in the host dependent files. */
#define SUBTARGET_CONDITIONAL_REGISTER_USAGE #define SUBTARGET_CONDITIONAL_REGISTER_USAGE
/* Show we can debug even without a frame pointer. */ /* Show we can debug even without a frame pointer. */
...@@ -1635,10 +1656,6 @@ extern enum reg_class mips_secondary_reload_class (); ...@@ -1635,10 +1656,6 @@ extern enum reg_class mips_secondary_reload_class ();
/* Stack layout; function entry, exit and calling. */ /* Stack layout; function entry, exit and calling. */
/* Don't enable support for the 64 bit ABI calling convention.
Some embedded code depends on the old 64 bit calling convention. */
#define ABI_64BIT 0
/* Define this if pushing a word on the stack /* Define this if pushing a word on the stack
makes the stack pointer a smaller address. */ makes the stack pointer a smaller address. */
#define STACK_GROWS_DOWNWARD #define STACK_GROWS_DOWNWARD
...@@ -1790,7 +1807,7 @@ extern struct mips_frame_info current_frame_info; ...@@ -1790,7 +1807,7 @@ extern struct mips_frame_info current_frame_info;
&& ((TO) == FRAME_POINTER_REGNUM \ && ((TO) == FRAME_POINTER_REGNUM \
|| (TO) == STACK_POINTER_REGNUM)) \ || (TO) == STACK_POINTER_REGNUM)) \
(OFFSET) = (current_frame_info.total_size \ (OFFSET) = (current_frame_info.total_size \
- (ABI_64BIT && mips_isa >= 3 \ - (mips_abi != ABI_32 \
? current_function_pretend_args_size \ ? current_function_pretend_args_size \
: 0)); \ : 0)); \
else if ((FROM) == RETURN_ADDRESS_POINTER_REGNUM \ else if ((FROM) == RETURN_ADDRESS_POINTER_REGNUM \
...@@ -2371,7 +2388,7 @@ typedef struct mips_args { ...@@ -2371,7 +2388,7 @@ typedef struct mips_args {
/* ??? Reject combining an address with a register for the MIPS \ /* ??? Reject combining an address with a register for the MIPS \
64 bit ABI, because the SGI assembler can not handle this. */ \ 64 bit ABI, because the SGI assembler can not handle this. */ \
if (!TARGET_DEBUG_A_MODE \ if (!TARGET_DEBUG_A_MODE \
&& ! ABI_64BIT \ && mips_abi == ABI_32 \
&& CONSTANT_ADDRESS_P (xplus1) \ && CONSTANT_ADDRESS_P (xplus1) \
&& (!TARGET_EMBEDDED_PIC \ && (!TARGET_EMBEDDED_PIC \
|| code1 != CONST \ || code1 != CONST \
...@@ -2400,7 +2417,7 @@ typedef struct mips_args { ...@@ -2400,7 +2417,7 @@ typedef struct mips_args {
|| GET_CODE (X) == CONST_INT || GET_CODE (X) == HIGH \ || GET_CODE (X) == CONST_INT || GET_CODE (X) == HIGH \
|| (GET_CODE (X) == CONST \ || (GET_CODE (X) == CONST \
&& ! (flag_pic && pic_address_needs_scratch (X)) \ && ! (flag_pic && pic_address_needs_scratch (X)) \
&& ! ABI_64BIT)) \ && mips_abi == ABI_32)) \
&& (!HALF_PIC_P () || !HALF_PIC_ADDRESS_P (X))) && (!HALF_PIC_P () || !HALF_PIC_ADDRESS_P (X)))
/* Define this, so that when PIC, reload won't try to reload invalid /* Define this, so that when PIC, reload won't try to reload invalid
...@@ -2419,7 +2436,7 @@ typedef struct mips_args { ...@@ -2419,7 +2436,7 @@ typedef struct mips_args {
#define LEGITIMATE_CONSTANT_P(X) \ #define LEGITIMATE_CONSTANT_P(X) \
((GET_CODE (X) != CONST_DOUBLE \ ((GET_CODE (X) != CONST_DOUBLE \
|| mips_const_double_ok (X, GET_MODE (X))) \ || mips_const_double_ok (X, GET_MODE (X))) \
&& ! (GET_CODE (X) == CONST && ABI_64BIT)) && ! (GET_CODE (X) == CONST && mips_abi != ABI_32))
/* A C compound statement that attempts to replace X with a valid /* A C compound statement that attempts to replace X with a valid
memory address for an operand of mode MODE. WIN will be a C memory address for an operand of mode MODE. WIN will be a C
...@@ -2473,7 +2490,7 @@ typedef struct mips_args { ...@@ -2473,7 +2490,7 @@ typedef struct mips_args {
if (GET_CODE (xinsn) == CONST \ if (GET_CODE (xinsn) == CONST \
&& ((flag_pic && pic_address_needs_scratch (xinsn)) \ && ((flag_pic && pic_address_needs_scratch (xinsn)) \
/* ??? SGI's Irix 6 assembler can't handle CONST. */ \ /* ??? SGI's Irix 6 assembler can't handle CONST. */ \
|| ABI_64BIT)) \ || mips_abi != ABI_32)) \
{ \ { \
rtx ptr_reg = gen_reg_rtx (Pmode); \ rtx ptr_reg = gen_reg_rtx (Pmode); \
rtx constant = XEXP (XEXP (xinsn, 0), 1); \ rtx constant = XEXP (XEXP (xinsn, 0), 1); \
...@@ -3594,15 +3611,14 @@ do { \ ...@@ -3594,15 +3611,14 @@ do { \
fprintf (STREAM, "\t%s\t%sL%d-%sLS%d\n", \ fprintf (STREAM, "\t%s\t%sL%d-%sLS%d\n", \
TARGET_LONG64 ? ".dword" : ".word", \ TARGET_LONG64 ? ".dword" : ".word", \
LOCAL_LABEL_PREFIX, VALUE, LOCAL_LABEL_PREFIX, REL); \ LOCAL_LABEL_PREFIX, VALUE, LOCAL_LABEL_PREFIX, REL); \
else if (! ABI_64BIT) \ else if (mips_abi == ABI_32) \
fprintf (STREAM, "\t%s\t%sL%d\n", \ fprintf (STREAM, "\t%s\t%sL%d\n", \
TARGET_LONG64 ? ".gpdword" : ".gpword", \ TARGET_LONG64 ? ".gpdword" : ".gpword", \
LOCAL_LABEL_PREFIX, VALUE); \ LOCAL_LABEL_PREFIX, VALUE); \
else \ else \
/* ??? Why does this one use . and not LOCAL_LABEL_PREFIX? */ \ fprintf (STREAM, "\t%s\t%sL%d\n", \
fprintf (STREAM, "\t%s\t.L%d\n", \
TARGET_LONG64 ? ".dword" : ".word", \ TARGET_LONG64 ? ".dword" : ".word", \
VALUE); \ LOCAL_LABEL_PREFIX, VALUE); \
} while (0) } while (0)
/* When generating embedded PIC code we want to put the jump table in /* When generating embedded PIC code we want to put the jump table in
......
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