Make ASM_OUTPUT_MI_THUNK ELF only for now and always use jump

From-SVN: r22628
This commit is contained in:
Michael Meissner 1998-09-28 14:40:27 +00:00 committed by Michael Meissner
parent 8ff0c1af0e
commit 42820a49dd
3 changed files with 28 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Mon Sep 28 17:34:35 1998 Michael Meissner <meissner@cygnus.com>
* rs6000.h (ASM_OUTPUT_MI_THUNK): Only define on ELF systems.
* rs6000.c (output_mi_thunk): Always use a raw jump for now.
Mon Sep 28 14:24:03 1998 Mark Mitchell <mark@markmitchell.com>
* tree.h (TYPE_BINFO): Document.

View file

@ -4557,6 +4557,15 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
Otherwise, load up its address and jump to it. */
fname = XSTR (XEXP (DECL_RTL (function), 0), 0);
#if 1
/* For now, just emit a branch always, until we can figure out better when we
need to load the address into the count register and emit the slower bctr
instruction. */
fprintf (file, "\tb %s", prefix);
assemble_name (file, fname);
fprintf (file, "\n");
#else
if (TREE_ASM_WRITTEN (function)
&& !lookup_attribute ("longcall", TYPE_ATTRIBUTES (TREE_TYPE (function))))
{
@ -4620,6 +4629,8 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
asm_fprintf (file, "\t{l|lwz} %s,", r0);
assemble_name (file, fname);
asm_fprintf (file, "@got(%s)\n", r12);
asm_fprintf (file, "\tmtctr %s\n", r0);
asm_fprintf (file, "\tbctr\n");
}
#if TARGET_ELF
else if (flag_pic > 1 || TARGET_RELOCATABLE)
@ -4635,6 +4646,8 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
asm_fprintf (file, "(%s)\n", r12);
asm_fprintf (file, "\t{l|lwz} %s,4(%s)\n", r12, sp);
asm_fprintf (file, "\tmtlr %s\n", r12);
asm_fprintf (file, "\tmtctr %s\n", r0);
asm_fprintf (file, "\tbctr\n");
asm_fprintf (file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);
assemble_name (file, buf);
fputs (" = .-.LCTOC1\n", file);
@ -4642,22 +4655,24 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
assemble_name (file, fname);
fputs ("\n\t.previous\n", file);
}
#endif
#endif /* TARGET_ELF */
else
{
asm_fprintf (file, "\t{liu|lis} %s,", r0);
asm_fprintf (file, "\t{liu|lis} %s,", r12);
assemble_name (file, fname);
asm_fprintf (file, "@ha\n");
asm_fprintf (file, "\t{cal|la} %s,", r0);
asm_fprintf (file, "\t{cal|la} %s,", r12);
assemble_name (file, fname);
asm_fprintf (file, "@l(%s)\n", r0);
asm_fprintf (file, "@l(%s)\n", r12);
asm_fprintf (file, "\tmtctr %s\n", r12);
asm_fprintf (file, "\tbctr\n");
}
asm_fprintf (file, "\tmtctr %s\n", r0);
asm_fprintf (file, "\tbctr\n");
break;
}
}
#endif /* #if 0 out code to use bctr for far away jumps */
}

View file

@ -1617,8 +1617,10 @@ typedef struct rs6000_args
frontend will generate a less efficient heavyweight thunk that calls
FUNCTION instead of jumping to it. The generic approach does not support
varargs. */
#if TARGET_ELF
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
output_mi_thunk (FILE, THUNK_FNDECL, DELTA, FUNCTION)
#endif
/* TRAMPOLINE_TEMPLATE deleted */