* Fast indirect call support.
authorJeff Law <law@gcc.gnu.org>
Fri, 11 Nov 1994 04:38:40 +0000 (21:38 -0700)
committerJeff Law <law@gcc.gnu.org>
Fri, 11 Nov 1994 04:38:40 +0000 (21:38 -0700)
* pa.h (TARGET_FAST_INDIRECT_CALLS): New target switch.
(TARGET_SWITCHES): Add "fast-indirect-calls" and inverse.
* pa.md (call_internal_reg, call_value_internal_reg): Generate
appropriate code for TARGET_FAST_INDIRECT_CALLS.

From-SVN: r8420

gcc/config/pa/pa.h
gcc/config/pa/pa.md

index cf880af..36b7a84 100644 (file)
@@ -47,6 +47,13 @@ extern int target_flags;
 
 #define TARGET_DISABLE_FPREGS (target_flags & 2)
 
+/* Generate code which assumes that calls through function pointers will
+   never cross a space boundary.  Such assumptions are generally safe for
+   building kernels and statically linked executables.  Code compiled with
+   this option will fail miserably if the executable is dynamically linked
+   or uses nested functions!  */
+#define TARGET_FAST_INDIRECT_CALLS (target_flags & 4)
+
 /* Allow unconditional jumps in the delay slots of call instructions.  */
 #define TARGET_JUMP_IN_DELAY (target_flags & 8)
 
@@ -89,6 +96,8 @@ extern int target_flags;
    {"pa-risc-1-1", 1},         \
    {"disable-fpregs", 2},      \
    {"no-disable-fpregs", 2},   \
+   {"fast-indirect-calls", 4}, \
+   {"no-fast-indirect-calls", -4},\
    {"jump-in-delay", 8},       \
    {"no-jump-in-delay", -8},   \
    {"long-calls", 16},         \
index 3bb5b07..60459ac 100644 (file)
   ""
   "*
 {
+  if (TARGET_FAST_INDIRECT_CALLS)
+    return \"blr 0,%%r2\;bv,n 0(%r0)\;ldo 4(%%r2),%%r2\";
+
   /* Yuk!  bl may not be able to reach $$dyncall.  */
   if (TARGET_LONG_CALLS)
     return \"copy %r0,%%r22\;ldil L%%$$dyncall,%%r31\;ldo R%%$$dyncall(%%r31),%%r31\;blr 0,%%r2\;bv,n 0(%%r31)\;nop\";
   ""
   "*
 {
+  if (TARGET_FAST_INDIRECT_CALLS)
+    return \"blr 0,%%r2\;bv,n 0(%r1)\;ldo 4(%%r2),%%r2\";
+
   /* Yuk!  bl may not be able to reach $$dyncall.  */
   if (TARGET_LONG_CALLS)
     return \"copy %r1,%%r22\;ldil L%%$$dyncall,%%r31\;ldo R%%$$dyncall(%%r31),%%r31\;blr 0,%%r2\;bv,n 0(%%r31)\;nop\";