/* On the 68k, the trampoline looks like this:
mov @#.,a0
- jsr @#__trampoline
- jsr @#__trampoline
+ jsr @#___trampoline
+ jsr @#___trampoline
.long STATIC
.long FUNCTION
The reason for having three jsr insns is so that an entire line
of the instruction cache is filled in a predictable way
-that will always be the same. */
+that will always be the same.
+
+We always use the assembler label ___trampoline
+regardless of whether the system adds underscores. */
#define TRAMPOLINE_TEMPLATE(FILE) \
{ \
ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x207c)); \
ASM_OUTPUT_SHORT (FILE, const0_rtx); \
ASM_OUTPUT_SHORT (FILE, const0_rtx); \
- ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x4ef9)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (SYMBOL_REF, SImode, "__trampoline")); \
- ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x4ef9)); \
- ASM_OUTPUT_INT (FILE, gen_rtx (SYMBOL_REF, SImode, "__trampoline")); \
+ ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x4eb9)); \
+ ASM_OUTPUT_INT (FILE, gen_rtx (SYMBOL_REF, SImode, "*___trampoline"));\
+ ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x4eb9)); \
+ ASM_OUTPUT_INT (FILE, gen_rtx (SYMBOL_REF, SImode, "*___trampoline"));\
ASM_OUTPUT_SHORT (FILE, const0_rtx); \
ASM_OUTPUT_SHORT (FILE, const0_rtx); \
ASM_OUTPUT_SHORT (FILE, const0_rtx); \
__transfer_from_trampoline () \
{ \
register char *a0 asm ("%a0"); \
+ asm (GLOBAL_ASM_OP, " ___trampoline"); \
asm ("___trampoline:"); \
asm volatile ("move%.l %0,%@" : : "m" (a0[22])); \
asm volatile ("move%.l %1,%0" : "=a" (a0) : "m" (a0[18])); \
work properly in synth_mult on the 68020,
relative to an average of the time for add and the time for shift,
taking away a little more because sometimes move insns are needed. */
+#define MULL_COST (TARGET_68040 ? 5 : 13)
+#define MULW_COST (TARGET_68040 ? 3 : 8)
#define RTX_COSTS(X,CODE) \
case PLUS: \
break; \
} \
else if (GET_MODE (X) == QImode || GET_MODE (X) == HImode) \
- return COSTS_N_INSNS (8); /* mul.w */ \
+ return COSTS_N_INSNS (MULW_COST); \
else \
- return COSTS_N_INSNS (13); /* mul.l */ \
+ return COSTS_N_INSNS (MULL_COST); \
break; \
case DIV: \
case UDIV: \
/* This is how to output a command to make the user-level label named NAME
defined for reference from other files. */
+#define GLOBAL_ASM_OP ".globl"
#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
- do { fputs (".globl ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
+ do { fprintf (FILE, "%s ", GLOBAL_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ fputs ("\n", FILE);} while (0)
/* This is how to output a reference to a user-level label named NAME.
`assemble_name' uses this. */
#define LONG_ASM_OP ".long"
#define SPACE_ASM_OP ".space"
#define ALIGN_ASM_OP ".align"
+#undef GLOBAL_ASM_OP
#define GLOBAL_ASM_OP ".global"
#define SWBEG_ASM_OP ".swbeg"
#define SET_ASM_OP ".set"
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (68k, SGS/AT&T syntax)");
-/* This is how to output a command to make the user-level label named NAME
- defined for reference from other files. */
-
-#undef ASM_GLOBALIZE_LABEL
-#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
- do { \
- fprintf ((FILE), "\t%s ", GLOBAL_ASM_OP); \
- assemble_name ((FILE), NAME); \
- fputs ("\n", FILE); \
- } while (0)
-
#undef PRINT_OPERAND_PRINT_FLOAT
#define PRINT_OPERAND_PRINT_FLOAT(CODE,FILE) \
asm_fprintf ((FILE), "%I0x%x", u1.i);
fprintf (FILE, "\tlink %%a6,&%d\n", -fsize); \
else \
fprintf (FILE, "\tlink %%a6,&0\n\tsub.l &%d,%%sp\n", fsize); } \
- for (regno = 24; regno < 56; regno++) \
- if (regs_ever_live[regno] && ! call_used_regs[regno]) \
- fprintf(FILE, "\tfpmoved %s,-(%%sp)\n", \
- reg_names[regno]); \
for (regno = 16; regno < 24; regno++) \
if (regs_ever_live[regno] && ! call_used_regs[regno]) \
mask |= 1 << (regno - 16); \
{ register int regno; \
register int mask, fmask; \
register int nregs; \
- int offset, foffset, fpoffset; \
+ int offset, foffset; \
extern char call_used_regs[]; \
int fsize = ((SIZE) + 3) & -4; \
int big = 0; \
- nregs = 0; fmask = 0; fpoffset = 0; \
- for (regno = 24 ; regno < 56 ; regno++) \
- if (regs_ever_live[regno] && ! call_used_regs[regno]) \
- nregs++; \
- fpoffset = nregs*8; \
- nregs = 0; \
+ nregs = 0; fmask = 0; \
for (regno = 16; regno < 24; regno++) \
if (regs_ever_live[regno] && ! call_used_regs[regno]) \
{ nregs++; fmask |= 1 << (23 - regno); } \
- foffset = fpoffset + nregs * 12; \
+ foffset = nregs * 12; \
nregs = 0; mask = 0; \
if (frame_pointer_needed) regs_ever_live[FRAME_POINTER_REGNUM] = 0; \
for (regno = 0; regno < 16; regno++) \
offset = foffset + nregs * 4; \
if (offset + fsize >= 0x8000 \
&& frame_pointer_needed \
- && (mask || fmask || fpoffset)) \
+ && (mask || fmask)) \
{ fprintf (FILE, "\tmov.l &%d,%%a0\n", -fsize); \
fsize = 0, big = 1; } \
if (exact_log2 (mask) >= 0) { \
else \
fprintf (FILE, "\tfmovm -%d(%%a6),&0x%x\n", \
foffset + fsize, fmask); } \
- if (fpoffset != 0) \
- for (regno = 55; regno >= 24; regno--) \
- if (regs_ever_live[regno] && ! call_used_regs[regno]) { \
- if (big) \
- fprintf(FILE, "\tfpmoved -%d(%%a6,%%a0.l),%s\n", \
- fpoffset + fsize, reg_names[regno]); \
- else if (! frame_pointer_needed) \
- fprintf(FILE, "\tfpmoved (%%sp)+,%s\n", \
- reg_names[regno]); \
- else \
- fprintf(FILE, "\tfpmoved -%d(%%a6),%s\n", \
- fpoffset + fsize, reg_names[regno]); \
- fpoffset -= 8; \
- } \
if (current_function_returns_pointer) \
fprintf (FILE, "\tmov.l %%d0,%%a0\n"); \
if (frame_pointer_needed) \
#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 11), \
sprintf ((OUTPUT), "%s%%%%%d", (NAME), (LABELNO)))
-
-/* This is how to output a command to make the user-level label named NAME
+
+/* This is the command to make the user-level label named NAME
defined for reference from other files. */
-#undef ASM_GLOBALIZE_LABEL
-#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
-do { fputs ("\tglobal ", FILE); \
- assemble_name (FILE, NAME); \
- fputs ("\n", FILE); \
- } while (0)
+#undef GLOBAL_ASM_OP
+#define GLOBAL_ASM_OP "global"
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
#define PUT_SDB_ENDEF fputs("\tendef\n", asm_out_file)
#define PUT_SDB_TYPE(a) fprintf(asm_out_file, "\ttype\t0%o;", a)
#define PUT_SDB_SIZE(a) fprintf(asm_out_file, "\tsize\t%d;", a)
-#define PUT_SDB_DIM(a) fprintf(asm_out_file, "\tdim\t%d;", a)
+#define PUT_SDB_START_DIM fprintf(asm_out_file, "\tdim\t")
+#define PUT_SDB_NEXT_DIM(a) fprintf(asm_out_file, "%d,", a)
+#define PUT_SDB_LAST_DIM(a) fprintf(asm_out_file, "%d;", a)
#define PUT_SDB_TAG(a) \
do { fprintf (asm_out_file, "\ttag\t"); \