From 105ce113ecb06d477f4ebf875c7f0f1bbc3ea82e Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 10 Nov 1994 21:38:40 -0700 Subject: [PATCH] * Fast indirect call support. * 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 | 9 +++++++++ gcc/config/pa/pa.md | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index cf880aff622..36b7a8456f3 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -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}, \ diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 3bb5b073193..60459ac1577 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -3202,6 +3202,9 @@ "" "* { + 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\"; @@ -3290,6 +3293,9 @@ "" "* { + 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\"; -- 2.30.2