Commit 42820a49 by Michael Meissner Committed by Michael Meissner

Make ASM_OUTPUT_MI_THUNK ELF only for now and always use jump

From-SVN: r22628
parent 8ff0c1af
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> Mon Sep 28 14:24:03 1998 Mark Mitchell <mark@markmitchell.com>
* tree.h (TYPE_BINFO): Document. * tree.h (TYPE_BINFO): Document.
......
...@@ -4557,6 +4557,15 @@ output_mi_thunk (file, thunk_fndecl, delta, function) ...@@ -4557,6 +4557,15 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
Otherwise, load up its address and jump to it. */ Otherwise, load up its address and jump to it. */
fname = XSTR (XEXP (DECL_RTL (function), 0), 0); 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) if (TREE_ASM_WRITTEN (function)
&& !lookup_attribute ("longcall", TYPE_ATTRIBUTES (TREE_TYPE (function)))) && !lookup_attribute ("longcall", TYPE_ATTRIBUTES (TREE_TYPE (function))))
{ {
...@@ -4620,6 +4629,8 @@ output_mi_thunk (file, thunk_fndecl, delta, function) ...@@ -4620,6 +4629,8 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
asm_fprintf (file, "\t{l|lwz} %s,", r0); asm_fprintf (file, "\t{l|lwz} %s,", r0);
assemble_name (file, fname); assemble_name (file, fname);
asm_fprintf (file, "@got(%s)\n", r12); asm_fprintf (file, "@got(%s)\n", r12);
asm_fprintf (file, "\tmtctr %s\n", r0);
asm_fprintf (file, "\tbctr\n");
} }
#if TARGET_ELF #if TARGET_ELF
else if (flag_pic > 1 || TARGET_RELOCATABLE) else if (flag_pic > 1 || TARGET_RELOCATABLE)
...@@ -4635,6 +4646,8 @@ output_mi_thunk (file, thunk_fndecl, delta, function) ...@@ -4635,6 +4646,8 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
asm_fprintf (file, "(%s)\n", r12); asm_fprintf (file, "(%s)\n", r12);
asm_fprintf (file, "\t{l|lwz} %s,4(%s)\n", r12, sp); asm_fprintf (file, "\t{l|lwz} %s,4(%s)\n", r12, sp);
asm_fprintf (file, "\tmtlr %s\n", r12); 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); asm_fprintf (file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);
assemble_name (file, buf); assemble_name (file, buf);
fputs (" = .-.LCTOC1\n", file); fputs (" = .-.LCTOC1\n", file);
...@@ -4642,22 +4655,24 @@ output_mi_thunk (file, thunk_fndecl, delta, function) ...@@ -4642,22 +4655,24 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
assemble_name (file, fname); assemble_name (file, fname);
fputs ("\n\t.previous\n", file); fputs ("\n\t.previous\n", file);
} }
#endif #endif /* TARGET_ELF */
else else
{ {
asm_fprintf (file, "\t{liu|lis} %s,", r0); asm_fprintf (file, "\t{liu|lis} %s,", r12);
assemble_name (file, fname); assemble_name (file, fname);
asm_fprintf (file, "@ha\n"); 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); 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; break;
} }
} }
#endif /* #if 0 out code to use bctr for far away jumps */
} }
......
...@@ -1617,8 +1617,10 @@ typedef struct rs6000_args ...@@ -1617,8 +1617,10 @@ typedef struct rs6000_args
frontend will generate a less efficient heavyweight thunk that calls frontend will generate a less efficient heavyweight thunk that calls
FUNCTION instead of jumping to it. The generic approach does not support FUNCTION instead of jumping to it. The generic approach does not support
varargs. */ varargs. */
#if TARGET_ELF
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ #define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
output_mi_thunk (FILE, THUNK_FNDECL, DELTA, FUNCTION) output_mi_thunk (FILE, THUNK_FNDECL, DELTA, FUNCTION)
#endif
/* TRAMPOLINE_TEMPLATE deleted */ /* TRAMPOLINE_TEMPLATE deleted */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment