ia64: The clz instruction is optional - 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_ia64.c
diff options
context:
space:
mode:
authorpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2023年02月17日 11:55:21 -0300
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2023年02月17日 11:55:21 -0300
commit2bcbc50e1cb795b9379a69e84374bf705ab12ef5 (patch)
tree33cc321cb0c8e2d9efebb7c5eff8f25713870bdb /lib/jit_ia64.c
parent516dfc1743d4bce3a09c1594fc0adfc2ee5308a3 (diff)
downloadlightning-2bcbc50e1cb795b9379a69e84374bf705ab12ef5.tar.gz
ia64: The clz instruction is optional
Add assembly code to test for the clz instruction feature and correct call to the fallback_cto to reduce generated code size. Also increment default JIT_INSTR_MAX to avoid crashes due to out of bounds write in "make get_jit_size".
Diffstat (limited to 'lib/jit_ia64.c')
-rw-r--r--lib/jit_ia64.c 6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/jit_ia64.c b/lib/jit_ia64.c
index 7ee1bd1..90915a2 100644
--- a/lib/jit_ia64.c
+++ b/lib/jit_ia64.c
@@ -58,6 +58,7 @@ extern void __clear_cache(void *, void *);
/*
* Initialization
*/
+jit_cpu_t jit_cpu;
jit_register_t _rvs[] = {
/* Always 0 */
{ 0, "r0" },
@@ -239,6 +240,11 @@ jit_register_t _rvs[] = {
void
jit_get_cpu(void)
{
+ jit_word_t clz = -1;
+ __asm__ volatile("tf.nz.unc p6,p7=32;(p6)mov %0=1;(p7)mov %0=0"
+ : "=r" (clz));
+ assert(clz == 0 || clz == 1);
+ jit_cpu.clz = clz;
}
void
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月20日 05:01:56 +0000

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