diff options
author | Richard Sandiford <rsandifo@redhat.com> | 2001-12-17 15:05:40 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2001-12-17 15:05:40 +0000 |
commit | 301d03af8a3cbf51e79ff35c1aa71a6f353709c5 (patch) | |
tree | db00089740b52986d77e25864271a24f731e7688 /gcc/config/sparc | |
parent | 00a8c0b430ad9ed836ab88fba25ef2acf16d3a0d (diff) | |
download | gcc-301d03af8a3cbf51e79ff35c1aa71a6f353709c5.zip gcc-301d03af8a3cbf51e79ff35c1aa71a6f353709c5.tar.gz gcc-301d03af8a3cbf51e79ff35c1aa71a6f353709c5.tar.bz2 |
target.h (asm_out.byte_op, [...]): New fields.
* target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op,
asm_out.integer): New fields.
* target-def.h (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_[HSDT]I_OP,
TARGET_ASM_UNALIGNED_[HSDT]I_OP, TARGET_ASM_INTEGER): New initialisers.
(TARGET_ASM_ALIGNED_INT_OP, TARGET_ASM_UNALIGNED_INT_OP): Collect
the individual initialisers together.
(TARGET_ASM_OUT): Add the new initialisers.
* output.h (assemble_integer): Return bool.
(integer_asm_op): Declare.
(default_assemble_integer): Declare.
(assemble_aligned_integer): New interface to assemble_integer.
* varasm.c (integer_asm_op): New function to select pseudo-op.
(default_assemble_integer): Default implementation of asm_out.integer.
(assemble_integer): Use the new target hook. Split objects into
words or bytes if the target hook fails. Return bool.
* doc/tm.texi (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_OUTPUT_SHORT,
ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, ASM_OUTPUT_QUADRUPLE_INT,
UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP,
UNALIGNED_DOUBLE_INT_ASM_OP): Undocument.
Document new target hooks.
* defaults.h (ASM_OUTPUT_ADDR_VEC_ELT): Use integer_asm_op.
* dwarf2asm.c (unaligned_integer_asm_op): Remove.
(dw2_assemble_integer): New.
(dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset,
dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx,
dw2_asm_output_encoded_addr_rtx): Use it.
(dw2_asm_output_nstring): Use assemble_integer for the null terminator.
(dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128): Use
integer_asm_op to get the byte pseudo-op. Use assemble_integer
if it returns NULL.
* dwarf2asm.h (dw2_assemble_integer): Declare.
* dwarfout.c: Include dwarf2asm.h. Use dwarf2 functions for the
default implementation of most macros.
(output_unsigned_leb128): Use dw2_asm_output_data.
(output_signed_leb128, dwarfout_source_line): Likewise.
(output_reg_number): Use dw2_assemble_integer.
(generate_macinfo_entry): Separate the type and offset arguments.
Use assemble_integer to write the value.
(dwarfout_start_source_file): Update generate_macinfo_entry usage.
(dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Likewise.
* final.c (output_addr_const): Don't put brackets round a subtracted
symbol value or ".".
* halfpic.c (half_pic_finish): Use assemble_aligned_integer.
* config/1750a/1750a.c (assemble_integer_1750a): New,
* config/alpha/alpha.h (literal_section): Avoid ASM_OUTPUT_INT.
* config/arc/arc.c (arc_assemble_integer): New.
* config/arc/arc.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT.
* config/arm/arm.c (arm_poke_function_name): Likewise.
(arm_assemble_integer): New, extracted from...
* config/arm/arm.h (OUTPUT_INT_ADDR_CONST): ...here, now removed.
(ARM_TRAMPOLINE_TEMPLATE, ARM_FUNCTION_PROFILER): Avoid ASM_OUTPUT_INT.
(ARM_FUNCTION_PROFILER): Likewise.
* config/avr/avr-protos.h (asm_output_byte): Remove.
(asm_output_char, asm_output_short): Remove.
* config/avr/avr.c (avr_assemble_integer): New.
(asm_output_byte, asm_output_char, asm_output_short): Remove.
* config/clipper/clipper.h (ASM_LONG): Remove.
* config/dsp16xx/dsp16xx-protos.h (asm_output_long): Remove.
* config/dsp16xx/dsp16xx.c (asm_output_long): Remove.
* config/elxsi/elxsi.c (elxsi_assemble_integer): New.
* config/i370/i370.c (i370_hlasm_assemble_integer): New.
* config/i370/i370.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT.
(ASM_BYTE, ASM_SHORT, ASM_LONG): Delete.
* config/i386/att.h, (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP.
* config/i386/linux.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use
ASM_LONG instead of UNALIGNED_INT_ASM_OP.
* config/i386/sco5.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise.
(ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP.
* config/i386/sysv4.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use
ASM_LONG instead of UNALIGNED_INT_ASM_OP.
* config/i860/fx2800.h (ASM_FILE_END): Avoid ASM_LONG.
* config/i860/i860.c (i860_output_function_epilogue): Likewise.
* config/i860/i860.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT.
(ASM_SHORT, ASM_LONG): Undefine.
* config/i860/paragon.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP.
* config/i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise.
* config/i960/i960.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT.
* config/ia64/ia64.c (ia64_assemble_integer): New.
* config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Use integer_asm_op.
(ASM_OUTPUT_DWARF_PCREL): Likewise.
* config/m68hc11/m68hc11.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT,
ASM_OUTPUT_ADDR_DIFF_ELT, ASM_OUTPUT_ADDR_VEC_ELT): Avoid ASM_LONG.
(ASM_SHORT, ASM_LONG): Remove.
* config/m68k/m68k.h (INT_OP_GROUP): New macro.
(INT_OP_STANDARD, INT_OP_DOT_WORD, INT_OP_NO_DOT, INT_OP_DC): New
macros, the allowed values for INT_OP_GROUP.
* config/m68k/amix.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP
* config/m68k/atari.h (ASM_OUTPUT_ASCII): Likewise
* config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Likewise
* config/m68k/auxas.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove.
(INT_OP_GROUP): Define to INT_OP_NO_DOT.
* config/m68k/dpx2.h (ASM_LONG): Undefine.
(INT_OP_GROUP): Define to INT_OP_DC.
* config/m68k/dpx2g.h (ASM_LONG): Undefine.
* config/m68k/hp320.h (INT_OP_GROUP): Define to INT_OP_NO_DOT.
* config/m68k/lynx.h (ASM_LONG): Undefine.
* config/m68k/dpx2g.h (ASM_LONG): Undefine.
* config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP.
* config/m68k/m68kv4.h (ASM_OUTPUT_ASCII): Likewise.
(TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_*.
* config/m68k/mot3300.h (INT_OP_GROUP): Define to INT_OP_STANDARD
for GAS and INT_OP_NO_DOT otherwise.
(ASM_CHAR, ASM_BYTE, ASM_SHORT, ASM_LONG): Remove.
(ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT,
ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid ASM_LONG.
(ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP.
* config/m68k/sgs.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove.
(INT_OP_GROUP): Define to INT_OP_STANDARD.
(ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT,
ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid LONG_ASM_OP.
(ASM_OUTPUT_ASCII): Avoid BYTE_ASM_OP.
* config/m68k/tower-as.h (ASM_LONG): Remove.
(INT_OP_GROUP): Define to INT_OP_NO_DOT.
* config/m88k/m88k.c (output_tdesc): Avoid ASM_LONG.
* config/m88k/m88k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT.
(ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG.
* config/mips/iris5.h (TARGET_IRIX5): Define.
* config/mips/mips.c (mips_assemble_integer): New.
* config/mips/sni-svr4.h (ASM_LONG): Undefine.
* config/mmix/mmix-protos.h (mmix_asm_output_double_int): Remove.
* config/mmix/mmix.c (mmix_assemble_integer): New.
(mmix_asm_output_double_int): Remove.
(mmix_print_operand): Call mmix_output_octa directly.
* config/mmix/mmix.h (ASM_LONG): Remove.
* config/ns32k/ns32k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT.
* config/pa/pa.c (pa_assemble_integer): New.
(pa_override_options): Only use aligned DI ops on 64-bit targets.
Only use the unaligned ops if TARGET_GAS.
* config/pdp11/pdp11.c (pdp11_assemble_integer): New.
* config/pdp11/pdp11.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT.
* config/pj/pj.h (ASM_LONG): Undefine.
* config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Undefine.
* config/rs6000/rs6000.c (rs6000_assemble_integer): New, mostly
extracted from ASM_OUTPUT_INT in sysv4.h. Use in_text_section()
and in_toc_section() rather than the in_section variable.
(rs6000_override_options): Only use DI ops when TARGET_POWERPC64.
* config/rs6000/sysv4.h (TOC_SECTION_FUNCTION): Add in_toc_section().
(RELOCATABLE_NEEDS_FIXUP): Define.
* config/rs6000/xcoff.h (DOUBLE_INT_ASM_OP): Change space to tab.
* config/s390/linux.h (ASM_SHORT, ASM_LONG, ASM_QUAD): Remove.
(ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Use integer_asm_op
to get the word directive.
(ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP.
* config/s390/s390.c (s390_assemble_integer): New.
* config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Use
integer_asm_op to get the word directive.
* config/sparc/sol2.h (ASM_SHORT, ASM_LONG): Remove.
* config/sparc/sparc-protos.h (output_double_int): Remove.
* config/sparc/sparc.c (output_double_int): Move to...
(sparc_assemble_integer): ...this new function.
(sparc_override_options): Only use .uaxword if TARGET_ARCH64.
* config/sparc/sparc.h (ASM_SHORT, ASM_LONG, ASM_LONGLONG): Remove.
* config/sparc/sysv4.h (ASM_LONG): Remove.
(ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid
ASM_LONG.
* config/vax/vax.h (TRAMPOLINE_TEMPLATE): Use assemble_aligned_integer.
* config/we32k/we32k.h (TRAMPOLINE_TEMPLATE): Likewise.
* config/1750a/1750a.c, config/a29k/a29k.c, config/alpha/alpha.c,
config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c,
config/clipper/clipper.c, config/convex/convex.c, config/cris/cris.c,
config/d30v/d30v.c, config/dsp16xx/dsp16xx.c, config/elxsi/elxsi.c,
config/fr30/fr30.c, config/h8300/h8300.c, config/i370/i370.c,
config/i386/i386.c, config/i860/i860.c, config/i960/i960.c,
config/ia64/ia64.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/m88k/m88k.c, config/mips/mips.c,
config/mmix/mmix.c, config/mn10200/mn10200.c, config/mn10300/mn10300.c,
config/ns32k/ns32k.c, config/pa/pa.c, config/pdp11/pdp11.c,
config/sh/sh.c, config/sparc/sparc.c, config/stormy16/stormy16.c,
config/v850/v850.c, config/vax/vax.c, config/we32k/we32k.c
(TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_HI_OP,
TARGET_ASM_ALIGNED_SI_OP, TARGET_ASM_ALIGNED_DI_OP,
TARGET_ASM_UNALIGNED_HI_OP, TARGET_ASM_UNALIGNED_SI_OP,
TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_INTEGER): Redefine as
appropriate.
* config/defaults.h, config/darwin.h, config/elfos.h, config/svr3.h,
config/1750a/1750a.h, config/a29k/a29k.h, config/alpha/alpha.h,
config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h,
config/clipper/clipper.h, config/convex/convex.h, config/cris/cris.h,
config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, config/elxsi/elxsi.h,
config/fr30/fr30.h, config/h8300/h8300.h, config/i370/i370.h,
config/i386/bsd.h, config/i386/djgpp.h, config/i386/i386.h,
config/i386/sco5.h, config/i386/sol2.h, config/i386/sun386.h,
config/i860/i860.h, config/i960/i960.h, config/ia64/ia64.h,
config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/auxas.h,
config/m68k/dpx2.h, config/m68k/hp320.h, config/m68k/m68k.h,
config/m68k/mot3300.h, config/m68k/sgs.h, config/m68k/tower-as.h,
config/m88k/m88k.h, config/mcore/mcore-elf.h, config/mcore/mcore.h,
config/mips/iris5.h, config/mips/iris6.h, config/mips/mips.h,
config/mmix/mmix.h, config/mn10200/mn10200.h, config/mn10300/mn10300.h
config/ns32k/encore.h, config/ns32k/ns32k.h, config/pa/pa-64.h,
config/pa/pa.h, config/pdp11/pdp11.h, config/pj/pj.h,
config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/rs6000.h,
config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/linux.h,
config/sh/sh.h, config/sparc/linux64.h, config/sparc/sol2.h,
config/sparc/sp64-elf.h, config/sparc/sparc.h, config/sparc/sysv4.h,
config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h,
config/we32k/we32k.h (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_BYTE_OP,
ASM_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT,
UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP,
UNALIGNED_DOUBLE_INT_ASM_OP): Undefine, where defined.
From-SVN: r48101
Diffstat (limited to 'gcc/config/sparc')
-rw-r--r-- | gcc/config/sparc/linux64.h | 8 | ||||
-rw-r--r-- | gcc/config/sparc/sol2.h | 7 | ||||
-rw-r--r-- | gcc/config/sparc/sp64-elf.h | 5 | ||||
-rw-r--r-- | gcc/config/sparc/sparc-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 94 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.h | 49 | ||||
-rw-r--r-- | gcc/config/sparc/sun4gas.h | 5 | ||||
-rw-r--r-- | gcc/config/sparc/sysv4.h | 7 |
8 files changed, 54 insertions, 122 deletions
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h index 54b672e..6138446 100644 --- a/gcc/config/sparc/linux64.h +++ b/gcc/config/sparc/linux64.h @@ -353,14 +353,6 @@ do { \ #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ sprintf (LABEL, "*.L%s%ld", PREFIX, (long)(NUM)) -/* Define the names of various pseudo-ops used by the Sparc/svr4 assembler. - ??? If ints are 64 bits then UNALIGNED_INT_ASM_OP (defined elsewhere) is - misnamed. These should all refer to explicit sizes (half/word/xword?), - anything other than short/int/long/etc. */ - -#undef UNALIGNED_DOUBLE_INT_ASM_OP -#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.uaxword\t" - /* DWARF bits. */ /* Follow Irix 6 and not the Dwarf2 draft in using 64-bit offsets. diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h index 9f6e38c..82f7d32 100644 --- a/gcc/config/sparc/sol2.h +++ b/gcc/config/sparc/sol2.h @@ -95,13 +95,6 @@ Boston, MA 02111-1307, USA. */ #define ASM_OUTPUT_SKIP(FILE,SIZE) \ fprintf (FILE, "\t.skip %u\n", (SIZE)) -/* Use .uahalf/.uaword so packed structure members don't generate - assembler errors when using the native assembler. */ -#undef ASM_SHORT -#define ASM_SHORT ".uahalf" -#undef ASM_LONG -#define ASM_LONG ".uaword" - /* This is how to output a definition of an internal numbered label where PREFIX is the class of label and NUM is the number within the class. */ diff --git a/gcc/config/sparc/sp64-elf.h b/gcc/config/sparc/sp64-elf.h index 40d18df..3bd2a53 100644 --- a/gcc/config/sparc/sp64-elf.h +++ b/gcc/config/sparc/sp64-elf.h @@ -114,8 +114,3 @@ crtbegin.o%s \ #undef PREFERRED_DEBUGGING_TYPE #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG - -/* Define the names of various pseudo-ops used by the Sparc/svr4 assembler. */ - -#undef UNALIGNED_DOUBLE_INT_ASM_OP -#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.uaxword\t" diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h index 7e0e1fc..b0778eb 100644 --- a/gcc/config/sparc/sparc-protos.h +++ b/gcc/config/sparc/sparc-protos.h @@ -90,7 +90,6 @@ extern const char *output_return PARAMS ((rtx *)); extern const char *output_sibcall PARAMS ((rtx, rtx)); extern char *output_v9branch PARAMS ((rtx, int, int, int, int, int, rtx)); extern void emit_v9_brxx_insn PARAMS ((enum rtx_code, rtx, rtx)); -extern void output_double_int PARAMS ((FILE *, rtx)); extern void print_operand PARAMS ((FILE *, rtx, int)); extern int mems_ok_for_ldd_peep PARAMS ((rtx, rtx)); extern int arith_double_4096_operand PARAMS ((rtx, enum machine_mode)); diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 48906d4..d93f57c 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -151,6 +151,7 @@ static void sparc_add_gc_roots PARAMS ((void)); static void mark_ultrasparc_pipeline_state PARAMS ((void *)); static int check_return_regs PARAMS ((rtx)); static int epilogue_renumber PARAMS ((rtx *, int)); +static bool sparc_assemble_integer PARAMS ((rtx, unsigned int, int)); static int ultra_cmove_results_ready_p PARAMS ((rtx)); static int ultra_fpmode_conflict_exists PARAMS ((enum machine_mode)); static rtx *ultra_find_type PARAMS ((int, rtx *, int)); @@ -202,6 +203,27 @@ struct sparc_cpu_select sparc_select[] = enum processor_type sparc_cpu; /* Initialize the GCC target structure. */ + +/* The sparc default is to use .half rather than .short for aligned + HI objects. Use .word instead of .long on non-ELF systems. */ +#undef TARGET_ASM_ALIGNED_HI_OP +#define TARGET_ASM_ALIGNED_HI_OP "\t.half\t" +#ifndef OBJECT_FORMAT_ELF +#undef TARGET_ASM_ALIGNED_SI_OP +#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t" +#endif + +#undef TARGET_ASM_UNALIGNED_HI_OP +#define TARGET_ASM_UNALIGNED_HI_OP "\t.uahalf\t" +#undef TARGET_ASM_UNALIGNED_SI_OP +#define TARGET_ASM_UNALIGNED_SI_OP "\t.uaword\t" +#undef TARGET_ASM_UNALIGNED_DI_OP +#define TARGET_ASM_UNALIGNED_DI_OP "\t.uaxword\t" + +/* The target hook has to handle DI-mode values. */ +#undef TARGET_ASM_INTEGER +#define TARGET_ASM_INTEGER sparc_assemble_integer + #undef TARGET_ASM_FUNCTION_PROLOGUE #define TARGET_ASM_FUNCTION_PROLOGUE sparc_output_function_prologue #undef TARGET_ASM_FUNCTION_EPILOGUE @@ -401,6 +423,10 @@ sparc_override_options () if (flag_pcc_struct_return == DEFAULT_PCC_STRUCT_RETURN) flag_pcc_struct_return = (TARGET_ARCH64 ? 0 : 1); + /* Only use .uaxword when compiling for a 64-bit target. */ + if (!TARGET_ARCH64) + targetm.asm_out.unaligned_op.di = NULL; + /* Do various machine dependent initializations. */ sparc_init_modes (); @@ -6008,65 +6034,33 @@ print_operand (file, x, code) else { output_addr_const (file, x); } } -/* This function outputs assembler code for VALUE to FILE, where VALUE is - a 64 bit (DImode) value. */ +/* Target hook for assembling integer objects. The sparc version has + special handling for aligned DI-mode objects. */ -/* ??? If there is a 64 bit counterpart to .word that the assembler - understands, then using that would simply this code greatly. */ -/* ??? We only output .xword's for symbols and only then in environments - where the assembler can handle them. */ - -void -output_double_int (file, value) - FILE *file; - rtx value; +static bool +sparc_assemble_integer (x, size, aligned_p) + rtx x; + unsigned int size; + int aligned_p; { - if (GET_CODE (value) == CONST_INT) - { - /* ??? This has endianness issues. */ -#if HOST_BITS_PER_WIDE_INT == 64 - HOST_WIDE_INT xword = INTVAL (value); - HOST_WIDE_INT high, low; - - high = (xword >> 32) & 0xffffffff; - low = xword & 0xffffffff; - ASM_OUTPUT_INT (file, GEN_INT (high)); - ASM_OUTPUT_INT (file, GEN_INT (low)); -#else - if (INTVAL (value) < 0) - ASM_OUTPUT_INT (file, constm1_rtx); - else - ASM_OUTPUT_INT (file, const0_rtx); - ASM_OUTPUT_INT (file, value); -#endif - } - else if (GET_CODE (value) == CONST_DOUBLE) + /* ??? We only output .xword's for symbols and only then in environments + where the assembler can handle them. */ + if (aligned_p && size == 8 + && (GET_CODE (x) != CONST_INT && GET_CODE (x) != CONST_DOUBLE)) { - ASM_OUTPUT_INT (file, GEN_INT (CONST_DOUBLE_HIGH (value))); - ASM_OUTPUT_INT (file, GEN_INT (CONST_DOUBLE_LOW (value))); - } - else if (GET_CODE (value) == SYMBOL_REF - || GET_CODE (value) == CONST - || GET_CODE (value) == PLUS - || (TARGET_ARCH64 && - (GET_CODE (value) == LABEL_REF - || GET_CODE (value) == CODE_LABEL - || GET_CODE (value) == MINUS))) - { - if (! TARGET_V9) + if (TARGET_V9) { - ASM_OUTPUT_INT (file, const0_rtx); - ASM_OUTPUT_INT (file, value); + assemble_integer_with_op ("\t.xword\t", x); + return true; } else { - fprintf (file, "\t%s\t", ASM_LONGLONG); - output_addr_const (file, value); - fprintf (file, "\n"); + assemble_aligned_integer (4, const0_rtx); + assemble_aligned_integer (4, x); + return true; } } - else - abort (); + return default_assemble_integer (x, size, aligned_p); } /* Return the value of a code used in the .proc pseudo-op that says diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 4d88325..3580275 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -2652,10 +2652,6 @@ do { \ /* ??? Try to make the style consistent here (_OP?). */ -#define ASM_LONGLONG ".xword" -#define ASM_LONG ".word" -#define ASM_SHORT ".half" -#define ASM_BYTE_OP "\t.byte\t" #define ASM_FLOAT ".single" #define ASM_DOUBLE ".double" #define ASM_LONGDOUBLE ".xxx" /* ??? Not known (or used yet). */ @@ -2732,7 +2728,8 @@ do { \ char str[30]; \ REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \ REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \ - fprintf (FILE, "\t%s\t0x%lx %s ~%s\n", ASM_LONG, t, \ + fprintf (FILE, "\t%s\t0x%lx %s ~%s\n", \ + integer_asm_op (4, TRUE), t, \ ASM_COMMENT_START, str); \ } \ @@ -2745,11 +2742,12 @@ do { \ { \ long t[2]; \ char str[30]; \ + const char *long_op = integer_asm_op (4, TRUE); \ REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), t); \ REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \ - fprintf (FILE, "\t%s\t0x%lx %s ~%s\n", ASM_LONG, t[0], \ + fprintf (FILE, "\t%s\t0x%lx %s ~%s\n", long_op, t[0], \ ASM_COMMENT_START, str); \ - fprintf (FILE, "\t%s\t0x%lx\n", ASM_LONG, t[1]); \ + fprintf (FILE, "\t%s\t0x%lx\n", long_op, t[1]); \ } /* This is how to output an assembler line defining a `long double' @@ -2759,43 +2757,16 @@ do { \ { \ long t[4]; \ char str[30]; \ + const char *long_op = integer_asm_op (4, TRUE); \ REAL_VALUE_TO_TARGET_LONG_DOUBLE ((VALUE), t); \ REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \ - fprintf (FILE, "\t%s\t0x%lx %s ~%s\n", ASM_LONG, t[0], \ + fprintf (FILE, "\t%s\t0x%lx %s ~%s\n", long_op, t[0], \ ASM_COMMENT_START, str); \ - fprintf (FILE, "\t%s\t0x%lx\n", ASM_LONG, t[1]); \ - fprintf (FILE, "\t%s\t0x%lx\n", ASM_LONG, t[2]); \ - fprintf (FILE, "\t%s\t0x%lx\n", ASM_LONG, t[3]); \ + fprintf (FILE, "\t%s\t0x%lx\n", long_op, t[1]); \ + fprintf (FILE, "\t%s\t0x%lx\n", long_op, t[2]); \ + fprintf (FILE, "\t%s\t0x%lx\n", long_op, t[3]); \ } -/* This is how to output an assembler line defining an `int' constant. */ - -#define ASM_OUTPUT_INT(FILE,VALUE) \ -( fprintf (FILE, "\t%s\t", ASM_LONG), \ - output_addr_const (FILE, (VALUE)), \ - fprintf (FILE, "\n")) - -/* This is how to output an assembler line defining a DImode constant. */ -#define ASM_OUTPUT_DOUBLE_INT(FILE,VALUE) \ - output_double_int (FILE, VALUE) - -/* Likewise for `char' and `short' constants. */ - -#define ASM_OUTPUT_SHORT(FILE,VALUE) \ -( fprintf (FILE, "\t%s\t", ASM_SHORT), \ - output_addr_const (FILE, (VALUE)), \ - fprintf (FILE, "\n")) - -#define ASM_OUTPUT_CHAR(FILE,VALUE) \ -( fprintf (FILE, "%s", ASM_BYTE_OP), \ - output_addr_const (FILE, (VALUE)), \ - fprintf (FILE, "\n")) - -/* This is how to output an assembler line for a numeric constant byte. */ - -#define ASM_OUTPUT_BYTE(FILE,VALUE) \ - fprintf (FILE, "%s0x%x\n", ASM_BYTE_OP, (int)(VALUE)) - /* This is how we hook in and defer the case-vector until the end of the function. */ #define ASM_OUTPUT_ADDR_VEC(LAB,VEC) \ diff --git a/gcc/config/sparc/sun4gas.h b/gcc/config/sparc/sun4gas.h index 0848ecd..7f4f7db 100644 --- a/gcc/config/sparc/sun4gas.h +++ b/gcc/config/sparc/sun4gas.h @@ -18,10 +18,5 @@ 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. */ -/* gas supports unaligned data. */ -#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.uaxword\t" -#define UNALIGNED_INT_ASM_OP "\t.uaword\t" -#define UNALIGNED_SHORT_ASM_OP "\t.uahalf\t" - /* defaults.h will define DWARF2_UNWIND_INFO for us. */ #undef DWARF2_UNWIND_INFO diff --git a/gcc/config/sparc/sysv4.h b/gcc/config/sparc/sysv4.h index be10190..a4c7f91 100644 --- a/gcc/config/sparc/sysv4.h +++ b/gcc/config/sparc/sysv4.h @@ -87,16 +87,9 @@ Boston, MA 02111-1307, USA. */ #define STRING_ASM_OP "\t.asciz\t" #define COMMON_ASM_OP "\t.common\t" #define SKIP_ASM_OP "\t.skip\t" -#define UNALIGNED_DOUBLE_INT_ASM_OP (TARGET_ARCH64 ? "\t.uaxword\t" : NULL) -#define UNALIGNED_INT_ASM_OP "\t.uaword\t" -#define UNALIGNED_SHORT_ASM_OP "\t.uahalf\t" #define PUSHSECTION_ASM_OP "\t.pushsection\t" #define POPSECTION_ASM_OP "\t.popsection" -/* This is defined in sparc.h but is not used by svr4.h. */ -#undef ASM_LONG -#define ASM_LONG ".long" - /* This is the format used to print the second operand of a .type pseudo-op for the Sparc/svr4 assembler. */ |