+2001-12-17 Richard Sandiford <rsandifo@redhat.com>
+
+ * 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.
+
2001-12-17 Stan Shebs <shebs@apple.com>
* config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Define.
{"Init", "Normal", "Konst", "Static"};
static int which_bit PARAMS ((int));
+static bool assemble_integer_1750a PARAMS ((rtx, unsigned int, int));
static void output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP "\tdata\t"
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\tdatal\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP NULL
+#undef TARGET_ASM_INTEGER
+#define TARGET_ASM_INTEGER assemble_integer_1750a
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
addr_inc = 0;
}
+/* Target hook for assembling integer objects. The 1750a version needs to
+ keep track of how many bytes have been written. */
+
+static bool
+assemble_integer_1750a (x, size, aligned_p)
+ rtx x;
+ unsigned int size;
+ int aligned_p;
+{
+ if (default_assemble_integer (x, size, aligned_p))
+ {
+ if (label_pending)
+ label_pending = 0;
+ datalbl[datalbl_ndx].size += size;
+ return true;
+ }
+ return false;
+}
+
/*
* Return non zero if the LS 16 bits of the given value has just one bit set,
fprintf(FILE,"\n"); \
} while (0)
-/* This is how to output an assembler line defining a `char', `short', or
- `int' constant.
- 1750 NOTE: The reason why this macro also outputs `short' and `int'
- constants is that for the 1750, BITS_PER_UNIT is 16 (as opposed to the
- usual 8.) This behavior is different from the usual, where
- ASM_OUTPUT_CHAR only outputs character constants. The name
- of this macro should perhaps be `ASM_OUTPUT_QUARTER_INT' or so.
- */
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) do { \
- if (label_pending) \
- label_pending = 0; \
- datalbl[datalbl_ndx].size++; \
- fprintf(FILE, "\tdata\t"); \
- output_addr_const(FILE, VALUE); \
- fprintf(FILE, "\n"); \
- } while (0)
-
-/* This is how to output an assembler line defining a `long int' constant.
- 1750 NOTE: The reason why this macro outputs `long' instead of `short'
- constants is that for the 1750, BITS_PER_UNIT is 16 (as opposed to the
- usual 8.) The name of this macro should perhaps be `ASM_OUTPUT_HALF_INT'.
- */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) do { \
- if (label_pending) \
- label_pending = 0; \
- datalbl[datalbl_ndx].size += 2; \
- fprintf(FILE, "\tdatal\t%d\n",INTVAL(VALUE)); \
- } while (0)
-
-/* This is how to output an assembler line for a numeric constant byte. */
-
-#define ASM_OUTPUT_BYTE(FILE,VALUE) do { \
- if (label_pending) \
- label_pending = 0; \
- datalbl[datalbl_ndx].size++; \
- fprintf(FILE, "\tdata\t#%x\n", VALUE); \
- } while (0)
-
/* This is how to output an insn to push a register on the stack.
It need not be very fast code. */
int a29k_compare_fp_p;
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
fprintf (FILE, "\t.float %.20e\n", (VALUE))
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\t.word "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "\t.hword "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\t.byte "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
/* This is how to output an insn to push a register on the stack.
It need not be very fast code. */
reg_names[REGNO], reg_names[R_MSP], reg_names[R_MSP], \
reg_names[R_MSP]);
-/* This is how to output an assembler line for a numeric constant byte. */
-
-#define ASM_OUTPUT_BYTE(FILE,VALUE) \
- fprintf (FILE, "\t.byte 0x%x\n", (VALUE))
-
/* This is how to output an element of a case-vector that is absolute. */
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
# define TARGET_SECTION_TYPE_FLAGS unicosmk_section_type_flags
#endif
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
+#undef TARGET_ASM_ALIGNED_DI_OP
+#define TARGET_ASM_ALIGNED_DI_OP "\t.quad\t"
+
+/* Default unaligned ops are provided for ELF systems. To get unaligned
+ data for non-ELF systems, we have to turn off auto alignment. */
+#ifndef OBJECT_FORMAT_ELF
+#undef TARGET_ASM_UNALIGNED_HI_OP
+#define TARGET_ASM_UNALIGNED_HI_OP "\t.align 0\n\t.word\t"
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP "\t.align 0\n\t.long\t"
+#undef TARGET_ASM_UNALIGNED_DI_OP
+#define TARGET_ASM_UNALIGNED_DI_OP "\t.align 0\n\t.quad\t"
+#endif
+
#undef TARGET_ASM_FUNCTION_END_PROLOGUE
#define TARGET_ASM_FUNCTION_END_PROLOGUE alpha_output_function_end_prologue
if (firsttime) \
{ \
firsttime = 0; \
- ASM_OUTPUT_DOUBLE_INT (asm_out_file, const0_rtx); \
+ assemble_aligned_integer (8, const0_rtx); \
} \
\
in_section = readonly_data; \
fprintf (FILE, "\t.long 0x%lx\n", t & 0xffffffff); \
} while (0)
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\t.long "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* This is how to output an assembler line defining a `long' constant. */
-
-#define ASM_OUTPUT_DOUBLE_INT(FILE,VALUE) \
-( fprintf (FILE, "\t.quad "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
- fprintf (FILE, "\t.word %d\n", \
- (int)(GET_CODE (VALUE) == CONST_INT \
- ? INTVAL (VALUE) & 0xffff : (abort (), 0)))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
- fprintf (FILE, "\t.byte %d\n", \
- (int)(GET_CODE (VALUE) == CONST_INT \
- ? INTVAL (VALUE) & 0xff : (abort (), 0)))
-
/* We use the default ASCII-output routine, except that we don't write more
than 50 characters since the assembler doesn't support very long lines. */
} \
while (0)
-/* To get unaligned data, we have to turn off auto alignment. */
-#define UNALIGNED_SHORT_ASM_OP "\t.align 0\n\t.word\t"
-#define UNALIGNED_INT_ASM_OP "\t.align 0\n\t.long\t"
-#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.align 0\n\t.quad\t"
-
/* This is how to output an insn to push a register on the stack.
It need not be very fast code. */
(REGNO) > 32 ? "t" : "q", (REGNO) > 32 ? "f" : "", \
(REGNO) & 31);
-/* This is how to output an assembler line for a numeric constant byte. */
-
-#define ASM_OUTPUT_BYTE(FILE,VALUE) \
- fprintf (FILE, "\t.byte 0x%x\n", (int) ((VALUE) & 0xff))
-
/* This is how to output an element of a case-vector that is absolute.
(Alpha does not use such vectors, but we must define this macro anyway.) */
/* We support #pragma. */
#define HANDLE_SYSV_PRAGMA
-/* Undo the auto-alignment stuff from alpha.h. ELF has unaligned data
- pseudos natively. */
-#undef UNALIGNED_SHORT_ASM_OP
-#undef UNALIGNED_INT_ASM_OP
-#undef UNALIGNED_DOUBLE_INT_ASM_OP
-
/* Select a format to encode pointers in exception handling data. CODE
is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
true if the symbol may be affected by dynamic relocations.
static int get_arc_condition_code PARAMS ((rtx));
const struct attribute_spec arc_attribute_table[];
static tree arc_handle_interrupt_attribute PARAMS ((tree *, tree, tree, int, bool *));
+static bool arc_assemble_integer PARAMS ((rtx, unsigned int, int));
static void arc_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void arc_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
+#undef TARGET_ASM_INTEGER
+#define TARGET_ASM_INTEGER arc_assemble_integer
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE arc_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
}
}
\f
+/* Target hook to assemble an integer object. The ARC version needs to
+ emit a special directive for references to labels and function
+ symbols. */
+
+static bool
+arc_assemble_integer (x, size, aligned_p)
+ rtx x;
+ unsigned int size;
+ int aligned_p;
+{
+ if (size == UNITS_PER_WORD && aligned_p
+ && ((GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_FLAG (x))
+ || GET_CODE (x) == LABEL_REF))
+ {
+ fputs ("\t.word\t%st(", asm_out_file);
+ output_addr_const (asm_out_file, x);
+ fputs (")\n", asm_out_file);
+ return true;
+ }
+ return default_assemble_integer (x, size, aligned_p);
+}
+\f
/* Set up the stack and frame pointer (if desired) for the function. */
static void
*/
#define TRAMPOLINE_TEMPLATE(FILE) \
do { \
- ASM_OUTPUT_INT (FILE, GEN_INT (0x631f7c00)); \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
- ASM_OUTPUT_INT (FILE, GEN_INT (0x381f0000)); \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
+ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0x631f7c00)); \
+ assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
+ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0x381f0000)); \
+ assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
} while (0)
/* Length in units of the trampoline for entering a nested function. */
no longer contain unusual constructs. */
#define ASM_APP_OFF ""
-/* This is how to output an assembler line defining a `char' constant. */
-#define ASM_OUTPUT_CHAR(FILE, VALUE) \
-( fprintf (FILE, "\t.byte\t"), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* This is how to output an assembler line defining a `short' constant. */
-#define ASM_OUTPUT_SHORT(FILE, VALUE) \
-( fprintf (FILE, "\t.hword\t"), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* This is how to output an assembler line defining an `int' constant.
- We also handle symbol output here. Code addresses must be right shifted
- by 2 because that's how the jump instruction wants them. */
-#define ASM_OUTPUT_INT(FILE, VALUE) \
-do { \
- fprintf (FILE, "\t.word\t"); \
- if ((GET_CODE (VALUE) == SYMBOL_REF && SYMBOL_REF_FLAG (VALUE)) \
- || GET_CODE (VALUE) == LABEL_REF) \
- { \
- fprintf (FILE, "%%st("); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, ")"); \
- } \
- else \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
-} while (0)
-
/* This is how to output an assembler line defining a `float' constant. */
#define ASM_OUTPUT_FLOAT(FILE, VALUE) \
{ \
t[0], ASM_COMMENT_START, str, t[1]); \
}
-/* This is how to output an assembler line for a numeric constant byte. */
-#define ASM_BYTE_OP "\t.byte\t"
-#define ASM_OUTPUT_BYTE(FILE, VALUE) \
- fprintf (FILE, "%s0x%x\n", ASM_BYTE_OP, (VALUE))
-
/* This is how to output the definition of a user-level label named NAME,
such as the label on a static function or variable NAME. */
#define ASM_OUTPUT_LABEL(FILE, NAME) \
l, ASM_COMMENT_START, dstr); \
} while (0)
-#define ASM_OUTPUT_INT(STREAM,VALUE) \
- (fprintf ((STREAM), "\tDCD\t"), \
- output_addr_const ((STREAM), (VALUE)), \
- fputc ('\n', (STREAM)))
-
-#define ASM_OUTPUT_SHORT(STREAM,VALUE) \
- (fprintf ((STREAM), "\tDCW\t"), \
- output_addr_const ((STREAM), (VALUE)), \
- fputc ('\n', (STREAM)))
-
-#define ASM_OUTPUT_CHAR(STREAM,VALUE) \
- (fprintf ((STREAM), "\tDCB\t"), \
- output_addr_const ((STREAM), (VALUE)), \
- fputc ('\n', (STREAM)))
-
-#define ASM_OUTPUT_BYTE(STREAM,VALUE) \
- fprintf ((STREAM), "\tDCB\t%d\n", (VALUE))
-
#define ASM_OUTPUT_ASCII(STREAM,PTR,LEN) \
{ \
int i; \
} \
while (0)
-#define ASM_OUTPUT_INT(STREAM, EXP) \
- do \
- { \
- fprintf (STREAM, "\t.word\t"); \
- OUTPUT_INT_ADDR_CONST (STREAM, EXP); \
- fputc ('\n', STREAM); \
- } \
- while (0)
-
-#define ASM_OUTPUT_SHORT(STREAM, EXP) \
- do \
- { \
- fprintf (STREAM, "\t.short\t"); \
- output_addr_const (STREAM, EXP); \
- fputc ('\n', STREAM); \
- } \
- while (0)
-
-#define ASM_OUTPUT_CHAR(STREAM, EXP) \
- do \
- { \
- fprintf (STREAM, "\t.byte\t"); \
- output_addr_const (STREAM, EXP); \
- fputc ('\n', STREAM); \
- } \
- while (0)
-
-#define ASM_OUTPUT_BYTE(STREAM, VALUE) \
- fprintf (STREAM, "\t.byte\t%d\n", VALUE)
-
#undef ASM_OUTPUT_ASCII
#define ASM_OUTPUT_ASCII(STREAM, PTR, LEN) \
output_ascii_pseudo_op (STREAM, (const unsigned char *)(PTR), LEN)
static int eliminate_lr2ip PARAMS ((rtx *));
static rtx emit_multi_reg_push PARAMS ((int));
static rtx emit_sfm PARAMS ((int, int));
+#ifndef AOF_ASSEMBLER
+static bool arm_assemble_integer PARAMS ((rtx, unsigned int,
+ int));
+#endif
static Ccstar fp_const_from_val PARAMS ((REAL_VALUE_TYPE *));
static arm_cc get_arm_condition_code PARAMS ((rtx));
static void init_fpa_table PARAMS ((void));
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE arm_attribute_table
+#ifdef AOF_ASSEMBLER
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP "\tDCB\t"
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\tDCW\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\tDCD\t"
+#else
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP NULL
+#undef TARGET_ASM_INTEGER
+#define TARGET_ASM_INTEGER arm_assemble_integer
+#endif
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE arm_output_function_prologue
ASM_OUTPUT_ASCII (stream, name, length);
ASM_OUTPUT_ALIGN (stream, 2);
x = GEN_INT ((unsigned HOST_WIDE_INT) 0xff000000 + alignlength);
- ASM_OUTPUT_INT (stream, x);
+ assemble_aligned_integer (UNITS_PER_WORD, x);
}
/* Place some comments into the assembler stream
}
}
\f
+#ifndef AOF_ASSEMBLER
+/* Target hook for assembling integer objects. The ARM version needs to
+ handle word-sized values specially. */
+
+static bool
+arm_assemble_integer (x, size, aligned_p)
+ rtx x;
+ unsigned int size;
+ int aligned_p;
+{
+ if (size == UNITS_PER_WORD && aligned_p)
+ {
+ fputs ("\t.word\t", asm_out_file);
+ output_addr_const (asm_out_file, x);
+
+ /* Mark symbols as position independent. We only do this in the
+ .text segment, not in the .data segment. */
+ if (NEED_GOT_RELOC && flag_pic && making_const_table &&
+ (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF))
+ {
+ if (GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x))
+ fputs ("(GOTOFF)", asm_out_file);
+ else if (GET_CODE (x) == LABEL_REF)
+ fputs ("(GOTOFF)", asm_out_file);
+ else
+ fputs ("(GOT)", asm_out_file);
+ }
+ fputc ('\n', asm_out_file);
+ return true;
+ }
+ return default_assemble_integer (x, size, aligned_p);
+}
+#endif
+\f
/* A finite state machine takes care of noticing whether or not instructions
can be conditionally executed, and thus decrease execution time and code
size by deleting branch instructions. The fsm is controlled by
fputc ('\n', STREAM); \
ASM_GENERATE_INTERNAL_LABEL (temp, "LP", LABELNO); \
sym = gen_rtx (SYMBOL_REF, Pmode, temp); \
- ASM_OUTPUT_INT (STREAM, sym); \
+ assemble_aligned_integer (UNITS_PER_WORD, sym); \
}
#endif
.word static chain value
.word function's address
??? FIXME: When the trampoline returns, r8 will be clobbered. */
-#define ARM_TRAMPOLINE_TEMPLATE(FILE) \
-{ \
- asm_fprintf (FILE, "\tldr\t%r, [%r, #0]\n", \
- STATIC_CHAIN_REGNUM, PC_REGNUM); \
- asm_fprintf (FILE, "\tldr\t%r, [%r, #0]\n", \
- PC_REGNUM, PC_REGNUM); \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
+#define ARM_TRAMPOLINE_TEMPLATE(FILE) \
+{ \
+ asm_fprintf (FILE, "\tldr\t%r, [%r, #0]\n", \
+ STATIC_CHAIN_REGNUM, PC_REGNUM); \
+ asm_fprintf (FILE, "\tldr\t%r, [%r, #0]\n", \
+ PC_REGNUM, PC_REGNUM); \
+ assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
+ assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
}
/* On the Thumb we always switch into ARM mode to execute the trampoline.
else \
THUMB_PRINT_OPERAND_ADDRESS (STREAM, X)
-#define OUTPUT_INT_ADDR_CONST(STREAM, X) \
- { \
- output_addr_const (STREAM, X); \
- \
- /* Mark symbols as position independent. We only do this in the \
- .text segment, not in the .data segment. */ \
- if (NEED_GOT_RELOC && flag_pic && making_const_table && \
- (GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == LABEL_REF)) \
- { \
- if (GET_CODE (X) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (X)) \
- fprintf (STREAM, "(GOTOFF)"); \
- else if (GET_CODE (X) == LABEL_REF) \
- fprintf (STREAM, "(GOTOFF)"); \
- else \
- fprintf (STREAM, "(GOT)"); \
- } \
- }
-
/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
Used for C++ multiple inheritance. */
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
int *len));
extern int default_rtx_costs PARAMS ((rtx X, RTX_CODE code,
RTX_CODE outer_code));
-extern void asm_output_char PARAMS ((FILE *file, rtx value));
-extern void asm_output_short PARAMS ((FILE *file, rtx value));
-extern void asm_output_byte PARAMS ((FILE *file, int value));
extern enum reg_class secondary_input_reload_class PARAMS ((enum reg_class,
enum machine_mode,
rtx));
static tree avr_handle_progmem_attribute PARAMS ((tree *, tree, tree, int, bool *));
static tree avr_handle_fndecl_attribute PARAMS ((tree *, tree, tree, int, bool *));
const struct attribute_spec avr_attribute_table[];
+static bool avr_assemble_integer PARAMS ((rtx, unsigned int, int));
static void avr_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void avr_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
int avr_case_values_threshold = 30000;
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
+#undef TARGET_ASM_INTEGER
+#define TARGET_ASM_INTEGER avr_assemble_integer
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE avr_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
return 1;
}
-/* Output rtx VALUE as .byte to file FILE */
-
-void
-asm_output_char (file, value)
- FILE *file;
- rtx value;
-{
- fprintf (file, "\t.byte ");
- output_addr_const (file, value);
- fprintf (file, "\n");
-}
-
-
-/* Output VALUE as .byte to file FILE */
-
-void
-asm_output_byte (file, value)
- FILE *file;
- int value;
-{
- fprintf (file, "\t.byte 0x%x\n", value & 0xff);
-}
-
-
-/* Output rtx VALUE as .word to file FILE */
+/* Target hook for assembling integer objects. The AVR version needs
+ special handling for references to certain labels. */
-void
-asm_output_short (file, value)
- FILE *file;
- rtx value;
+static bool
+avr_assemble_integer (x, size, aligned_p)
+ rtx x;
+ unsigned int size;
+ int aligned_p;
{
- if (SYMBOL_REF_FLAG (value) || GET_CODE (value) == LABEL_REF)
- {
- fprintf (file, "\t.word pm(");
- output_addr_const (file, (value));
- fprintf (file, ")\n");
- }
- else
+ if (size == POINTER_SIZE / BITS_PER_UNIT && aligned_p
+ && ((GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_FLAG (x))
+ || GET_CODE (x) == LABEL_REF))
{
- fprintf (file, "\t.word ");
- output_addr_const (file, (value));
- fprintf (file, "\n");
+ fputs ("\t.word\tpm(", asm_out_file);
+ output_addr_const (asm_out_file, x);
+ fputs (")\n", asm_out_file);
+ return true;
}
+ return default_assemble_integer (x, size, aligned_p);
}
definitions. */
-#define ASM_OUTPUT_INT(FILE, VALUE) \
- ( fprintf (FILE, "\t.long "), \
- output_addr_const (FILE, (VALUE)), \
- fputs ("\n", FILE))
-
- /* Likewise for `short' and `char' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) asm_output_short(FILE,VALUE)
-#define ASM_OUTPUT_CHAR(FILE,VALUE) asm_output_char(FILE,VALUE)
-
-/* `ASM_OUTPUT_QUADRUPLE_INT (STREAM, EXP)'
- A C statement to output to the stdio stream STREAM an assembler
- instruction to assemble an integer of 16, 8, 4, 2 or 1 bytes,
- respectively, whose value is VALUE. The argument EXP will be an
- RTL expression which represents a constant value. Use
- `output_addr_const (STREAM, EXP)' to output this value as an
- assembler expression.
-
- For sizes larger than `UNITS_PER_WORD', if the action of a macro
- would be identical to repeatedly calling the macro corresponding to
- a size of `UNITS_PER_WORD', once for each word, you need not define
- the macro. */
-
-
-#define ASM_OUTPUT_BYTE(FILE,VALUE) asm_output_byte (FILE,VALUE)
-/* A C statement to output to the stdio stream STREAM an assembler
- instruction to assemble a single byte containing the number VALUE. */
-
-#define ASM_BYTE_OP "\t.byte "
-/* A C string constant giving the pseudo-op to use for a sequence of
- single-byte constants. If this macro is not defined, the default
- is `"\t.byte\t"'. */
-
#define ASM_OUTPUT_ASCII(FILE, P, SIZE) gas_output_ascii (FILE,P,SIZE)
/* `ASM_OUTPUT_ASCII (STREAM, PTR, LEN)'
output_ascii (FILE, P, SIZE)
static int c4x_adjust_cost PARAMS ((rtx, rtx, rtx, int));
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP "\t.word\t"
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP NULL
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP NULL
+
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE c4x_attribute_table
l[0], str, l[1]); \
} while (0);
-#define ASM_OUTPUT_CHAR(FILE, VALUE) \
- do { \
- fprintf (FILE, "\t.word\t"); \
- output_addr_const (FILE, VALUE); \
- if (GET_CODE (VALUE) != SYMBOL_REF) \
- fprintf (FILE, " ; 0%08xh\n", INTVAL (VALUE)); \
- else \
- fputc ('\n', FILE); \
- } while (0);
-
-#define ASM_OUTPUT_BYTE(FILE, VALUE) \
- fprintf (FILE, "\t.word\t0%xh\n", (VALUE))
-
#define ASM_OUTPUT_ASCII(FILE, PTR, LEN) c4x_output_ascii (FILE, PTR, LEN)
/* Output and Generation of Labels. */
static int frame_size;
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE clipper_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
do { fputs (".globl ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\t.long "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "\t.word "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\t.byte "), \
- 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, "\t.byte 0x%x\n", (VALUE))
-
/* This is how to output an insn to push a register on the stack.
It need not be very fast code. */
fprintf(FILE, "\t.align %d\n", 1 << (LOG))
-#define ASM_LONG ".long"
#define BSS_SECTION_ASM_OP "\t.bss"
#undef INIT_SECTION_ASM_OP
#define INIT_SECTION_ASM_OP "\t.section .init,\"x\""
static int convex_adjust_cost PARAMS ((rtx, rtx, rtx, int));
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP "\tds.b\t"
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\tds.h\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\tds.w\t"
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE convex_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
outfloat (FILE, VALUE, "%.9e", "\tds.s ", "\n")
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-{ \
- fprintf (FILE, "\tds.w "); \
- output_addr_const (FILE, simplify_for_convex (VALUE)); \
- fprintf (FILE, "\n"); \
-}
-
-/* Likewise for a `long long int' constant. */
-
-#define ASM_OUTPUT_DOUBLE_INT(FILE,VALUE) \
-{ \
- if (GET_CODE (VALUE) == CONST_DOUBLE) \
- fprintf (FILE, "\tds.w %d,%d\n", \
- const_double_high_int (VALUE), const_double_low_int (VALUE)); \
- else if (GET_CODE (VALUE) == CONST_INT) \
- { \
- int val = INTVAL (VALUE); \
- fprintf (FILE, "\tds.w %d,%d\n", val < 0 ? -1 : 0, val); \
- } \
- else \
- abort (); \
-}
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "\tds.h "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\tds.b "), \
- 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, "\tds.b %#x\n", (int)(VALUE))
-
/* This is how to output a string */
#define ASM_OUTPUT_ASCII(FILE,STR,SIZE) do { \
/* This is the parsed result of the "-march=" option, if given. */
int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\t.dword\t"
+#undef TARGET_ASM_ALIGNED_DI_OP
+#define TARGET_ASM_ALIGNED_DI_OP "\t.quad\t"
+
+/* We need to define these, since the 2byte, 4byte, 8byte op:s are only
+ available in ELF. These "normal" pseudos do not have any alignment
+ constraints or side-effects. */
+#undef TARGET_ASM_UNALIGNED_HI_OP
+#define TARGET_ASM_UNALIGNED_HI_OP TARGET_ASM_ALIGNED_HI_OP
+
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP TARGET_ASM_ALIGNED_SI_OP
+
+#undef TARGET_ASM_UNALIGNED_DI_OP
+#define TARGET_ASM_UNALIGNED_DI_OP TARGET_ASM_ALIGNED_DI_OP
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE cris_target_asm_function_prologue
ASM_OUTPUT_LONG_DOUBLE (FILE, VALUE)
-/* This is a kludge for a.out+ELF support: For non-ELF prioritized
- [cd]tors, globalize the function so collect2 can collect it. This is
- due to short-sightedness guided by defined (ASM_OUTPUT_SECTION_NAME)
- && defined (ASM_OUTPUT_CONSTRUCTOR). */
-
-#define ASM_OUTPUT_INT(FILE, VALUE) \
- do \
- { \
- fprintf (FILE, "\t.dword "); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
- } \
- while (0)
-
-#define ASM_OUTPUT_SHORT(FILE, VALUE) \
- do \
- { \
- fprintf (FILE, "\t.word "); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
- } \
- while (0)
-
-#define ASM_OUTPUT_CHAR(FILE, VALUE) \
- do \
- { \
- fprintf (FILE, "\t.byte "); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
- } \
- while (0)
-
-#define ASM_OUTPUT_BYTE(FILE, VALUE) \
- fprintf (FILE, "\t.byte 0x%x\n", (VALUE))
-
#define IS_ASM_LOGICAL_LINE_SEPARATOR(C) (C) == '@'
-/* FIXME: These are undocumented. */
-/* We need to define these, since the 2byte, 4byte, 8byte op:s are only
- available in ELF. These "normal" pseudos do not have any alignment
- constraints or side-effects. */
-#undef UNALIGNED_SHORT_ASM_OP
-#define UNALIGNED_SHORT_ASM_OP "\t.word\t"
-
-#undef UNALIGNED_INT_ASM_OP
-#define UNALIGNED_INT_ASM_OP "\t.dword\t"
-
-#undef UNALIGNED_DOUBLE_INT_ASM_OP
-#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.quad\t"
-
/* Node: Uninitialized Data */
/* Remember to round off odd values if we want data alignment,
enum reg_class reg_class_from_letter[256];
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE d30v_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
/* #define ASM_OUTPUT_BYTE_FLOAT(STREAM, VALUE) */
/* A C statement to output to the stdio stream STREAM an assembler instruction
- to assemble an integer of 16, 8, 4, 2 or 1 bytes, respectively, whose value
- is VALUE. The argument EXP will be an RTL expression which represents a
- constant value. Use `output_addr_const (STREAM, EXP)' to output this value
- as an assembler expression.
-
- For sizes larger than `UNITS_PER_WORD', if the action of a macro would be
- identical to repeatedly calling the macro corresponding to a size of
- `UNITS_PER_WORD', once for each word, you need not define the macro. */
-
-/* #define ASM_OUTPUT_QUADRUPLE_INT(STREAM, EXP) */
-/* #define ASM_OUTPUT_DOUBLE_INT(STREAM, EXP) */
-
-#define ASM_OUTPUT_INT(STREAM, EXP) \
-do { \
- fputs ("\t.word ", STREAM); \
- output_addr_const (STREAM, EXP); \
- putc ('\n', STREAM); \
-} while (0)
-
-#define ASM_OUTPUT_SHORT(STREAM, EXP) \
-do { \
- fputs ("\t.hword ", STREAM); \
- output_addr_const (STREAM, EXP); \
- putc ('\n', STREAM); \
-} while (0)
-
-#define ASM_OUTPUT_CHAR(STREAM, EXP) \
-do { \
- fputs ("\t.byte ", STREAM); \
- output_addr_const (STREAM, EXP); \
- putc ('\n', STREAM); \
-} while (0)
-
-/* A C statement to output to the stdio stream STREAM an assembler instruction
- to assemble a single byte containing the number VALUE. */
-
-#define ASM_OUTPUT_BYTE(STREAM, VALUE) \
- fprintf (STREAM, "%s%d\n", ASM_BYTE_OP, (int)(VALUE))
-
-/* A C string constant giving the pseudo-op to use for a sequence of
- single-byte constants. If this macro is not defined, the default
- is `"byte"'.
-
- Defined in svr4.h. */
-/* #define ASM_BYTE_OP */
-
-/* A C statement to output to the stdio stream STREAM an assembler instruction
to assemble a string constant containing the LEN bytes at PTR. PTR will be
a C expression of type `char *' and LEN a C expression of type `int'.
/* Define this macro to 0 if your target supports DWARF 2 frame unwind
information, but it does not yet work with exception handling. Otherwise,
if your target supports this information (if it defines
- `INCOMING_RETURN_ADDR_RTX' and either `UNALIGNED_INT_ASM_OP' or
- `OBJECT_FORMAT_ELF'), GCC will provide a default definition of 1.
+ `INCOMING_RETURN_ADDR_RTX'), GCC will provide a default definition of 1.
If this macro is defined to 1, the DWARF 2 unwinder will be the default
exception handling mechanism; otherwise, setjmp/longjmp will be used by
fprintf (FILE, "_%s", NAME); \
} while (0)
-/* The standard fillin directives are unaligned. */
-
-#define UNALIGNED_SHORT_ASM_OP "\t.short\t"
-#define UNALIGNED_INT_ASM_OP "\t.long\t"
-/* Don't try to use this before the assembler knows about it. */
-/* #define UNALIGNED_DOUBLE_INT_ASM_OP "\t.quad\t" */
-
#undef ALIGN_ASM_OP
#define ALIGN_ASM_OP ".align"
extern void asm_output_common PARAMS ((FILE *, const char *, int, int));
extern void asm_output_local PARAMS ((FILE *, const char *, int, int));
extern void asm_output_float PARAMS ((FILE *, double));
-extern void asm_output_long PARAMS ((FILE *, long));
extern void dsp16xx_file_start PARAMS ((void));
extern void coff_dsp16xx_file_start PARAMS ((FILE *));
extern void luxworks_dsp16xx_file_start PARAMS ((FILE *));
static void dsp16xx_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP "\tint\t"
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP NULL
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP NULL
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE dsp16xx_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
#endif
}
-void
-asm_output_long (file, value)
- FILE *file;
- long value;
-{
- fputs ("\tint ", file);
-#ifdef WORDS_BIG_ENDIAN
- fprintf (file, "0x%-4.4lx, 0x%-4.4lx", (value >> 16) & 0xffff, (value & 0xffff));
-#else
- fprintf (file, "0x%-4.4lx, 0x%-4.4lx", (value & 0xffff), (value >> 16) & 0xffff);
-#endif
- fputs ("\n", file);
-}
-
int
dsp16xx_address_cost (addr)
rtx addr;
size HFmode. */
#define ASM_OUTPUT_SHORT_FLOAT(FILE,VALUE) asm_output_float (FILE, VALUE)
-/* This is how to output an assembler line defining an `char' constant. */
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\tint "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* This is how to output an assembler line defining an `short' constant. */
-#define ASM_OUTPUT_SHORT(FILE,EXP) asm_output_long(FILE,INTVAL(EXP))
-
-/* This is how to output an assembler line defining a 'int' constant. */
-#define ASM_OUTPUT_INT(FILE, EXP) asm_output_long(FILE,INTVAL(EXP))
-
-/* This is how to output an assembler line for a numeric constant byte. */
-#define ASM_OUTPUT_BYTE(FILE,VALUE) ASM_OUTPUT_CHAR(FILE,GEN_INT(VALUE))
-
/* This is how we output a 'c' character string. For the 16xx
assembler we have to do it one letter at a time */
#define IDENT_ASM_OP "\t.ident\t"
-#undef ASM_BYTE_OP
-#define ASM_BYTE_OP "\t.byte\t"
-
#undef SET_ASM_OP
#define SET_ASM_OP "\t.set\t"
"gt", "gt", "eq", "eq", "ge", "ge", "lt", "lt", "ne", "ne",
"le", "le" };
+static bool elxsi_assemble_integer PARAMS ((rtx, unsigned int, int));
static void elxsi_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void elxsi_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP NULL
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP NULL
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP NULL
+#undef TARGET_ASM_INTEGER
+#define TARGET_ASM_INTEGER elxsi_assemble_integer
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE elxsi_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
struct gcc_target targetm = TARGET_INITIALIZER;
\f
+/* Target hook for assembling integer objects. The ELXSI assembler
+ syntax uses a suffix to indicate the size of data, so we can't use
+ the usual string hooks. */
+
+static bool
+elxsi_assemble_integer (x, size, aligned_p)
+ rtx x;
+ unsigned int size;
+ int aligned_p;
+{
+ if (aligned_p)
+ switch (size)
+ {
+ case 1:
+ case 2:
+ case 4:
+ fputs ("\t.data\t", asm_out_file);
+ output_addr_const (asm_out_file, x);
+ fprintf (asm_out_file, "{%d}\n", size * BITS_PER_UNIT);
+ return true;
+ }
+ return default_assemble_integer (x, size, aligned_p);
+}
+\f
/* Generate the assembly code for function entry. FILE is a stdio
stream to output the code to. SIZE is an int: how many units of
temporary storage to allocate.
tem.f = (VALUE); \
fprintf (FILE, "\t.data %d{32}\n", tem.i); }
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( \
- fprintf (FILE, "\t.data\t"), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "{32}\n"))
-
-#define ASM_OUTPUT_DOUBLE_INT(FILE,VALUE) \
-{ \
- fprintf (FILE, "\t.data\t"); \
- if (GET_CODE (VALUE) == CONST_DOUBLE) \
- { \
- fprintf (FILE, "%d", CONST_DOUBLE_HIGH (VALUE)); \
- fprintf (FILE, "{32}, "); \
- fprintf (FILE, "%d", CONST_DOUBLE_LOW (VALUE)); \
- fprintf (FILE, "{32}\n"); \
- } else if (GET_CODE (VALUE) == CONST_INT) \
- { \
- int val = INTVAL (VALUE); \
- fprintf (FILE, "%d", val < 0 ? -1 : 0); \
- fprintf (FILE, "{32}, "); \
- fprintf (FILE, "%d", val); \
- fprintf (FILE, "{32}\n"); \
- } else abort (); \
-}
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "\t.data\t"), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "{16}\n"))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\t.data\t"), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "{8}\n"))
-
-/* This is how to output an assembler line for a numeric constant byte. */
-
-#define ASM_OUTPUT_BYTE(FILE,VALUE) \
- fprintf (FILE, "\t.data\t%d{8}\n", (VALUE))
-
/* This is how to output an insn to push a register on the stack.
It need not be very fast code. */
#endif
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
struct gcc_target targetm = TARGET_INITIALIZER;
\f
t[0], ASM_COMMENT_START, str, t[1]); \
} \
while (0)
-
-/* This is how to output an assembler line defining a `char' constant. */
-#define ASM_OUTPUT_CHAR(FILE, VALUE) \
- do \
- { \
- fprintf (FILE, "\t.byte\t"); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
- } \
- while (0)
-
-/* This is how to output an assembler line defining a `short' constant. */
-#define ASM_OUTPUT_SHORT(FILE, VALUE) \
- do \
- { \
- fprintf (FILE, "\t.hword\t"); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
- } \
- while (0)
-
-/* This is how to output an assembler line defining an `int' constant.
- We also handle symbol output here. */
-#define ASM_OUTPUT_INT(FILE, VALUE) \
- do \
- { \
- fprintf (FILE, "\t.word\t"); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
- } \
- while (0)
-
-/* A C statement to output to the stdio stream STREAM an assembler instruction
- to assemble a single byte containing the number VALUE. */
-#define ASM_OUTPUT_BYTE(STREAM, VALUE) \
- fprintf (STREAM, "%s0x%x\n", ASM_BYTE_OP, (VALUE))
-
/*}}}*/ \f
/*{{{ Output and Generation of Labels. */
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE h8300_attribute_table
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE h8300_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
} \
while (0)
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_INT(FILE, VALUE) \
-( fprintf (FILE, "\t.long "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE, VALUE) \
-( fprintf (FILE, "\t.word "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_CHAR(FILE, VALUE) \
-( fprintf (FILE, "\t.byte "), \
- 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, "\t.byte 0x%x\n", (VALUE))
-
/* This is how to output an insn to push a register on the stack.
It need not be very fast code. */
static label_node_t * mvs_get_label PARAMS ((int));
static void i370_label_scan PARAMS ((void));
+#ifdef TARGET_HLASM
+static bool i370_hlasm_assemble_integer PARAMS ((rtx, unsigned int, int));
+#endif
static void i370_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void i370_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
#ifdef LONGEXTERNAL
};
\f
/* Initialize the GCC target structure. */
+#ifdef TARGET_HLASM
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP NULL
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP NULL
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP NULL
+#undef TARGET_ASM_INTEGER
+#define TARGET_ASM_INTEGER i370_hlasm_assemble_integer
+#endif
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE i370_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
}
}
+#ifdef TARGET_HLASM
+
+/* Target hook for assembling integer objects. This version handles all
+ objects when TARGET_HLASM is defined. */
+
+static bool
+i370_hlasm_assemble_integer (x, size, aligned_p)
+ rtx x;
+ unsigned int size;
+ int aligned_p;
+{
+ const char *int_format = NULL;
+
+ if (aligned_p)
+ switch (size)
+ {
+ case 1:
+ int_format = "\tDC\tX'%02X'\n";
+ break;
+
+ case 2:
+ int_format = "\tDC\tX'%04X'\n";
+ break;
+
+ case 4:
+ if (GET_CODE (x) == CONST_INT)
+ {
+ fputs ("\tDC\tF'", asm_out_file);
+ output_addr_const (asm_out_file, x);
+ fputs ("'\n", asm_out_file);
+ }
+ else
+ {
+ fputs ("\tDC\tA(", asm_out_file);
+ output_addr_const (asm_out_file, x);
+ fputs (")\n", asm_out_file);
+ }
+ return true;
+ }
+
+ if (int_format && GET_CODE (x) == CONST_INT)
+ {
+ fprintf (asm_out_file, int_format, INTVAL (x));
+ return true;
+ }
+ return default_assemble_integer (x, size, aligned_p);
+}
+
/* Generate the assembly code for function entry. FILE is a stdio
stream to output the code to. SIZE is an int: how many units of
temporary storage to allocate.
used in the function. This function is responsible for knowing
which registers should not be saved even if used. */
-#ifdef TARGET_HLASM
-
static void
i370_output_function_prologue (f, l)
FILE *f;
#define TRAMPOLINE_TEMPLATE(FILE) \
{ \
- ASM_OUTPUT_SHORT (FILE, GEN_INT (0x05E0)); \
- ASM_OUTPUT_SHORT (FILE, GEN_INT (0x5800 | STATIC_CHAIN_REGNUM << 4)); \
- ASM_OUTPUT_SHORT (FILE, GEN_INT (0xE00A)); \
- ASM_OUTPUT_SHORT (FILE, GEN_INT (0x58F0)); \
- ASM_OUTPUT_SHORT (FILE, GEN_INT (0xE00E)); \
- ASM_OUTPUT_SHORT (FILE, GEN_INT (0x07FF)); \
- ASM_OUTPUT_SHORT (FILE, const0_rtx); \
- ASM_OUTPUT_SHORT (FILE, const0_rtx); \
- ASM_OUTPUT_SHORT (FILE, const0_rtx); \
- ASM_OUTPUT_SHORT (FILE, const0_rtx); \
+ assemble_aligned_integer (2, GEN_INT (0x05E0)); \
+ assemble_aligned_integer (2, GEN_INT (0x5800 | STATIC_CHAIN_REGNUM << 4)); \
+ assemble_aligned_integer (2, GEN_INT (0xE00A)); \
+ assemble_aligned_integer (2, GEN_INT (0x58F0)); \
+ assemble_aligned_integer (2, GEN_INT (0xE00E)); \
+ assemble_aligned_integer (2, GEN_INT (0x07FF)); \
+ assemble_aligned_integer (2, const0_rtx); \
+ assemble_aligned_integer (2, const0_rtx); \
+ assemble_aligned_integer (2, const0_rtx); \
+ assemble_aligned_integer (2, const0_rtx); \
}
/* Length in units of the trampoline for entering a nested function. */
#define ASM_OUTPUT_FLOAT(FILE, VALUE) \
fprintf (FILE, "\tDC\tE'%.9G'\n", (VALUE))
-/* This outputs an integer, if not a CONST_INT must be address constant. */
-
-#define ASM_OUTPUT_INT(FILE, EXP) \
-{ \
- if (GET_CODE (EXP) == CONST_INT) \
- { \
- fprintf (FILE, "\tDC\tF'"); \
- output_addr_const (FILE, EXP); \
- fprintf (FILE, "'\n"); \
- } \
- else \
- { \
- fprintf (FILE, "\tDC\tA("); \
- output_addr_const (FILE, EXP); \
- fprintf (FILE, ")\n"); \
- } \
-}
-
-/* This outputs a short integer. */
-
-#define ASM_OUTPUT_SHORT(FILE, EXP) \
-{ \
- fprintf (FILE, "\tDC\tX'%04X'\n", INTVAL(EXP) & 0xFFFF); \
-}
-
-/* This outputs a byte sized integer. */
-
-#define ASM_OUTPUT_CHAR(FILE, EXP) \
- fprintf (FILE, "\tDC\tX'%02X'\n", INTVAL (EXP) )
-
-#define ASM_OUTPUT_BYTE(FILE, VALUE) \
- fprintf (FILE, "\tDC\tX'%02X'\n", VALUE)
-
/* This outputs a text string. The string are chopped up to fit into
an 80 byte record. Also, control and special characters, interpreted
by the IBM assembler, are output numerically. */
#undef ASM_OUTPUT_EXTERNAL
#define ASM_DOUBLE "\t.double"
-#define ASM_LONG "\t.long"
-#define ASM_SHORT "\t.short"
-#define ASM_BYTE "\t.byte"
/* Argument to the flt pt. macros is a REAL_VALUE_TYPE which
may or may not be a float/double, depending on whther we
}
-/* This is how to output an assembler line defining an `int' constant. */
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "%s ", ASM_LONG), \
- output_addr_const (FILE,(VALUE)), \
- putc('\n',FILE))
-
-/* Likewise for `char' and `short' constants. */
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "%s ", ASM_SHORT), \
- output_addr_const (FILE,(VALUE)), \
- putc('\n',FILE))
-
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "%s", ASM_BYTE_OP), \
- output_addr_const (FILE, (VALUE)), \
- putc ('\n', FILE))
-
-/* 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, (VALUE))
-
/* This is how to output the definition of a user-level label named NAME,
such as the label on a static function or variable NAME. */
#define ASM_OUTPUT_LABEL(FILE,NAME) \
{ size_t i = 0, limit = (SIZE); \
while (i < limit) \
{ if (i%10 == 0) { if (i!=0) fprintf ((FILE), "\n"); \
- fprintf ((FILE), "%s", ASM_BYTE_OP); } \
+ fputs ("\t.byte\t", (FILE)); } \
else fprintf ((FILE), ","); \
fprintf ((FILE), "0x%x", ((PTR)[i++] & 0377)) ;} \
fprintf ((FILE), "\n"); \
/* Assembler pseudos to introduce constants of various size. */
-#define ASM_BYTE_OP "\t.byte\t"
#define ASM_SHORT "\t.word\t"
#define ASM_LONG "\t.long\t"
#define ASM_QUAD "\t.quad\t" /* Should not be used for 32bit compilation. */
#undef TEXT_SECTION_ASM_OP
#define TEXT_SECTION_ASM_OP "\t.section .text"
-/* How to output an unaligned integer. */
-#undef UNALIGNED_INT_ASM_OP
-#define UNALIGNED_INT_ASM_OP "\t.long\t"
-
-/* How to output an unaligned double length integer. */
-#undef UNALIGNED_DOUBLE_INT_ASM_OP
-#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.quad\t"
-
-/* How to output an unaligned half length intenger. */
-#undef UNALIGNED_SHORT_ASM_OP
-#define UNALIGNED_SHORT_ASM_OP "\t.short\t"
-
/* Define standard DJGPP installation paths. */
/* We override default /usr or /usr/local part with /dev/env/DJDIR which */
/* points to actual DJGPP instalation directory. */
#undef TARGET_ASM_CLOSE_PAREN
#define TARGET_ASM_CLOSE_PAREN ""
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP ASM_SHORT
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP ASM_LONG
+#ifdef ASM_QUAD
+#undef TARGET_ASM_ALIGNED_DI_OP
+#define TARGET_ASM_ALIGNED_DI_OP ASM_QUAD
+#endif
+
+#undef TARGET_ASM_UNALIGNED_HI_OP
+#define TARGET_ASM_UNALIGNED_HI_OP TARGET_ASM_ALIGNED_HI_OP
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP TARGET_ASM_ALIGNED_SI_OP
+#undef TARGET_ASM_UNALIGNED_DI_OP
+#define TARGET_ASM_UNALIGNED_DI_OP TARGET_ASM_ALIGNED_DI_OP
+
#undef TARGET_SCHED_ADJUST_COST
#define TARGET_SCHED_ADJUST_COST ix86_adjust_cost
#undef TARGET_SCHED_ISSUE_RATE
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fputs (ASM_LONG, FILE), \
- output_addr_const (FILE,(VALUE)), \
- putc('\n',FILE))
-
-#define ASM_OUTPUT_DOUBLE_INT(FILE,VALUE) \
-( fprintf (FILE, "%s\t", ASM_QUAD), \
- output_addr_const (FILE,(VALUE)), \
- putc('\n',FILE))
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fputs (ASM_SHORT, FILE), \
- output_addr_const (FILE,(VALUE)), \
- putc('\n',FILE))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fputs (ASM_BYTE_OP, FILE), \
- output_addr_const (FILE, (VALUE)), \
- putc ('\n', FILE))
-
-/* Given that x86 natively supports unaligned data, it's reasonable to
- assume that all x86 assemblers don't auto-align data. Thus the
- unaligned output macros required by dwarf2 frame unwind information
- degenerate to the macros used above. */
-#define UNALIGNED_SHORT_ASM_OP ASM_SHORT
-#define UNALIGNED_INT_ASM_OP ASM_LONG
-
-/* This is how to output an assembler line for a numeric constant byte. */
-
-#define ASM_OUTPUT_BYTE(FILE,VALUE) \
- asm_fprintf ((FILE), "%s0x%x\n", ASM_BYTE_OP, (int) (VALUE))
-
/* This is how to output an insn to push a register on the stack.
It need not be very fast code. */
do { \
if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
{ \
- fputs (UNALIGNED_INT_ASM_OP, FILE); \
+ fputs (ASM_LONG, FILE); \
assemble_name (FILE, XSTR (ADDR, 0)); \
fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
goto DONE; \
#undef ASCII_DATA_ASM_OP
#define ASCII_DATA_ASM_OP "\t.ascii\t"
-#undef ASM_BYTE_OP
-#define ASM_BYTE_OP "\t.byte\t"
-
#undef IDENT_ASM_OP
#define IDENT_ASM_OP "\t.ident\t"
#define ASM_LONG "\t.long\t"
#undef ASM_QUAD
-#undef ASM_OUTPUT_DOUBLE_INT
#undef TYPE_ASM_OP
#define TYPE_ASM_OP "\t.type\t"
else \
{ \
if (bytes_in_chunk == 0) \
- fprintf ((FILE), "%s", ASM_BYTE_OP); \
+ fputs ("\t.byte\t", (FILE)); \
else \
fputc (',', (FILE)); \
fprintf ((FILE), "0x%02x", *_ascii_bytes); \
do { \
if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
{ \
- fputs (UNALIGNED_INT_ASM_OP, FILE); \
+ fputs (ASM_LONG, FILE); \
assemble_name (FILE, XSTR (ADDR, 0)); \
fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
goto DONE; \
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
-
-/* Override defaults.h and insist that Solaris/Intel doesn't have
- an eight byte data output directive. */
-#define UNALIGNED_DOUBLE_INT_ASM_OP NULL
/* Assembler pseudos to introduce constants of various size. */
-#define ASM_BYTE_OP "\t.byte\t"
#define ASM_SHORT "\t.value\t"
#define ASM_LONG "\t.long\t"
#define ASM_QUAD "\t.quad\t" /* Should not be used for 32bit compilation. */
{ size_t i = 0, limit = (SIZE); \
while (i < limit) \
{ if (i%10 == 0) { if (i!=0) fprintf ((FILE), "\n"); \
- fprintf ((FILE), "%s", ASM_BYTE_OP); } \
+ fputs ("\t.byte\t", (FILE)); } \
else fprintf ((FILE), ","); \
fprintf ((FILE), "0x%x", ((PTR)[i++] & 0377)) ;} \
fprintf ((FILE), "\n"); \
do { \
if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
{ \
- fputs (UNALIGNED_INT_ASM_OP, FILE); \
+ fputs (ASM_LONG, FILE); \
assemble_name (FILE, XSTR (ADDR, 0)); \
fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
goto DONE; \
#define ASM_FILE_END(FILE) \
do { \
if (current_function_original_name != NULL) { \
+ const char *long_op = integer_asm_op (4, FALSE); \
tdesc_section(); \
- fprintf ((FILE), "%s __ETEXT\n", ASM_LONG); \
- fprintf ((FILE), "%s 0\n", ASM_LONG); \
+ fprintf ((FILE), "%s __ETEXT\n", long_op); \
+ fprintf ((FILE), "%s 0\n", long_op); \
+ fputs ("\t.long\t__ETEXT\n", (FILE)); \
+ fputs ("\t.long\t0\n", (FILE)); \
text_section(); \
fputs("__ETEXT:\n", (FILE)); \
} \
register unsigned mask;
unsigned intflags=0;
register TDESC_flags *flags = (TDESC_flags *) &intflags;
+#ifdef OUTPUT_TDESC /* Output an ABI-compliant TDESC entry */
+ const char *long_op = integer_asm_op (4, TRUE);
+#endif
flags->version = 4;
flags->reg_packing = 1;
}
assemble_name(asm_file,current_function_original_name);
fputs(".TDESC:\n", asm_file);
- fprintf(asm_file, "%s 0x%0x\n", ASM_LONG, intflags);
- fprintf(asm_file, "%s %d\n", ASM_LONG,
+ fprintf(asm_file, "%s 0x%0x\n", long_op, intflags);
+ fprintf(asm_file, "%s %d\n", long_op,
int_restored ? must_preserve_bytes : 0);
if (flags->version > 1) {
- fprintf(asm_file, "%s %d\n", ASM_LONG,
+ fprintf(asm_file, "%s %d\n", long_op,
(restored_so_far == int_restored) ? 0 : must_preserve_bytes +
(4 * int_restored));
if (flags->version > 2) {
- fprintf(asm_file, "%s %d\n", ASM_LONG, frame_upper_bytes);
+ fprintf(asm_file, "%s %d\n", long_op, frame_upper_bytes);
if (flags->version > 3)
- fprintf(asm_file, "%s %d\n", ASM_LONG, frame_lower_bytes);
+ fprintf(asm_file, "%s %d\n", long_op, frame_lower_bytes);
}
}
tdesc_section();
- fprintf(asm_file, "%s ", ASM_LONG);
+ fprintf(asm_file, "%s ", long_op);
assemble_name(asm_file, current_function_original_name);
- fprintf(asm_file, "\n%s ", ASM_LONG);
+ fprintf(asm_file, "\n%s ", long_op);
assemble_name(asm_file, current_function_original_name);
fputs(".TDESC\n", asm_file);
text_section();
or #BOTTOM_OF_STATIC,r29,r29 */
#define TRAMPOLINE_TEMPLATE(FILE) \
{ \
- ASM_OUTPUT_INT (FILE, GEN_INT (0xec1f0000)); \
- ASM_OUTPUT_INT (FILE, GEN_INT (0xe7ff0000)); \
- ASM_OUTPUT_INT (FILE, GEN_INT (0xec1d0000)); \
- ASM_OUTPUT_INT (FILE, GEN_INT (0x4000f800)); \
- ASM_OUTPUT_INT (FILE, GEN_INT (0xe7bd0000)); \
+ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0xec1f0000)); \
+ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0xe7ff0000)); \
+ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0xec1d0000)); \
+ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0x4000f800)); \
+ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0xe7bd0000)); \
}
/* Length in units of the trampoline for entering a nested function. */
/* Assembler pseudos to introduce constants of various size. */
-#define ASM_BYTE_OP "\t.byte\t"
-#define ASM_SHORT "\t.short"
-#define ASM_LONG "\t.long"
#define ASM_DOUBLE "\t.double"
/* Output at beginning of assembler file. */
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
fprintf (FILE, "\t.float %.12e\n", (VALUE))
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\t.long "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "\t.short "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\t.byte "), \
- 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, "\t.byte 0x%x\n", (VALUE))
-
/* This is how to output code to push a register on the stack.
It need not be very fast code. */
fprintf ((FILE), "\"\n"); \
bytes_in_chunk = 0; \
} \
- fprintf ((FILE), "%s%d\n", ASM_BYTE_OP, ch); \
+ assemble_aligned_integer (1, GEN_INT (ch)); \
} \
else \
{ \
fprintf ((FILE), "\"\n"); \
bytes_in_chunk = 0; \
} \
- fprintf ((FILE), "%s%d\n", ASM_BYTE_OP, ch); \
+ assemble_aligned_integer (1, GEN_INT (ch)); \
} \
else \
{ \
|| current_function_varargs)
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE i960_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define ASM_OUTPUT_FLOAT(FILE,VALUE) i960_output_float(FILE, VALUE)
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\t.word "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "\t.short "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\t.byte "), \
- 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, "\t.byte 0x%x\n", (VALUE))
-
#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
fprintf (FILE, "\tst\t%s,(sp)\n\taddo\t4,sp,sp\n", reg_names[REGNO])
#define TRAMPOLINE_TEMPLATE(FILE) \
{ \
- ASM_OUTPUT_INT (FILE, GEN_INT (0x8C203000)); \
- ASM_OUTPUT_INT (FILE, GEN_INT (0x00000000)); \
- ASM_OUTPUT_INT (FILE, GEN_INT (0x8CE03000)); \
- ASM_OUTPUT_INT (FILE, GEN_INT (0x00000000)); \
- ASM_OUTPUT_INT (FILE, GEN_INT (0x84212000)); \
+ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0x8C203000)); \
+ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0x00000000)); \
+ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0x8CE03000)); \
+ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0x00000000)); \
+ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0x84212000)); \
}
/* Length in units of the trampoline for entering a nested function. */
tree, rtx));
static rtx ia64_expand_lock_release PARAMS ((enum machine_mode, tree, rtx));
const struct attribute_spec ia64_attribute_table[];
+static bool ia64_assemble_integer PARAMS ((rtx, unsigned int, int));
static void ia64_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void ia64_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
static void ia64_output_function_end_prologue PARAMS ((FILE *));
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN ia64_expand_builtin
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP "\tdata1\t"
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\tdata2\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\tdata4\t"
+#undef TARGET_ASM_ALIGNED_DI_OP
+#define TARGET_ASM_ALIGNED_DI_OP "\tdata8\t"
+#undef TARGET_ASM_UNALIGNED_HI_OP
+#define TARGET_ASM_UNALIGNED_HI_OP "\tdata2.ua\t"
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP "\tdata4.ua\t"
+#undef TARGET_ASM_UNALIGNED_DI_OP
+#define TARGET_ASM_UNALIGNED_DI_OP "\tdata8.ua\t"
+#undef TARGET_ASM_INTEGER
+#define TARGET_ASM_INTEGER ia64_assemble_integer
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE ia64_output_function_prologue
#undef TARGET_ASM_FUNCTION_END_PROLOGUE
return 1;
}
+/* Target hook for assembling integer objects. Handle word-sized
+ aligned objects and detect the cases when @fptr is needed. */
+
+static bool
+ia64_assemble_integer (x, size, aligned_p)
+ rtx x;
+ unsigned int size;
+ int aligned_p;
+{
+ if (size == UNITS_PER_WORD && aligned_p
+ && !(TARGET_NO_PIC || TARGET_AUTO_PIC)
+ && GET_CODE (x) == SYMBOL_REF
+ && SYMBOL_REF_FLAG (x))
+ {
+ fputs ("\tdata8\t@fptr(", asm_out_file);
+ output_addr_const (asm_out_file, x);
+ fputs (")\n", asm_out_file);
+ return true;
+ }
+ return default_assemble_integer (x, size, aligned_p);
+}
+
/* Emit the function prologue. */
static void
fprintf (FILE, "\tdata4 0x%lx\n", t & 0xffffffff); \
} while (0)
-/* A C statement to output to the stdio stream STREAM an assembler instruction
- to assemble an integer of 1, 2, 4, or 8 bytes, respectively, whose value
- is VALUE. */
-
-/* This is how to output an assembler line defining a `char' constant. */
-
-#define ASM_OUTPUT_CHAR(FILE, VALUE) \
-do { \
- fprintf (FILE, "%s", ASM_BYTE_OP); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
-} while (0)
-
-/* This is how to output an assembler line defining a `short' constant. */
-
-#define ASM_OUTPUT_SHORT(FILE, VALUE) \
-do { \
- fprintf (FILE, "\tdata2\t"); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
-} while (0)
-
-/* This is how to output an assembler line defining an `int' constant.
- We also handle symbol output here. */
-
-/* ??? For ILP32, also need to handle function addresses here. */
-
-#define ASM_OUTPUT_INT(FILE, VALUE) \
-do { \
- fprintf (FILE, "\tdata4\t"); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
-} while (0)
-
-/* This is how to output an assembler line defining a `long' constant.
- We also handle symbol output here. */
-
-#define ASM_OUTPUT_DOUBLE_INT(FILE, VALUE) \
-do { \
- fprintf (FILE, "\tdata8\t"); \
- if (!(TARGET_NO_PIC || TARGET_AUTO_PIC) && SYMBOL_REF_FLAG (VALUE)) \
- fprintf (FILE, "@fptr("); \
- output_addr_const (FILE, (VALUE)); \
- if (!(TARGET_NO_PIC || TARGET_AUTO_PIC) && SYMBOL_REF_FLAG (VALUE)) \
- fprintf (FILE, ")"); \
- fprintf (FILE, "\n"); \
-} while (0)
-
/* This is how to output an assembler line defining a `char' constant
to an xdata segment. */
} while (0)
-/* A C statement to output to the stdio stream STREAM an assembler instruction
- to assemble a single byte containing the number VALUE. */
-
-#define ASM_OUTPUT_BYTE(STREAM, VALUE) \
- fprintf (STREAM, "%s0x%x\n", ASM_BYTE_OP, (int)(VALUE) & 0xff)
-
\f
/* Output of Uninitialized Variables. */
reltag = "@gprel("; \
if (reltag) \
{ \
- fputs (((SIZE) == 4 ? UNALIGNED_INT_ASM_OP \
- : (SIZE) == 8 ? UNALIGNED_DOUBLE_INT_ASM_OP \
- : (abort (), "")), FILE); \
+ fputs (integer_asm_op (SIZE, FALSE), FILE); \
fputs (reltag, FILE); \
assemble_name (FILE, XSTR (ADDR, 0)); \
fputc (')', FILE); \
#define DWARF2_DEBUGGING_INFO
-/* C string constants giving the pseudo-op to use for a sequence of
- 2, 4, and 8 byte unaligned constants. dwarf2out.c needs these. */
-
-#define UNALIGNED_SHORT_ASM_OP "\tdata2.ua\t"
-#define UNALIGNED_INT_ASM_OP "\tdata4.ua\t"
-#define UNALIGNED_DOUBLE_INT_ASM_OP "\tdata8.ua\t"
-
#define DWARF2_ASM_LINE_DEBUG_INFO (TARGET_DWARF2_ASM)
/* Use tags for debug info labels, so that they don't break instruction
proper relocations for them. */
#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL) \
do { \
- fputs (((SIZE) == 4 ? UNALIGNED_INT_ASM_OP \
- : (SIZE) == 8 ? UNALIGNED_DOUBLE_INT_ASM_OP \
- : (abort (), "")), FILE); \
+ fputs (integer_asm_op (SIZE, FALSE), FILE); \
fputs ("@secrel(", FILE); \
assemble_name (FILE, LABEL); \
fputc (')', FILE); \
/* Emit a PC-relative relocation. */
#define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL) \
do { \
- fputs (((SIZE) == 4 ? UNALIGNED_INT_ASM_OP \
- : (SIZE) == 8 ? UNALIGNED_DOUBLE_INT_ASM_OP \
- : (abort (), "")), FILE); \
+ fputs (integer_asm_op (SIZE, FALSE), FILE); \
fputs ("@pcrel(", FILE); \
assemble_name (FILE, LABEL); \
fputc (')', FILE); \
/* Various pseudo-ops for which the Intel assembler uses non-standard
definitions. */
-#undef ASM_BYTE_OP
-#define ASM_BYTE_OP "\tdata1\t"
-
#undef STRING_ASM_OP
#define STRING_ASM_OP "\tstringz\t"
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE m32r_attribute_table
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE m32r_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
no longer contain unusual constructs. */
#define ASM_APP_OFF ""
-/* This is how to output an assembler line defining a `char' constant. */
-#define ASM_OUTPUT_CHAR(FILE, VALUE) \
- do \
- { \
- fprintf (FILE, "\t.byte\t"); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
- } \
- while (0)
-
-/* This is how to output an assembler line defining a `short' constant. */
-#define ASM_OUTPUT_SHORT(FILE, VALUE) \
- do \
- { \
- fprintf (FILE, "\t.hword\t"); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
- } \
- while (0)
-
-/* This is how to output an assembler line defining an `int' constant.
- We also handle symbol output here. */
-#define ASM_OUTPUT_INT(FILE, VALUE) \
- do \
- { \
- fprintf (FILE, "\t.word\t"); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
- } \
- while (0)
-
/* This is how to output an assembler line defining a `float' constant. */
#define ASM_OUTPUT_FLOAT(FILE, VALUE) \
do \
} \
while (0)
-/* 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, (VALUE))
-
/* This is how to output the definition of a user-level label named NAME,
such as the label on a static function or variable NAME. */
/* On the M32R we need to ensure the next instruction starts on a 32 bit
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE m68hc11_attribute_table
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
+
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE m68hc11_output_function_epilogue
#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
do { long l[2]; \
REAL_VALUE_TO_TARGET_DOUBLE (VALUE, l); \
- fprintf (FILE, "\t%s\t0x%lx,0x%lx\n", ASM_LONG, l[0], l[1]); \
+ fprintf (FILE, "\t%s\t0x%lx,0x%lx\n", \
+ integer_asm_op (4, TRUE), l[0], l[1]); \
} while (0)
/* This is how to output an assembler line defining a `float' constant. */
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
do { long l; \
REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \
- fprintf ((FILE), "\t%s\t0x%lx\n", ASM_LONG, l); \
+ assemble_aligned_integer (4, GEN_INT (l)); \
} while (0)
-/* This is how to output an assembler line defining a `long' constant. */
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\t%s\t", ASM_LONG), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* 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"))
-
-/* This is how to output an assembler line for a numeric constant byte. */
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "%s", ASM_BYTE_OP), \
- output_addr_const (FILE, (VALUE)), \
- putc ('\n', FILE))
-
-#define ASM_OUTPUT_BYTE(FILE,VALUE) \
- fprintf ((FILE), "%s0x%x\n", ASM_BYTE_OP, (VALUE))
-
/* This is how to output the definition of a user-level label named NAME,
such as the label on a static function or variable NAME. */
/* This is how to output an element of a case-vector that is relative. */
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- asm_fprintf (FILE, "\t%s\tL%d-L%d\n", ASM_SHORT, VALUE, REL)
+ asm_fprintf (FILE, "\t%s\tL%d-L%d\n", integer_asm_op (2, TRUE), VALUE, REL)
/* This is how to output an element of a case-vector that is absolute. */
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
- asm_fprintf (FILE, "\t%s\t.L%d\n", ASM_SHORT, VALUE)
+ asm_fprintf (FILE, "\t%s\t.L%d\n", integer_asm_op (2, TRUE), VALUE)
/* This is how to output an assembler line that says to advance the
location counter to a multiple of 2**LOG bytes. */
/* The prefix for immediate operands. */
#define IMMEDIATE_PREFIX "#"
#define GLOBAL_ASM_OP "\t.globl\t"
-#define ASM_LONG ".long"
-#define ASM_SHORT ".word"
\f
/* Miscellaneous Parameters. */
#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
do { \
register size_t sp = 0, limit = (LEN); \
- fprintf ((FILE), "%s", BYTE_ASM_OP); \
+ fputs (integer_asm_op (1, TRUE), (FILE)); \
do { \
int ch = (PTR)[sp]; \
if (ch > ' ' && ! (ch & 0x80) && ch != '\\') \
{ \
if ((sp % 10) == 0) \
{ \
- fprintf ((FILE), "\n%s", BYTE_ASM_OP); \
+ fprintf ((FILE), "\n%s", integer_asm_op (1, TRUE)); \
} \
else \
{ \
#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
{ \
register size_t sp = 0, limit = (LEN); \
- fprintf ((FILE), "%s", BYTE_ASM_OP); \
+ fputs (integer_asm_op (1, TRUE), (FILE)); \
do { \
int ch = (PTR)[sp]; \
if (ch > ' ' && ! (ch & 0x80) && ch != '\\') \
{ \
if ((sp % 10) == 0) \
{ \
- fprintf ((FILE), "\n%s", BYTE_ASM_OP); \
+ fprintf ((FILE), "\n%s", integer_asm_op (1, TRUE)); \
} \
else \
{ \
#define NO_DOLLAR_IN_LABEL
#define NO_DOT_IN_LABEL
+#undef INT_OP_GROUP
+#define INT_OP_GROUP INT_OP_NO_DOT
+
#undef TEXT_SECTION_ASM_OP
#define TEXT_SECTION_ASM_OP "\ttext"
#undef DATA_SECTION_ASM_OP
#define DATA_SECTION_ASM_OP "\tdata\t1"
-#undef BYTE_ASM_OP
-#define BYTE_ASM_OP "\tbyte\t"
-
-#undef WORD_ASM_OP
-#define WORD_ASM_OP "\tshort\t"
-
-#undef LONG_ASM_OP
-#define LONG_ASM_OP "\tlong\t"
-
#undef SPACE_ASM_OP
#define SPACE_ASM_OP "\tspace\t"
#define ADDITIONAL_REGISTER_NAMES { {"%a6", 14}, {"%a7", 15} }
-#undef ASM_OUTPUT_INT
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf ((FILE), "%s", LONG_ASM_OP), \
- output_addr_const ((FILE), (VALUE)), \
- fprintf ((FILE), "\n"))
-
#undef ASM_OUTPUT_COMMON
#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
( fputs ("\tcomm\t", (FILE)), \
#undef SELECT_RTX_SECTION
#include "svr3.h"
+#undef INT_OP_GROUP
+#define INT_OP_GROUP INT_OP_DC
+
/* We use collect2 instead of ctors_section constructors. */
#undef INIT_SECTION_ASM_OP
#undef FINI_SECTION_ASM_OP
#define ASM_OUTPUT_SOURCE_FILENAME(FILE, NA) \
do { fprintf ((FILE), "\t.file\t'%s'\n", (NA)); } while (0)
-/* Assembler pseudos to introduce constants of various size. */
-
-#undef ASM_BYTE_OP
-#define ASM_BYTE_OP "\tdc.b\t"
-#undef ASM_LONG
-#define ASM_LONG "\tdc.l"
-
/*
* we don't seem to support any of:
* .globl
fprintf (FILE, "\tdc.l $%lx\n", l); \
} while (0)
-/* This is how to output an assembler line defining an `int' constant. */
-#undef ASM_OUTPUT_INT
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\tdc.l "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-#undef ASM_OUTPUT_SHORT
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "\tdc.w "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#undef ASM_OUTPUT_CHAR
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\tdc.b "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* This is how to output an assembler line for a numeric constant byte. */
-#undef ASM_OUTPUT_BYTE
-#define ASM_OUTPUT_BYTE(FILE,VALUE) \
- fprintf (FILE, "\tdc.b $%x\n", (int)(VALUE))
-
/* This is how to output an element of a case-vector that is absolute.
(The 68000 does not use such vectors,
but we must define this macro anyway.) */
/* GAS does not understand .ident so don't output anything for #ident. */
#undef ASM_OUTPUT_IDENT
-#undef ASM_LONG
-#define ASM_LONG "\t.long"
-
/* end of dpx2g.h */
#include "m68k/m68k.h"
+#undef INT_OP_GROUP
+#define INT_OP_GROUP INT_OP_NO_DOT
+
/* See m68k.h. 7 means 68020 with 68881. */
#ifndef TARGET_DEFAULT
#undef READONLY_DATA_SECTION
#undef ASM_OUTPUT_DOUBLE
#undef ASM_OUTPUT_FLOAT
-#undef ASM_OUTPUT_INT
-#undef ASM_OUTPUT_SHORT
-#undef ASM_OUTPUT_CHAR
-#undef ASM_OUTPUT_BYTE
#undef ASM_OUTPUT_ADDR_VEC_ELT
#undef ASM_OUTPUT_ADDR_DIFF_ELT
#undef ASM_OUTPUT_ALIGN
fprintf (FILE, "\tlong 0x%lx,0x%lx,0x%lx\n", l[0], l[1], l[2]); \
} while (0)
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\tlong "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "\tshort "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\tbyte "), \
- 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, "\tbyte 0x%x\n", (int)(VALUE))
-
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
fprintf (FILE, "\tlong L%d\n", VALUE)
#define BSS_SECTION_ASM_OP "\t.bss"
-#define ASM_LONG ".long"
-
#include <lynx.h>
/* See m68k.h. 7 means 68020 with 68881. */
int m68k_last_compare_had_fp_operands;
\f
/* Initialize the GCC target structure. */
+
+#if INT_OP_GROUP == INT_OP_DOT_WORD
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
+#endif
+
+#if INT_OP_GROUP == INT_OP_NO_DOT
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP "\tbyte\t"
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\tshort\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\tlong\t"
+#endif
+
+#if INT_OP_GROUP == INT_OP_DC
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP "\tdc.b\t"
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\tdc.w\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\tdc.l\t"
+#endif
+
+#undef TARGET_ASM_UNALIGNED_HI_OP
+#define TARGET_ASM_UNALIGNED_HI_OP TARGET_ASM_ALIGNED_HI_OP
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP TARGET_ASM_ALIGNED_SI_OP
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE m68k_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
many of the definitions that relate to assembler syntax. */
+/* Classify the groups of pseudo-ops used to assemble QI, HI and SI
+ quantities. */
+#define INT_OP_STANDARD 0 /* .byte, .short, .long */
+#define INT_OP_DOT_WORD 1 /* .byte, .word, .long */
+#define INT_OP_NO_DOT 2 /* byte, short, long */
+#define INT_OP_DC 3 /* dc.b, dc.w, dc.l */
+
+/* Set the default */
+#define INT_OP_GROUP INT_OP_DOT_WORD
+
/* Names to predefine in the preprocessor for this target machine. */
/* See sun3.h, sun2.h, isi.h for different CPP_PREDEFINES. */
fprintf (FILE, "\t.long 0x%lx\n", l); \
} while (0)
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\t.long "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "\t.word "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\t.byte "), \
- 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, "\t.byte 0x%x\n", (int)(VALUE))
-
/* This is how to output an insn to push a register on the stack.
It need not be very fast code. */
#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
do { \
register int sp = 0, ch; \
- fprintf ((FILE), "%s", BYTE_ASM_OP); \
+ fputs (integer_asm_op (1, TRUE), (FILE)); \
do { \
ch = (PTR)[sp]; \
if (ch > ' ' && ! (ch & 0x80) && ch != '\\') \
{ \
if ((sp % 10) == 0) \
{ \
- fprintf ((FILE), "\n%s", BYTE_ASM_OP); \
+ fprintf ((FILE), "\n%s", integer_asm_op (1, TRUE)); \
} \
else \
{ \
#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
do { \
register size_t sp = 0, limit = (LEN); \
- fprintf ((FILE), "%s", BYTE_ASM_OP); \
+ fputs (integer_asm_op (1, TRUE), (FILE)); \
do { \
int ch = (PTR)[sp]; \
if (ch > ' ' && ! (ch & 0x80) && ch != '\\') \
{ \
if ((sp % 10) == 0) \
{ \
- fprintf ((FILE), "\n%s", BYTE_ASM_OP); \
+ fprintf ((FILE), "\n%s", integer_asm_op (1, TRUE)); \
} \
else \
{ \
#undef TRAMPOLINE_TEMPLATE
#define TRAMPOLINE_TEMPLATE(FILE) \
{ \
- ASM_OUTPUT_SHORT (FILE, GEN_INT (0x227a)); \
- ASM_OUTPUT_SHORT (FILE, GEN_INT (8)); \
- ASM_OUTPUT_SHORT (FILE, GEN_INT (0x2f3a)); \
- ASM_OUTPUT_SHORT (FILE, GEN_INT (8)); \
- ASM_OUTPUT_SHORT (FILE, GEN_INT (0x4e75)); \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
+ assemble_aligned_integer (2, GEN_INT (0x227a)); \
+ assemble_aligned_integer (2, GEN_INT (8)); \
+ assemble_aligned_integer (2, GEN_INT (0x2f3a)); \
+ assemble_aligned_integer (2, GEN_INT (8)); \
+ assemble_aligned_integer (2, GEN_INT (0x4e75)); \
+ assemble_aligned_integer (4, const0_rtx); \
+ assemble_aligned_integer (4, const0_rtx); \
}
/* Redefine since we are using a different trampoline */
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
sprintf ((OUTPUT), "%s_%%%d", (NAME), (LABELNO)))
+#undef INT_OP_GROUP
#ifdef USE_GAS
-#undef ASM_LONG
-#define ASM_LONG ".long"
-#undef ASM_SHORT
-#define ASM_SHORT ".short"
-#undef ASM_CHAR
-#define ASM_CHAR ".byte"
-#undef ASM_BYTE
-#define ASM_BYTE ".byte"
-#undef ASM_BYTE_OP
-#define ASM_BYTE_OP "\t.byte\t"
+#define INT_OP_GROUP INT_OP_STANDARD
#else
-#undef ASM_LONG
-#define ASM_LONG "long"
-#undef ASM_SHORT
-#define ASM_SHORT "short"
-#undef ASM_CHAR
-#define ASM_CHAR "byte"
-#undef ASM_BYTE
-#define ASM_BYTE "byte"
-#undef ASM_BYTE_OP
-#define ASM_BYTE_OP "\tbyte\t"
-#endif /* USE_GAS */
+#define INT_OP_GROUP INT_OP_NO_DOT
+#endif
/* The sysV68 as doesn't know about double's and float's. */
/* This is how to output an assembler line defining a `double' constant. */
#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
do { long l[2]; \
REAL_VALUE_TO_TARGET_DOUBLE (VALUE, l); \
- fprintf (FILE, "\t%s 0x%lx,0x%lx\n", ASM_LONG, l[0], l[1]); \
+ fprintf ((FILE), "%s0x%lx,0x%lx\n", \
+ integer_asm_op (4, TRUE), l[0], l[1]); \
} while (0)
#undef ASM_OUTPUT_LONG_DOUBLE
#define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE) \
do { long l[3]; \
REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l); \
- fprintf (FILE, "\t%s 0x%lx,0x%lx,0x%lx\n", ASM_LONG, l[0], l[1], l[2]); \
+ fprintf (FILE, "%s 0x%lx,0x%lx,0x%lx\n", \
+ integer_asm_op (4, TRUE), l[0], l[1], l[2]); \
} while (0)
/* This is how to output an assembler line defining a `float' constant. */
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
do { long l; \
REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \
- fprintf ((FILE), "\t%s 0x%lx\n", ASM_LONG, l); \
+ assemble_aligned_integer (4, GEN_INT (l)); \
} while (0)
-/* This is how to output an assembler line defining an `int' constant. */
-
-#undef ASM_OUTPUT_INT
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\t%s ", ASM_LONG), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-
-#undef ASM_OUTPUT_SHORT
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "\t%s ", ASM_SHORT), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#undef ASM_OUTPUT_CHAR
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\t%s ", ASM_CHAR), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* This is how to output an assembler line for a numeric constant byte. */
-
-#undef ASM_OUTPUT_BYTE
-#define ASM_OUTPUT_BYTE(FILE,VALUE) \
- fprintf (FILE, "\t%s 0x%x\n", ASM_BYTE, (int)(VALUE))
-
/* This is how to output an assembler line
that says to advance the location counter
to a multiple of 2**LOG bytes. */
#undef ASM_OUTPUT_ASCII
#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
do { register size_t sp = 0, lp = 0, limit = (LEN); \
- fprintf ((FILE), "%s", ASM_BYTE_OP); \
+ fputs (integer_asm_op (1, TRUE), (FILE)); \
loop: \
if ((PTR)[sp] > ' ' && ! ((PTR)[sp] & 0x80) && (PTR)[sp] != '\\') \
{ lp += 3; \
#undef ASM_OUTPUT_ADDR_VEC_ELT
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
- asm_fprintf (FILE, "\t%s %LL%d\n", ASM_LONG, (VALUE))
+ asm_fprintf (FILE, "%s%LL%d\n", integer_asm_op (4, TRUE), (VALUE))
/* This is how to output an element of a case-vector that is relative. */
#undef ASM_OUTPUT_ADDR_DIFF_ELT
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- asm_fprintf (FILE, "\t%s %LL%d-%LL%d\n", ASM_SHORT, (VALUE), (REL))
+ asm_fprintf (FILE, "\t%s %LL%d-%LL%d\n", \
+ integer_asm_op (2, TRUE), (VALUE), (REL))
#ifndef USE_GAS
#include "m68k/m68k.h"
+#undef INT_OP_GROUP
+#define INT_OP_GROUP INT_OP_STANDARD
+
/* SGS specific assembler pseudo ops. */
-#define BYTE_ASM_OP "\t.byte "
-#define WORD_ASM_OP "\t.short "
-#define LONG_ASM_OP "\t.long "
#define SPACE_ASM_OP "\t.space "
#define ALIGN_ASM_OP "\t.align "
#undef GLOBAL_ASM_OP
#define SWBEG_ASM_OP "\t.swbeg "
#define SET_ASM_OP "\t.set "
-#define UNALIGNED_SHORT_ASM_OP "\t.short " /* Used in dwarfout.c */
-#define UNALIGNED_INT_ASM_OP "\t.long " /* Used in dwarfout.c */
-
#define ASM_PN_FORMAT "%s_%d" /* Format for private names */
/* Here are four prefixes that are used by asm_fprintf to
/* This is how to output an assembler line defining an `int' constant. */
/* The SGS assembler doesn't understand ".word". */
-#undef ASM_OUTPUT_SHORT
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf ((FILE), "%s", WORD_ASM_OP), \
- output_addr_const ((FILE), (VALUE)), \
- fprintf ((FILE), "\n"))
-
#undef ASM_OUTPUT_LONG_DOUBLE
#define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE) \
do { long l[3]; \
REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l); \
- fprintf ((FILE), "%s0x%lx,0x%lx,0x%lx\n", LONG_ASM_OP, \
- l[0], l[1], l[2]); \
+ fprintf ((FILE), "%s0x%lx,0x%lx,0x%lx\n", \
+ integer_asm_op (4, TRUE), l[0], l[1], l[2]); \
} while (0)
/* This is how to output an assembler line defining a `double' constant. */
#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
do { long l[2]; \
REAL_VALUE_TO_TARGET_DOUBLE (VALUE, l); \
- fprintf ((FILE), "%s0x%lx,0x%lx\n", LONG_ASM_OP, \
- l[0], l[1]); \
+ fprintf ((FILE), "%s0x%lx,0x%lx\n", \
+ integer_asm_op (4, TRUE), l[0], l[1]); \
} while (0)
/* This is how to output an assembler line defining a `float' constant. */
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
do { long l; \
REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \
- fprintf ((FILE), "%s0x%lx\n", LONG_ASM_OP, l); \
+ assemble_aligned_integer (4, GEN_INT (l)); \
} while (0)
/* This is how to output an assembler line that says to advance the
#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
do { \
register size_t sp = 0, limit = (LEN); \
- fprintf ((FILE), "%s", BYTE_ASM_OP); \
+ fputs (integer_asm_op (1, TRUE), (FILE)); \
do { \
int ch = (PTR)[sp]; \
if (ch > ' ' && ! (ch & 0x80) && ch != '\\') \
{ \
if ((sp % 10) == 0) \
{ \
- fprintf ((FILE), "\n%s", BYTE_ASM_OP); \
+ fprintf ((FILE), "\n%s", integer_asm_op (1, TRUE)); \
} \
else \
{ \
#undef ASM_OUTPUT_ADDR_DIFF_ELT
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- asm_fprintf (FILE, "%s%LL%d-%LL%d\n", WORD_ASM_OP, VALUE, REL)
+ asm_fprintf (FILE, "%s%LL%d-%LL%d\n", integer_asm_op (2, TRUE), VALUE, REL)
/* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to
keep switch tables in the text section. */
#define SGS_CMP_ORDER /* Takes cmp operands in reverse order */
#define SGS_NO_LI /* Suppress jump table label usage */
+#undef INT_OP_GROUP
+#define INT_OP_GROUP INT_OP_NO_DOT
+
/* Turn on SDB debugging info. */
#define SDB_DEBUGGING_INFO
fprintf ((FILE), "\tlong 0x%lx\n", l); \
} while (0)
-/* This is how to output an assembler line defining an `int' constant. */
-
-#undef ASM_OUTPUT_INT
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\tlong "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-
-#undef ASM_OUTPUT_SHORT
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "\tshort "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#undef ASM_OUTPUT_CHAR
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\tbyte "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* This is how to output an assembler line for a numeric constant byte. */
-
-#undef ASM_OUTPUT_BYTE
-#define ASM_OUTPUT_BYTE(FILE,VALUE) \
- fprintf (FILE, "\tbyte 0x%x\n", (int)(VALUE))
-
#undef ASM_OUTPUT_ADDR_VEC_ELT
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
fprintf (FILE, "\tlong L%%%d\n", (VALUE))
and CTOR_LIST_END to contribute to the .init section an instruction to
push a word containing 0 (or some equivalent of that). */
-#define ASM_LONG "\tlong"
#undef INIT_SECTION_ASM_OP
#define INIT_SECTION_ASM_OP "\tsection\t~init"
#undef FINI_SECTION_ASM_OP
static int m88k_adjust_cost PARAMS ((rtx, rtx, rtx, int));
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP "\tbyte\t"
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\thalf\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\tword\t"
+#undef TARGET_ASM_UNALIGNED_HI_OP
+#define TARGET_ASM_UNALIGNED_HI_OP "\tuahalf\t"
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP "\tuaword\t"
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE m88k_output_function_prologue
#undef TARGET_ASM_FUNCTION_END_PROLOGUE
tdesc_section ();
- fprintf (file, "%s%d,%d", ASM_LONG, /* 8:0,22:(20 or 16),2:2 */
+ /* 8:0,22:(20 or 16),2:2 */
+ fprintf (file, "%s%d,%d", integer_asm_op (4, TRUE),
(((xmask != 0) ? 20 : 16) << 2) | 2,
flag_pic ? 2 : 1);
/* Restore r10 and load the static chain register. */ \
fprintf (FILE, "\tld.d\t %s,%s,24\n", reg_names[10], reg_names[10]); \
/* Storage: r10 save area, static chain, function address. */ \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
+ assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
+ assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
+ assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
}
/* Length in units of the trampoline for entering a nested function.
#define BSS_ASM_OP "\tbss\t"
#define FLOAT_ASM_OP "\tfloat\t"
#define DOUBLE_ASM_OP "\tdouble\t"
-#define ASM_LONG "\tword\t"
-#define SHORT_ASM_OP "\thalf\t"
-#define CHAR_ASM_OP "\tbyte\t"
#define ASCII_DATA_ASM_OP "\tstring\t"
/* These are particular to the global pool optimization. */
/* These are specific to version 03.00 assembler syntax. */
#define INTERNAL_ASM_OP "\tlocal\t"
#define VERSION_ASM_OP "\tversion\t"
-#define UNALIGNED_SHORT_ASM_OP "\tuahalf\t"
-#define UNALIGNED_INT_ASM_OP "\tuaword\t"
#define PUSHSECTION_ASM_OP "\tsection\t"
#define POPSECTION_ASM_OP "\tprevious"
do { \
union { REAL_VALUE_TYPE d; long l[2]; } x; \
x.d = (VALUE); \
- fprintf (FILE, "%s0x%.8lx, 0x%.8lx\n", ASM_LONG, \
+ fprintf (FILE, "%s0x%.8lx, 0x%.8lx\n", \
+ integer_asm_op (4, TRUE), \
(long) x.l[0], (long) x.l[1]); \
} while (0)
do { \
int i; \
FLOAT_TO_INT_INTERNAL (VALUE, i); \
- fprintf (FILE, "%s0x%.8x\n", ASM_LONG, i); \
+ assemble_aligned_integer (4, GEN_INT (i)); \
} while (0)
-/* Likewise for `int', `short', and `char' constants. */
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "%s", ASM_LONG), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "%s", SHORT_ASM_OP), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "%s", CHAR_ASM_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", CHAR_ASM_OP, (int)(VALUE))
-
/* The single-byte pseudo-op is the default. Override svr[34].h. */
-#undef ASM_BYTE_OP
-#define ASM_BYTE_OP "\tbyte\t"
#undef ASM_OUTPUT_ASCII
#define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
output_ascii (FILE, ASCII_DATA_ASM_OP, 48, P, SIZE)
#define DWARF_DEBUGGING_INFO 1
#endif
-/* MCore defines .long and .short to NOT force any alignment.
- This lets you misalign as much as you wish. */
-#define UNALIGNED_INT_ASM_OP "\t.long\t"
-#define UNALIGNED_SHORT_ASM_OP "\t.short\t"
-
#define EXPORTS_SECTION_ASM_OP "\t.section .exports"
#define SUBTARGET_EXTRA_SECTIONS in_const, in_exports
#define TARGET_MERGE_DECL_ATTRIBUTES merge_dllimport_decl_attributes
#endif
+#ifdef OBJECT_FORMAT_ELF
+#undef TARGET_ASM_UNALIGNED_HI_OP
+#define TARGET_ASM_UNALIGNED_HI_OP "\t.short\t"
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP "\t.long\t"
+#endif
+
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE mcore_attribute_table
} \
while (0)
-#define ASM_OUTPUT_INT(STREAM, EXP) \
- (fprintf (STREAM, "\t.long\t"), \
- output_addr_const (STREAM, (EXP)), \
- fputc ('\n', STREAM))
-
-#define ASM_OUTPUT_SHORT(STREAM, EXP) \
- (fprintf (STREAM, "\t.short\t"), \
- output_addr_const (STREAM, (EXP)), \
- fputc ('\n', STREAM))
-
-#define ASM_OUTPUT_CHAR(STREAM, EXP) \
- (fprintf (STREAM, "\t.byte\t"), \
- output_addr_const (STREAM, (EXP)), \
- fputc ('\n', STREAM))
-
-#define ASM_OUTPUT_BYTE(STREAM, VALUE) \
- fprintf (STREAM, "\t.byte\t%d\n", VALUE) \
-
/* This is how to output an assembler line
that says to advance the location counter by SIZE bytes. */
#undef ASM_OUTPUT_SKIP
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
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))
#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. */
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 *));
};
\f
/* 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
break;
}
}
+\f
+/* 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);
+}
\f
/* 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
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) \
#define NM_FLAGS "-p"
-#define ASM_LONG ".word\t"
#define ASM_GLOBAL ".rdata\n\t\t.globl\t"
#include "mips/mips.h"
extern int mmix_rtx_cost_recalculated
PARAMS ((rtx, RTX_CODE, RTX_CODE, int *));
extern int mmix_address_cost PARAMS ((rtx));
-extern void mmix_asm_output_double_int PARAMS ((FILE *, rtx, int));
extern void mmix_print_operand PARAMS ((FILE *, rtx, int));
extern void mmix_print_operand_address PARAMS ((FILE *, rtx));
extern int mmix_valid_comparison PARAMS ((RTX_CODE, enum machine_mode, rtx));
static void mmix_output_condition PARAMS ((FILE *, rtx, int));
static HOST_WIDEST_INT mmix_intval PARAMS ((rtx));
static void mmix_output_octa PARAMS ((FILE *, HOST_WIDEST_INT, int));
+static bool mmix_assemble_integer PARAMS ((rtx, unsigned int, int));
static void mmix_init_machine_status PARAMS ((struct function *));
extern void mmix_target_asm_function_prologue
/* Node: Function Entry */
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP NULL
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP NULL
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP NULL
+#undef TARGET_ASM_ALIGNED_DI_OP
+#define TARGET_ASM_ALIGNED_DI_OP NULL
+#undef TARGET_ASM_INTEGER
+#define TARGET_ASM_INTEGER mmix_assemble_integer
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE mmix_target_asm_function_prologue
+ 1)));
}
-/* ASM_OUTPUT_DOUBLE_INT. */
+/* Target hook for assembling integer objects. Use mmix_print_operand
+ for WYDE and TETRA. Use mmix_output_octa to output 8-byte
+ CONST_DOUBLEs. */
-void
-mmix_asm_output_double_int (stream, value, do_begin_end)
- FILE * stream;
- rtx value;
- int do_begin_end;
+static bool
+mmix_assemble_integer (x, size, aligned_p)
+ rtx x;
+ unsigned int size;
+ int aligned_p;
{
- if (do_begin_end)
- fprintf (stream, "\tOCTA ");
-
- if (GET_CODE (value) == CONST_DOUBLE)
- {
- /* Get the bit representation of this number. */
- HOST_WIDE_INT wval = mmix_intval (value);
- mmix_output_octa (stream, wval, 0);
- }
- else
- /* FIXME: We scrap the '@' symbol-modifier since it's not used
- anymore; we used to jump through lots of hoops, attempting to get
- mmixal-compatible symbols; defined before use (still failed). */
- output_addr_const (stream, value);
-
- if (do_begin_end)
- fprintf (stream, "\n");
+ if (aligned_p)
+ switch (size)
+ {
+ case 1:
+ fputs ("\tBYTE\t", asm_out_file);
+ mmix_print_operand (asm_out_file, x, 'B');
+ fputc ('\n', asm_out_file);
+ return true;
+
+ case 2:
+ fputs ("\tWYDE\t", asm_out_file);
+ mmix_print_operand (asm_out_file, x, 'W');
+ fputc ('\n', asm_out_file);
+ return true;
+
+ case 4:
+ fputs ("\tTETRA\t", asm_out_file);
+ mmix_print_operand (asm_out_file, x, 'L');
+ fputc ('\n', asm_out_file);
+ return true;
+
+ case 8:
+ if (GET_CODE (x) == CONST_DOUBLE)
+ mmix_output_octa (asm_out_file, mmix_intval (x), 0);
+ else
+ assemble_integer_with_op ("\tOCTA\t", x);
+ return true;
+ }
+ return default_assemble_integer (x, size, aligned_p);
}
/* ASM_OUTPUT_ASCII. */
case CONST_DOUBLE:
/* Do somewhat as CONST_INT. */
- mmix_asm_output_double_int (stream, modified_x, 0);
+ mmix_output_octa (stream, mmix_intval (modified_x), 0);
return;
case CONST:
#define ASM_OUTPUT_FLOAT(STREAM, VALUE) \
mmix_asm_output_float (STREAM, &VALUE)
-#define ASM_OUTPUT_DOUBLE_INT(STREAM, EXP) \
- mmix_asm_output_double_int (STREAM, EXP, 1)
-
-#define ASM_OUTPUT_INT(STREAM, EXP) \
- do { \
- fprintf (STREAM, "\tTETRA "); \
- mmix_print_operand (STREAM, EXP, 'L'); \
- fprintf (STREAM, "\n"); \
- } while (0)
-
-#define ASM_OUTPUT_SHORT(STREAM, EXP) \
- do { \
- fprintf (STREAM, "\tWYDE "); \
- mmix_print_operand (STREAM, EXP, 'W'); \
- fprintf (STREAM, "\n"); \
- } while (0)
-
-#define ASM_OUTPUT_CHAR(STREAM, EXP) \
- do { \
- fprintf (STREAM, "\tBYTE "); \
- mmix_print_operand (STREAM, EXP, 'B'); \
- fprintf (STREAM, "\n"); \
- } while (0)
-
-#define ASM_OUTPUT_BYTE(STREAM, VALUE) \
- fprintf (STREAM, "\tBYTE %d\n", (int) (VALUE) & 255)
-
-#define ASM_BYTE_OP "\tBYTE\t"
-
-/* We need these for DWARF2 EH data. If we don't define them, the
- ordinary BYTE, WYDE, TETRA and OCTA will be used, and those are
- aligning. */
-#define UNALIGNED_SHORT_ASM_OP "\t.2byte\t"
-#define UNALIGNED_INT_ASM_OP "\t.4byte\t"
-#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.8byte\t"
-
#define ASM_OUTPUT_ASCII(STREAM, PTR, LEN) \
mmix_asm_output_ascii (STREAM, PTR, LEN)
mmix_asm_output_addr_vec_elt (STREAM, VALUE)
-/* FIXME: Add to docs; It is not mentioned at all that
- ASM_OUTPUT_ADDR_VEC_ELT is used if relative elements are
- used, and that the default expects an undocumented macro
- "ASM_LONG". */
-#define ASM_LONG "OCTA"
-
/* Node: Exception Region Output */
/* (empty) */
static int out_of_line_epilogue;
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t"
struct gcc_target targetm = TARGET_INITIALIZER;
\f
fprintf (FILE, "\t.float %s\n", dstr); \
} while (0)
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_INT(FILE, VALUE) \
-( fprintf (FILE, "\t.long "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE, VALUE) \
-( fprintf (FILE, "\t.hword "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_CHAR(FILE, VALUE) \
-( fprintf (FILE, "\t.byte "), \
- 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, "\t.byte 0x%x\n", (VALUE))
-
/* This says how to output the assembler to define a global
uninitialized but not common symbol.
Try to use asm_output_bss to implement this macro. */
|| regs_ever_live[16] || regs_ever_live[17]))
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t"
struct gcc_target targetm = TARGET_INITIALIZER;
\f
fprintf (FILE, "\t.float %s\n", dstr); \
} while (0)
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_INT(FILE, VALUE) \
-( fprintf (FILE, "\t.long "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE, VALUE) \
-( fprintf (FILE, "\t.hword "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_CHAR(FILE, VALUE) \
-( fprintf (FILE, "\t.byte "), \
- 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, "\t.byte 0x%x\n", (VALUE))
-
/* This says how to output the assembler to define a global
uninitialized but not common symbol.
Try to use asm_output_bss to implement this macro. */
#undef ASM_OUTPUT_ALIGN
#undef ASM_OUTPUT_ASCII
#undef ASM_OUTPUT_DOUBLE
-#undef ASM_OUTPUT_INT
#undef ASM_OUTPUT_INTERNAL_LABEL
#undef ASM_OUTPUT_LOCAL
#undef CPP_PREDEFINES
* uninitialized locals.
*/
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\t.double "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
#define ASM_OUTPUT_LABELREF_AS_INT(STREAM, NAME) \
do { \
fprintf (STREAM, "\t.double\t"); \
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE ns32k_attribute_table
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
+
+#ifdef ENCORE_ASM
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\t.double\t"
+#endif
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE ns32k_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
fprintf (FILE, "\tjump " ); \
PUT_ABSOLUTE_PREFIX (FILE); \
fprintf (FILE, "__trampoline\n" ); \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
- ASM_OUTPUT_INT (FILE, const0_rtx); \
+ assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
+ assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); \
}
/* Length in units of the trampoline for entering a nested function. */
/* This is how to output an assembler line defining an `int' constant. */
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\t.long "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "\t.word "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\t.byte "), \
- 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, "\t.byte 0x%x\n", (VALUE))
-
/* This is how to output an assembler line defining an external/static
address which is not in tree format (for collect.c). */
#undef STATIC_CHAIN_REGNUM
#define STATIC_CHAIN_REGNUM 31
-/* This is not needed for correct operation in 32bit mode, and since
- older versions of gas and the hpux assembler do not accept .dword
- we put this here instead of the more logical location, pa.h. */
-#define ASM_OUTPUT_DOUBLE_INT(FILE,VALUE) \
- do \
- { \
- fputs ("\t.dword ", FILE); \
- if (function_label_operand (VALUE, VOIDmode)) \
- fputs ("P%", FILE); \
- output_addr_const (FILE, (VALUE)); \
- fputs ("\n", FILE); \
- } \
- while (0)
-
/* Nonzero if we do not know how to pass TYPE solely in registers. */
#define MUST_PASS_IN_STACK(MODE,TYPE) \
((TYPE) != 0 \
static void mark_deferred_plabels PARAMS ((void *));
static void compute_zdepwi_operands PARAMS ((unsigned HOST_WIDE_INT, unsigned *));
static int compute_movstrsi_length PARAMS ((rtx));
+static bool pa_assemble_integer PARAMS ((rtx, unsigned int, int));
static void remove_useless_addtr_insns PARAMS ((rtx, int));
static rtx store_reg PARAMS ((int, int, int));
static rtx load_reg PARAMS ((int, int, int));
int n_deferred_plabels = 0;
\f
/* 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_ALIGNED_DI_OP
+#define TARGET_ASM_ALIGNED_DI_OP "\t.dword\t"
+#undef TARGET_ASM_UNALIGNED_HI_OP
+#define TARGET_ASM_UNALIGNED_HI_OP TARGET_ASM_ALIGNED_HI_OP
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP TARGET_ASM_ALIGNED_SI_OP
+#undef TARGET_ASM_UNALIGNED_DI_OP
+#define TARGET_ASM_UNALIGNED_DI_OP TARGET_ASM_ALIGNED_DI_OP
+#undef TARGET_ASM_INTEGER
+#define TARGET_ASM_INTEGER pa_assemble_integer
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE pa_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
if (flag_pic == 1 || TARGET_64BIT)
flag_pic = 2;
+ /* We can't guarantee that .dword is available for 32-bit targets. */
+ if (UNITS_PER_WORD == 4)
+ targetm.asm_out.aligned_op.di = NULL;
+
+ /* The unaligned ops are only available when using GAS. */
+ if (!TARGET_GAS)
+ {
+ targetm.asm_out.unaligned_op.hi = NULL;
+ targetm.asm_out.unaligned_op.si = NULL;
+ targetm.asm_out.unaligned_op.di = NULL;
+ }
+
/* Register global variables with the garbage collector. */
pa_add_gc_roots ();
}
return "depdi -1,%2,%3,%0";
}
\f
+/* Target hook for assembling integer objects. This code handles
+ aligned SI and DI integers specially, since function references must
+ be preceded by P%. */
+
+static bool
+pa_assemble_integer (x, size, aligned_p)
+ rtx x;
+ unsigned int size;
+ int aligned_p;
+{
+ if (size == UNITS_PER_WORD && aligned_p
+ && function_label_operand (x, VOIDmode))
+ {
+ fputs (size == 8? "\t.dword\tP%" : "\t.word\tP%", asm_out_file);
+ output_addr_const (asm_out_file, x);
+ fputc ('\n', asm_out_file);
+ return true;
+ }
+ return default_assemble_integer (x, size, aligned_p);
+}
+\f
/* Output an ascii string. */
void
output_ascii (file, p, size)
fprintf (FILE, "\t.word 0x%lx\n", l); \
} while (0)
-/* This is how to output an assembler line defining an `int' constant.
-
- This is made more complicated by the fact that functions must be
- prefixed by a P% as well as code label references for the exception
- table -- otherwise the linker chokes. */
-
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-{ fputs ("\t.word ", FILE); \
- if (function_label_operand (VALUE, VOIDmode)) \
- fputs ("P%", FILE); \
- output_addr_const (FILE, (VALUE)); \
- fputs ("\n", FILE);}
-
-/* Likewise for `short' and `char' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fputs ("\t.half ", FILE), \
- output_addr_const (FILE, (VALUE)), \
- fputs ("\n", FILE))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fputs ("\t.byte ", FILE), \
- output_addr_const (FILE, (VALUE)), \
- fputs ("\n", FILE))
-
-/* This is how to output an assembler line for a numeric constant byte. */
-
-#define ASM_OUTPUT_BYTE(FILE,VALUE) \
- fprintf (FILE, "\t.byte 0x%x\n", (int)(VALUE))
-
-/* C string constants giving the pseudo-op to use for a sequence of
- 2, 4, and 8 byte unaligned constants. dwarf2out.c needs these. */
-
-#define UNALIGNED_SHORT_ASM_OP (TARGET_GAS ? "\t.half " : NULL)
-#define UNALIGNED_INT_ASM_OP (TARGET_GAS ? "\t.word " : NULL)
-#define UNALIGNED_DOUBLE_INT_ASM_OP (TARGET_GAS ? "\t.dword " : NULL)
-
#define ASM_GLOBALIZE_LABEL(FILE, NAME) \
do { \
/* We only handle DATA objects here, functions are globalized in \
/* rtx cc0_reg_rtx; - no longer needed? */
static rtx find_addr_reg PARAMS ((rtx));
-static const char *singlemove_string PARAMS ((rtx *));
+static const char *singlemove_string PARAMS ((rtx *));
+static bool pdp11_assemble_integer PARAMS ((rtx, unsigned int, int));
static void pdp11_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void pdp11_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
\f
/* Initialize the GCC target structure. */
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP NULL
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP NULL
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP NULL
+#undef TARGET_ASM_INTEGER
+#define TARGET_ASM_INTEGER pdp11_assemble_integer
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE pdp11_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
}
}
+/* Target hook to assemble integer objects. We need to use the
+ pdp-specific version of output_addr_const. */
+
+static bool
+pdp11_assemble_integer (x, size, aligned_p)
+ rtx x;
+ unsigned int size;
+ int aligned_p;
+{
+ if (aligned_p)
+ switch (size)
+ {
+ case 1:
+ fprintf (asm_out_file, "\t.byte\t");
+ output_addr_const_pdp11 (asm_out_file, x);
+ fprintf (asm_out_file, " /* char */\n");
+ return true;
+
+ case 2:
+ fprintf (asm_out_file, TARGET_UNIX_ASM ? "\t" : "\t.word\t");
+ output_addr_const_pdp11 (asm_out_file, x);
+ fprintf (asm_out_file, " /* short */\n");
+ return true;
+ }
+ return default_assemble_integer (x, size, aligned_p);
+}
+
+
/* register move costs, indexed by regs */
static int move_costs[N_REG_CLASSES][N_REG_CLASSES] =
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
fprintf (FILE, "\tfloat %.12e\n", (VALUE))
-/* Likewise for `short' and `char' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, TARGET_UNIX_ASM ? "\t" : "\t.word "), \
- output_addr_const_pdp11 (FILE, (VALUE)), \
- fprintf (FILE, " /*short*/\n"))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\t.byte "), \
- output_addr_const_pdp11 (FILE, (VALUE)), \
- fprintf (FILE, " /* char */\n"))
-
-/* This is how to output an assembler line for a numeric constant byte.
- This won't actually be used since we define ASM_OUTPUT_CHAR.
-*/
-
-#define ASM_OUTPUT_BYTE(FILE,VALUE) \
- fprintf (FILE, "\t.byte %o\n", (VALUE))
-
#define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
output_ascii (FILE, P, SIZE)
if (TARGET_SPLIT) \
abort(); \
\
- ASM_OUTPUT_SHORT (FILE, GEN_INT (0x9400+STATIC_CHAIN_REGNUM)); \
- ASM_OUTPUT_SHORT (FILE, const0_rtx); \
- ASM_OUTPUT_SHORT (FILE, GEN_INT(0x0058)); \
- ASM_OUTPUT_SHORT (FILE, const0_rtx); \
+ assemble_aligned_integer (2, GEN_INT (0x9400+STATIC_CHAIN_REGNUM)); \
+ assemble_aligned_integer (2, const0_rtx); \
+ assemble_aligned_integer (2, GEN_INT(0x0058)); \
+ assemble_aligned_integer (2, const0_rtx); \
}
#define TRAMPOLINE_SIZE 8
fprintf (FILE,"\t! %s\n", TARGET_LITTLE_ENDIAN ? ".little" : ".big"); \
fprintf (FILE,"\t.align 4\n");
-#define ASM_LONG ".long"
#define ASM_APP_ON ""
#define ASM_APP_OFF ""
#define FILE_ASM_OP "\t.file\n"
fprintf ((FILE), "\t.float %s\n", dstr); \
} while (0)
-#define ASM_OUTPUT_INT(STREAM, EXP) \
- (fprintf ((STREAM), "\t.long\t"), \
- output_addr_const ((STREAM), (EXP)), \
- fputc ('\n', (STREAM)))
-
-#define ASM_OUTPUT_SHORT(STREAM, EXP) \
- (fprintf ((STREAM), "\t.short\t"), \
- output_addr_const ((STREAM), (EXP)), \
- fputc ('\n', (STREAM)))
-
-#define ASM_OUTPUT_CHAR(STREAM, EXP) \
- (fprintf ((STREAM), "\t.byte\t"), \
- output_addr_const ((STREAM), (EXP)), \
- fputc ('\n', (STREAM)))
-
-#define ASM_OUTPUT_BYTE(STREAM, VALUE) \
- fprintf ((STREAM), "\t.byte\t%d\n", (VALUE))
-
/* This is how to output an assembler line
that says to advance the location counter by SIZE bytes. */
fprintf (FILE, "\t.long 0x%x\n", u_i_f.i);\
} while (0)
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\t.long "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "\t.short "), \
- output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\t.byte "), \
- 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, "\t.byte 0x%x\n", (VALUE))
-
/* This is how to output code to push a register on the stack.
It need not be very fast code. */
|| (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
&& ! TARGET_NO_FP_IN_TOC)))))
-/* This is how to output an assembler line defining an `int'
- constant. */
-#undef ASM_OUTPUT_INT
-#define ASM_OUTPUT_INT(FILE, VALUE) \
- do \
- { \
- fputs ("\t.long ", (FILE)); \
- output_addr_const ((FILE), (VALUE)); \
- putc ('\n', (FILE)); \
- } \
- while (0)
-
-/* This is how to output an assembler line defining a `double int'
- constant. */
-#undef ASM_OUTPUT_DOUBLE_INT
-#define ASM_OUTPUT_DOUBLE_INT(FILE, VALUE) \
- do \
- { \
- fputs (DOUBLE_INT_ASM_OP, (FILE)); \
- output_addr_const ((FILE), (VALUE)); \
- putc ('\n', (FILE)); \
- } \
- while (0)
-
#undef ASM_DEFAULT_SPEC
#define ASM_DEFAULT_SPEC "-mppc64"
+
+/* We don't need to generate entries in .fixup. */
+#undef RELOCATABLE_NEEDS_FIXUP
static int constant_pool_expr_1 PARAMS ((rtx, int *, int *));
static void rs6000_free_machine_status PARAMS ((struct function *));
static void rs6000_init_machine_status PARAMS ((struct function *));
+static bool rs6000_assemble_integer PARAMS ((rtx, unsigned int, int));
static int rs6000_ra_ever_killed PARAMS ((void));
static tree rs6000_handle_longcall_attribute PARAMS ((tree *, tree, tree, int, bool *));
const struct attribute_spec rs6000_attribute_table[];
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE rs6000_attribute_table
+#undef TARGET_ASM_ALIGNED_DI_OP
+#define TARGET_ASM_ALIGNED_DI_OP DOUBLE_INT_ASM_OP
+
+/* Default unaligned ops are only provided for ELF. Find the ops needed
+ for non-ELF systems. */
+#ifndef OBJECT_FORMAT_ELF
+#ifdef OBJECT_FORMAT_COFF
+/* For ECOFF. rs6000_assemble_integer will handle unaligned DIs on
+ 64-bit targets. */
+#undef TARGET_ASM_UNALIGNED_HI_OP
+#define TARGET_ASM_UNALIGNED_HI_OP "\t.vbyte\t2,"
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP "\t.vbyte\t4,"
+#undef TARGET_ASM_UNALIGNED_DI_OP
+#define TARGET_ASM_UNALIGNED_DI_OP "\t.vbyte\t8,"
+#else
+/* For Darwin. */
+#undef TARGET_ASM_UNALIGNED_HI_OP
+#define TARGET_ASM_UNALIGNED_HI_OP "\t.short\t"
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP "\t.long\t"
+#endif
+#endif
+
+/* This hook deals with fixups for relocatable code and DI-mode objects
+ in 64-bit code. */
+#undef TARGET_ASM_INTEGER
+#define TARGET_ASM_INTEGER rs6000_assemble_integer
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE rs6000_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
if (TARGET_TOC)
ASM_GENERATE_INTERNAL_LABEL (toc_label_name, "LCTOC", 1);
+ /* We can only guarantee the availability of DI pseudo-ops when
+ assembling for 64-bit targets. */
+ if (!TARGET_POWERPC64)
+ {
+ targetm.asm_out.aligned_op.di = NULL;
+ targetm.asm_out.unaligned_op.di = NULL;
+ }
+
/* Arrange to save and restore machine status around nested functions. */
init_machine_status = rs6000_init_machine_status;
free_machine_status = rs6000_free_machine_status;
abort ();
}
\f
+/* Target hook for assembling integer objects. The powerpc version has
+ to handle fixup entries for relocatable code if RELOCATABLE_NEEDS_FIXUP
+ is defined. It also needs to handle DI-mode objects on 64-bit
+ targets. */
+
+static bool
+rs6000_assemble_integer (x, size, aligned_p)
+ rtx x;
+ unsigned int size;
+ int aligned_p;
+{
+#ifdef RELOCATABLE_NEEDS_FIXUP
+ /* Special handling for SI values. */
+ if (size == 4 && aligned_p)
+ {
+ extern int in_toc_section PARAMS ((void));
+ static int recurse = 0;
+
+ /* For -mrelocatable, we mark all addresses that need to be fixed up
+ in the .fixup section. */
+ if (TARGET_RELOCATABLE
+ && !in_toc_section ()
+ && !in_text_section ()
+ && !recurse
+ && GET_CODE (x) != CONST_INT
+ && GET_CODE (x) != CONST_DOUBLE
+ && CONSTANT_P (x))
+ {
+ char buf[256];
+
+ recurse = 1;
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", fixuplabelno);
+ fixuplabelno++;
+ ASM_OUTPUT_LABEL (asm_out_file, buf);
+ fprintf (asm_out_file, "\t.long\t(");
+ output_addr_const (asm_out_file, x);
+ fprintf (asm_out_file, ")@fixup\n");
+ fprintf (asm_out_file, "\t.section\t\".fixup\",\"aw\"\n");
+ ASM_OUTPUT_ALIGN (asm_out_file, 2);
+ fprintf (asm_out_file, "\t.long\t");
+ assemble_name (asm_out_file, buf);
+ fprintf (asm_out_file, "\n\t.previous\n");
+ recurse = 0;
+ return true;
+ }
+ /* Remove initial .'s to turn a -mcall-aixdesc function
+ address into the address of the descriptor, not the function
+ itself. */
+ else if (GET_CODE (x) == SYMBOL_REF
+ && XSTR (x, 0)[0] == '.'
+ && DEFAULT_ABI == ABI_AIX)
+ {
+ const char *name = XSTR (x, 0);
+ while (*name == '.')
+ name++;
+
+ fprintf (asm_out_file, "\t.long\t%s\n", name);
+ return true;
+ }
+ }
+#endif /* RELOCATABLE_NEEDS_FIXUP */
+ return default_assemble_integer (x, size, aligned_p);
+}
+\f
enum rtx_code
rs6000_reverse_condition (mode, code)
enum machine_mode mode;
fprintf (FILE, "\t.long 0x%lx\n", t & 0xffffffff); \
}
-/* This is how to output an assembler line defining an `int' constant. */
-
-#define ASM_OUTPUT_DOUBLE_INT(FILE,VALUE) \
-do { \
- if (TARGET_32BIT) \
- { \
- 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); \
- } \
- else \
- { \
- fprintf (FILE, "%s", DOUBLE_INT_ASM_OP); \
- output_addr_const (FILE, (VALUE)); \
- putc ('\n', FILE); \
- } \
-} while (0)
-
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fputs ("\t.long ", FILE), \
- output_addr_const (FILE, (VALUE)), \
- putc ('\n', FILE))
-
-/* Likewise for `char' and `short' constants. */
-
-#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fputs ("\t.short ", FILE), \
- output_addr_const (FILE, (VALUE)), \
- putc ('\n', FILE))
-
-#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fputs ("\t.byte ", FILE), \
- output_addr_const (FILE, (VALUE)), \
- putc ('\n', FILE))
-
-/* This is how to output an assembler line for a numeric constant byte. */
-
-#define ASM_OUTPUT_BYTE(FILE,VALUE) \
- fprintf (FILE, "\t.byte 0x%x\n", (int)(VALUE))
-
-/* This is used by the definition of ASM_OUTPUT_ADDR_ELT in defaults.h. */
-#define ASM_LONG (TARGET_32BIT ? ".long" : DOUBLE_INT_ASM_OP)
-
/* This is how to output an element of a case-vector that is relative. */
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
} \
} \
} \
+} \
+ \
+extern int in_toc_section PARAMS ((void)); \
+int in_toc_section () \
+{ \
+ return in_section == in_toc; \
}
#define SDATA_SECTION_FUNCTION \
#define TARGET_ASM_CONSTRUCTOR rs6000_elf_asm_out_constructor
#define TARGET_ASM_DESTRUCTOR rs6000_elf_asm_out_destructor
-/* This is how to output an assembler line defining an `int' constant.
- For -mrelocatable, we mark all addresses that need to be fixed up
- in the .fixup section. */
-/* Override rs6000.h definition. */
-#undef ASM_OUTPUT_INT
-#define ASM_OUTPUT_INT(FILE,VALUE) \
-do { \
- static int recurse = 0; \
- if (TARGET_RELOCATABLE \
- && in_section != in_toc \
- && in_section != in_text \
- && !recurse \
- && GET_CODE (VALUE) != CONST_INT \
- && GET_CODE (VALUE) != CONST_DOUBLE \
- && CONSTANT_P (VALUE)) \
- { \
- char buf[256]; \
- \
- recurse = 1; \
- ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", fixuplabelno); \
- fixuplabelno++; \
- ASM_OUTPUT_LABEL (FILE, buf); \
- fprintf (FILE, "\t.long ("); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, ")@fixup\n"); \
- fprintf (FILE, "\t.section\t\".fixup\",\"aw\"\n"); \
- ASM_OUTPUT_ALIGN (FILE, 2); \
- fprintf (FILE, "\t.long\t"); \
- assemble_name (FILE, buf); \
- fprintf (FILE, "\n\t.previous\n"); \
- recurse = 0; \
- } \
- /* Remove initial .'s to turn a -mcall-aixdesc function \
- address into the address of the descriptor, not the function \
- itself. */ \
- else if (GET_CODE (VALUE) == SYMBOL_REF \
- && XSTR (VALUE, 0)[0] == '.' \
- && DEFAULT_ABI == ABI_AIX) \
- { \
- const char *name = XSTR (VALUE, 0); \
- while (*name == '.') \
- name++; \
- \
- fprintf (FILE, "\t.long %s\n", name); \
- } \
- else \
- { \
- fprintf (FILE, "\t.long "); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
- } \
-} while (0)
-
/* This is the end of what might become sysv4.h. */
/* Use DWARF 2 debugging information by default. */
#define TARGET_ASM_EXCEPTION_SECTION readonly_data_section
#define DOUBLE_INT_ASM_OP "\t.quad\t"
+
+/* Generate entries in .fixup for relocatable addresses. */
+#define RELOCATABLE_NEEDS_FIXUP
/* This is how we tell the assembler that two symbols have the same value. */
#define SET_ASM_OP "\t.set "
-/* Used by definition of ASM_OUTPUT_DOUBLE_INT */
-#define DOUBLE_INT_ASM_OP "\t.llong "
-
-/* These are various definitions for DWARF output. They could just
- use '.long' or '.word', but that aligns to a 4-byte boundary which
- is not what is required. So we define a million macros... */
-
-#define UNALIGNED_SHORT_ASM_OP "\t.vbyte\t2,"
-#define UNALIGNED_INT_ASM_OP "\t.vbyte\t4,"
-/* Only define if alignment greater than 4. */
-#define UNALIGNED_DOUBLE_INT_ASM_OP (TARGET_64BIT ? "\t.vbyte\t8," : NULL)
+/* Used by rs6000_assemble_integer, among others. */
+#define DOUBLE_INT_ASM_OP "\t.llong\t"
/* Output before instructions. */
#define TEXT_SECTION_ASM_OP "\t.csect .text[PR]"
/* Assembler pseudos to introduce constants of various size. */
-#define ASM_SHORT "\t.word"
-#define ASM_LONG "\t.long"
-#define ASM_QUAD "\t.quad"
#define ASM_DOUBLE "\t.double"
sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-#define ASM_OUTPUT_DOUBLE_INT(FILE, VALUE) \
-do { fprintf ((FILE), "%s\t", ASM_QUAD); \
- /* Work around bug in some GNU as versions */ \
- if (GET_CODE (VALUE) == CONST_INT && INTVAL (VALUE) < INT_MIN) \
- fprintf ((FILE), HOST_WIDE_INT_PRINT_HEX, INTVAL (x)); \
- else \
- output_addr_const ((FILE), (VALUE)); \
- putc ('\n', (FILE)); \
- } while (0)
-
-
-/* This is how to output an assembler line defining an `int' constant. */
-
-#undef ASM_OUTPUT_INT
-#define ASM_OUTPUT_INT(FILE, VALUE) \
-do { fprintf (FILE, "%s\t", ASM_LONG); \
- output_addr_const (FILE, (VALUE)); \
- putc ('\n',FILE); \
- } while (0)
-
-/* Likewise for `char' and `short' constants.
- is this supposed to do align too?? */
-
-#define ASM_OUTPUT_SHORT(FILE, VALUE) \
-( fprintf (FILE, "%s\t", ASM_SHORT), \
- output_addr_const (FILE, (VALUE)), \
- putc ('\n',FILE))
-
-#define ASM_OUTPUT_CHAR(FILE, VALUE) \
-( fprintf (FILE, "\t%s\t", ASM_BYTE_OP), \
- output_addr_const (FILE, (VALUE)), \
- putc ('\n', FILE))
-
-/* This is how to output an assembler line for a numeric constant byte. */
-
-#define ASM_OUTPUT_BYTE(FILE, VALUE) \
- fprintf ((FILE), "\t%s\t0x%x\n", ASM_BYTE_OP, (int)(VALUE))
-
/* internal macro to output long */
#define _ASM_OUTPUT_LONG(FILE, VALUE) \
fprintf (FILE, "\t.long\t0x%lX\n", VALUE);
/* This is how to output an element of a case-vector that is absolute. */
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
- fprintf (FILE, "%s\t%s%d\n", TARGET_64BIT?ASM_QUAD:ASM_LONG, \
+ fprintf (FILE, "%s%s%d\n", integer_asm_op (UNITS_PER_WORD, TRUE), \
LPREFIX, VALUE)
/* This is how to output an element of a case-vector that is relative. */
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- fprintf (FILE, "%s\t%s%d-%s%d\n", TARGET_64BIT?ASM_QUAD:ASM_LONG, \
+ fprintf (FILE, "%s%s%d-%s%d\n", integer_asm_op (UNITS_PER_WORD, TRUE), \
LPREFIX, VALUE, LPREFIX, REL)
#include "debug.h"
+static bool s390_assemble_integer PARAMS ((rtx, unsigned int, int));
static int s390_adjust_cost PARAMS ((rtx, rtx, rtx, int));
static int s390_adjust_priority PARAMS ((rtx, int));
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
+#undef TARGET_ASM_ALIGNED_DI_OP
+#define TARGET_ASM_ALIGNED_DI_OP "\t.quad\t"
+#undef TARGET_ASM_INTEGER
+#define TARGET_ASM_INTEGER s390_assemble_integer
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE s390_function_prologue
}
}
+/* Target hook for assembling integer objects. We need to define it
+ here to work a round a bug in some versions of GAS, which couldn't
+ handle values smaller than INT_MIN when printed in decimal. */
+
+static bool
+s390_assemble_integer (x, size, aligned_p)
+ rtx x;
+ unsigned int size;
+ int aligned_p;
+{
+ if (size == 8 && aligned_p
+ && GET_CODE (x) == CONST_INT && INTVAL (x) < INT_MIN)
+ {
+ fputs ("\t.quad\t", asm_out_file);
+ fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX, INTVAL (x));
+ putc ('\n', asm_out_file);
+ return true;
+ }
+ return default_assemble_integer (x, size, aligned_p);
+}
+
+
#define DEBUG_SCHED 0
/* Returns true if register REGNO is used for forming
|| GET_CODE (EXP) == SYMBOL_REF \
|| GET_CODE (EXP) == LABEL_REF )) \
{ \
- fprintf (FILE, "%s\t",TARGET_64BIT ? ASM_QUAD : ASM_LONG); \
+ fputs (integer_asm_op (UNITS_PER_WORD, TRUE), FILE); \
s390_output_symbolic_const (FILE, EXP); \
fputc ('\n', (FILE)); \
} \
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE sh_attribute_table
+/* The next two are used for debug info when compiling with -gdwarf. */
+#undef TARGET_ASM_UNALIGNED_HI_OP
+#define TARGET_ASM_UNALIGNED_HI_OP "\t.uaword\t"
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP "\t.ualong\t"
+
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE sh_output_function_epilogue
fprintf ((FILE), "\t.float %s\n", dstr); \
} while (0)
-#define ASM_OUTPUT_INT(STREAM, EXP) \
- (fprintf ((STREAM), "\t.long\t"), \
- output_addr_const ((STREAM), (EXP)), \
- fputc ('\n', (STREAM)))
-
-#define ASM_OUTPUT_SHORT(STREAM, EXP) \
- (fprintf ((STREAM), "\t.short\t"), \
- output_addr_const ((STREAM), (EXP)), \
- fputc ('\n', (STREAM)))
-
-#define ASM_OUTPUT_CHAR(STREAM, EXP) \
- (fprintf ((STREAM), "\t.byte\t"), \
- output_addr_const ((STREAM), (EXP)), \
- fputc ('\n', (STREAM)))
-
-#define ASM_OUTPUT_BYTE(STREAM, VALUE) \
- fprintf ((STREAM), "\t.byte\t%d\n", (VALUE)) \
-
-/* The next two are used for debug info when compiling with -gdwarf. */
-#define UNALIGNED_SHORT_ASM_OP "\t.uaword\t"
-#define UNALIGNED_INT_ASM_OP "\t.ualong\t"
-
/* Loop alignment is now done in machine_dependent_reorg, so that
branch shortening can know about it. */
#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.
#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. */
#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"
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));
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));
enum processor_type sparc_cpu;
\f
/* 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
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 ();
else { output_addr_const (file, x); }
}
\f
-/* 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);
}
\f
/* Return the value of a code used in the .proc pseudo-op that says
/* ??? 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). */
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); \
} \
{ \
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'
{ \
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) \
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
#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. */
return NULL_TREE;
}
\f
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* #define ASM_OUTPUT_BYTE_FLOAT(STREAM, VALUE) */
/* A C statement to output to the stdio stream STREAM an assembler instruction
- to assemble an integer of 16, 8, 4, 2 or 1 bytes, respectively, whose value
- is VALUE. The argument EXP will be an RTL expression which represents a
- constant value. Use `output_addr_const (STREAM, EXP)' to output this value
- as an assembler expression.
-
- For sizes larger than `UNITS_PER_WORD', if the action of a macro would be
- identical to repeatedly calling the macro corresponding to a size of
- `UNITS_PER_WORD', once for each word, you need not define the macro. */
-/* #define ASM_OUTPUT_QUADRUPLE_INT(STREAM, EXP) */
-/* #define ASM_OUTPUT_DOUBLE_INT(STREAM, EXP) */
-
-/* This is how to output an assembler line defining a `char' constant. */
-#define ASM_OUTPUT_CHAR(FILE, VALUE) \
-do { \
- fprintf (FILE, "\t.byte\t"); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
-} while (0)
-
-/* This is how to output an assembler line defining a `short' constant. */
-#define ASM_OUTPUT_SHORT(FILE, VALUE) \
-do { \
- fprintf (FILE, "\t.hword\t"); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
-} while (0)
-
-/* This is how to output an assembler line defining an `int' constant.
- We also handle symbol output here. */
-#define ASM_OUTPUT_INT(FILE, VALUE) \
-do { \
- fprintf (FILE, "\t.word\t"); \
- output_addr_const (FILE, (VALUE)); \
- fprintf (FILE, "\n"); \
-} while (0)
-
-/* A C statement to output to the stdio stream STREAM an assembler instruction
- to assemble a single byte containing the number VALUE.
-
- This declaration must be present. */
-#define ASM_OUTPUT_BYTE(STREAM, VALUE) \
- fprintf (STREAM, "\t%s\t0x%x\n", ASM_BYTE_OP, (VALUE))
-
-/* A C string constant giving the pseudo-op to use for a sequence of
- single-byte constants. If this macro is not defined, the default
- is `"byte"'.
-
- Defined in svr4.h. */
-/* #define ASM_BYTE_OP */
-
-/* A C statement to output to the stdio stream STREAM an assembler instruction
to assemble a string constant containing the LEN bytes at PTR. PTR will be
a C expression of type `char *' and LEN a C expression of type `int'.
/* Define this macro to 0 if your target supports DWARF 2 frame unwind
information, but it does not yet work with exception handling. Otherwise,
if your target supports this information (if it defines
- `INCOMING_RETURN_ADDR_RTX' and either `UNALIGNED_INT_ASM_OP' or
- `OBJECT_FORMAT_ELF'), GCC will provide a default definition of 1.
+ `INCOMING_RETURN_ADDR_RTX'), GCC will provide a default definition of 1.
If this macro is defined to 1, the DWARF 2 unwinder will be the default
exception handling mechanism; otherwise, setjmp/longjmp will be used by
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE BITS_PER_WORD
-/* Assembler pseudos to introduce constants of various size. These
- definitions should work for most svr3 systems. */
-
-#undef ASM_BYTE_OP
-#define ASM_BYTE_OP "\t.byte\t"
-
/* The prefix to add t