From 2bcbc50e1cb795b9379a69e84374bf705ab12ef5 Mon Sep 17 00:00:00 2001 From: pcpa Date: 2023年2月17日 11:55:21 -0300 Subject: 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". --- lib/jit_ia64.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/jit_ia64.c') 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 -- cgit v1.2.3

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