diff options
Diffstat (limited to 'gcc/config/mips')
-rw-r--r-- | gcc/config/mips/iris5.h | 6 | ||||
-rw-r--r-- | gcc/config/mips/iris6.h | 2 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 37 | ||||
-rw-r--r-- | gcc/config/mips/mips.h | 63 | ||||
-rw-r--r-- | gcc/config/mips/sni-svr4.h | 1 |
5 files changed, 39 insertions, 70 deletions
diff --git a/gcc/config/mips/iris5.h b/gcc/config/mips/iris5.h index 7e3efa0a1f3..2c8fd83dd74 100644 --- a/gcc/config/mips/iris5.h +++ b/gcc/config/mips/iris5.h @@ -19,6 +19,8 @@ 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. */ +#define TARGET_IRIX5 1 + #ifndef TARGET_DEFAULT #define TARGET_DEFAULT MASK_ABICALLS #endif @@ -155,10 +157,6 @@ do { \ fputs (" .text\n", FILE); \ } while (0) -/* To get unaligned data, we have to turn off auto alignment. */ -#define UNALIGNED_SHORT_ASM_OP "\t.align 0\n\t.half\t" -#define UNALIGNED_INT_ASM_OP "\t.align 0\n\t.word\t" - /* Also do this for libcalls. */ #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ mips_output_external_libcall (FILE, XSTR (FUN, 0)) diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h index d7a989ad007..776434a8d59 100644 --- a/gcc/config/mips/iris6.h +++ b/gcc/config/mips/iris6.h @@ -159,8 +159,6 @@ Boston, MA 02111-1307, USA. */ #undef ASM_OUTPUT_UNDEF_FUNCTION #undef ASM_OUTPUT_EXTERNAL_LIBCALL #undef ASM_DECLARE_FUNCTION_SIZE -#undef UNALIGNED_SHORT_ASM_OP -#undef UNALIGNED_INT_ASM_OP /* Stuff we need for Irix 6 that isn't in Irix 5. */ diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 1d79f8ed3f8..9601efb946d 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -118,6 +118,7 @@ static void abort_with_insn PARAMS ((rtx, const char *)) ATTRIBUTE_NORETURN; static int symbolic_expression_p PARAMS ((rtx)); static void mips_add_gc_roots PARAMS ((void)); +static bool mips_assemble_integer PARAMS ((rtx, unsigned int, int)); static void mips_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); static void mips_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); static enum processor_type mips_parse_cpu PARAMS ((const char *)); @@ -456,6 +457,20 @@ enum reg_class mips_char_to_class[256] = }; /* Initialize the GCC target structure. */ +#undef TARGET_ASM_ALIGNED_HI_OP +#define TARGET_ASM_ALIGNED_HI_OP "\t.half\t" +#undef TARGET_ASM_ALIGNED_SI_OP +#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t" +#undef TARGET_ASM_INTEGER +#define TARGET_ASM_INTEGER mips_assemble_integer + +#if TARGET_IRIX5 && !TARGET_IRIX6 +#undef TARGET_ASM_UNALIGNED_HI_OP +#define TARGET_ASM_UNALIGNED_HI_OP "\t.align 0\n\t.half\t" +#undef TARGET_ASM_UNALIGNED_SI_OP +#define TARGET_ASM_UNALIGNED_SI_OP "\t.align 0\n\t.word\t" +#endif + #undef TARGET_ASM_FUNCTION_PROLOGUE #define TARGET_ASM_FUNCTION_PROLOGUE mips_output_function_prologue #undef TARGET_ASM_FUNCTION_EPILOGUE @@ -5788,7 +5803,29 @@ print_operand_address (file, addr) break; } } + +/* Target hook for assembling integer objects. It appears that the Irix + 6 assembler can't handle 64-bit decimal integers, so avoid printing + such an integer here. */ +static bool +mips_assemble_integer (x, size, aligned_p) + rtx x; + unsigned int size; + int aligned_p; +{ + if ((TARGET_64BIT || TARGET_GAS) && size == 8 && aligned_p) + { + fputs ("\t.dword\t", asm_out_file); + if (HOST_BITS_PER_WIDE_INT < 64 || GET_CODE (x) != CONST_INT) + output_addr_const (asm_out_file, x); + else + print_operand (asm_out_file, x, 'X'); + fputc ('\n', asm_out_file); + return true; + } + return default_assemble_integer (x, size, aligned_p); +} /* If optimizing for the global pointer, keep track of all of the externs, so that at the end of the file, we can emit the appropriate .extern diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index b0415087faf..c877fd15adc 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -4396,69 +4396,6 @@ do { \ mips_output_float (STREAM, VALUE) -/* This is how to output an assembler line defining an `int' constant. */ - -#define ASM_OUTPUT_INT(STREAM,VALUE) \ -do { \ - fprintf (STREAM, "\t.word\t"); \ - output_addr_const (STREAM, (VALUE)); \ - fprintf (STREAM, "\n"); \ -} while (0) - -/* Likewise for 64 bit, `char' and `short' constants. - - FIXME: operand_subword can't handle some complex constant expressions - that output_addr_const can (for example it does not call - simplify_subtraction). Since GAS can handle dword, even for mipsII, - rely on that to avoid operand_subword for most of the cases where this - matters. Try gcc.c-torture/compile/930326-1.c with -mips2 -mlong64, - or the same case with the type of 'i' changed to long long. - -*/ - -#define ASM_OUTPUT_DOUBLE_INT(STREAM,VALUE) \ -do { \ - if (TARGET_64BIT || TARGET_GAS) \ - { \ - fprintf (STREAM, "\t.dword\t"); \ - if (HOST_BITS_PER_WIDE_INT < 64 || GET_CODE (VALUE) != CONST_INT) \ - /* We can't use 'X' for negative numbers, because then we won't \ - get the right value for the upper 32 bits. */ \ - output_addr_const (STREAM, VALUE); \ - else \ - /* We must use 'X', because otherwise LONG_MIN will print as \ - a number that the Irix 6 assembler won't accept. */ \ - print_operand (STREAM, VALUE, 'X'); \ - fprintf (STREAM, "\n"); \ - } \ - else \ - { \ - assemble_integer (operand_subword ((VALUE), 0, 0, DImode), \ - UNITS_PER_WORD, BITS_PER_WORD, 1); \ - assemble_integer (operand_subword ((VALUE), 1, 0, DImode), \ - UNITS_PER_WORD, BITS_PER_WORD, 1); \ - } \ -} while (0) - -#define ASM_OUTPUT_SHORT(STREAM,VALUE) \ -{ \ - fprintf (STREAM, "\t.half\t"); \ - output_addr_const (STREAM, (VALUE)); \ - fprintf (STREAM, "\n"); \ -} - -#define ASM_OUTPUT_CHAR(STREAM,VALUE) \ -{ \ - fprintf (STREAM, "\t.byte\t"); \ - output_addr_const (STREAM, (VALUE)); \ - fprintf (STREAM, "\n"); \ -} - -/* This is how to output an assembler line for a numeric constant byte. */ - -#define ASM_OUTPUT_BYTE(STREAM,VALUE) \ - fprintf (STREAM, "\t.byte\t0x%x\n", (int)(VALUE)) - /* This is how to output an element of a case-vector that is absolute. */ #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \ diff --git a/gcc/config/mips/sni-svr4.h b/gcc/config/mips/sni-svr4.h index 1df69745f21..e1783556490 100644 --- a/gcc/config/mips/sni-svr4.h +++ b/gcc/config/mips/sni-svr4.h @@ -68,7 +68,6 @@ Boston, MA 02111-1307, USA. */ #define NM_FLAGS "-p" -#define ASM_LONG ".word\t" #define ASM_GLOBAL ".rdata\n\t\t.globl\t" #include "mips/mips.h" |