lightning.git - Portable just-in-time compiler library

index : lightning.git
Portable just-in-time compiler library
summary refs log tree commit diff
path: root/lib/jit_arm.c
diff options
context:
space:
mode:
authorpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2023年02月04日 08:44:22 -0300
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2023年02月04日 08:44:22 -0300
commitb4e5fd9cbcbaec3cd9356ae804dd8fdc20253f7d (patch)
tree08d40cfec64610303116419cad24f29f7b24bb87 /lib/jit_arm.c
parentf527fd3cc78307ce12206f71cf7a1d3fbc7a45a0 (diff)
downloadlightning-b4e5fd9cbcbaec3cd9356ae804dd8fdc20253f7d.tar.gz
arm: make some hardcode values runtime configurable
These are undocumented, but allow running (untested) optimizations that should be available in modern arm environments. These are: o jit_cpu.exchange: If set to zero, will not use indirection for function calls to switch from arm to thumb mode. This is a global flag and only meaningful if generating thumb instructions (default) if available. o jit_cpu.version and jit_cpu.extend: If jit_cpu.version is >= 7 and jit_cpu.extend is 1, it will generate thumb integer divide instructions. Only meaningful for thumb mode. Note that modulo (or rem as called in lightning) still uses a C function call.
Diffstat (limited to 'lib/jit_arm.c')
-rw-r--r--lib/jit_arm.c 10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/jit_arm.c b/lib/jit_arm.c
index 47246d8..478f9b7 100644
--- a/lib/jit_arm.c
+++ b/lib/jit_arm.c
@@ -44,7 +44,7 @@
* arm mode, what may cause a crash upon return of that function
* if generating jit for a relative jump.
*/
-#define jit_exchange_p() 1
+#define jit_exchange_p() jit_cpu.exchange
/* FIXME is it really required to not touch _R10? */
@@ -225,6 +225,14 @@ jit_get_cpu(void)
/* armv6t2 todo (software float and thumb2) */
if (!jit_cpu.vfp && jit_cpu.thumb)
jit_cpu.thumb = 0;
+ /* FIXME need test environments for the below. For the moment just
+ * be very conservative */
+ /* force generation of code assuming jit and function libraries called
+ * instruction set do not match */
+ jit_cpu.exchange = 1;
+ /* do not generate hardware integer division by default */
+ if (jit_cpu.version == 7)
+ jit_cpu.extend = 0;
}
void
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月18日 07:21:26 +0000

AltStyle によって変換されたページ (->オリジナル) /