aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMichael Meissner <meissner@cygnus.com>1998-09-28 14:40:27 +0000
committerMichael Meissner <meissner@gcc.gnu.org>1998-09-28 14:40:27 +0000
commit42820a49ddba6a9dc0d9acbde04adcf23a733619 (patch)
treef923a870eb19bce1384711091b10259d07d65eb7 /gcc
parent8ff0c1af0ec1bcfb70b82e8dbd2aaddb1da2ea7c (diff)
downloadgcc-42820a49ddba6a9dc0d9acbde04adcf23a733619.zip
gcc-42820a49ddba6a9dc0d9acbde04adcf23a733619.tar.gz
gcc-42820a49ddba6a9dc0d9acbde04adcf23a733619.tar.bz2
Make ASM_OUTPUT_MI_THUNK ELF only for now and always use jump
From-SVN: r22628
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/rs6000/rs6000.c27
-rw-r--r--gcc/config/rs6000/rs6000.h2
3 files changed, 28 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d4c2f86..d452b4d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index bc307c4..f4f47ed 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -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 */
}
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 0e10ad6..1ceef95 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -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 */