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-cpu.c
diff options
context:
space:
mode:
authorpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2022年11月03日 17:19:36 -0300
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2022年11月03日 17:19:36 -0300
commit13a09c7c1829dcc4dd66f7e0a966b85546098719 (patch)
tree3036d1a5fe18e017907bd8ab63c18032e019f0a2 /lib/jit_ia64-cpu.c
parent9f1702ae79f8aa28b0b145e0ac9562e91b8cf5fd (diff)
downloadlightning-13a09c7c1829dcc4dd66f7e0a966b85546098719.tar.gz
Update for ia64 before new release
Avoid assertion in jit_code_skip implementation and use short jumps when applicable. There are no short calls, only optimized movi, as all calls are done with a pointer in a register. Movi can only be optimized when the value is known.
Diffstat (limited to 'lib/jit_ia64-cpu.c')
-rw-r--r--lib/jit_ia64-cpu.c 16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/jit_ia64-cpu.c b/lib/jit_ia64-cpu.c
index 068bc07..30986e9 100644
--- a/lib/jit_ia64-cpu.c
+++ b/lib/jit_ia64-cpu.c
@@ -1500,7 +1500,7 @@ static void _stxi_l(jit_state_t*,jit_word_t,jit_int32_t,jit_int32_t);
#define jmpr(r0) _jmpr(_jit,r0)
static void _jmpr(jit_state_t*,jit_int32_t);
#define jmpi(i0) _jmpi(_jit,i0)
-static void _jmpi(jit_state_t*,jit_word_t);
+static jit_word_t _jmpi(jit_state_t*,jit_word_t);
#define jmpi_p(i0) _jmpi_p(_jit,i0)
static jit_word_t _jmpi_p(jit_state_t*,jit_word_t);
#define callr(r0) _callr(_jit,r0)
@@ -5145,16 +5145,18 @@ _jmpr(jit_state_t *_jit, jit_int32_t r0)
BR(BR_6);
}
-static void
+static jit_word_t
_jmpi(jit_state_t *_jit, jit_word_t i0)
{
- jit_word_t d;
+ jit_word_t d, w;
sync();
- d = ((jit_word_t)i0 - _jit->pc.w) >> 4;
+ w = _jit->pc.w;
+ d = ((jit_word_t)i0 - w) >> 4;
if (d >= -16777216 && d <= 16777215)
BRI(d);
else
BRL(d);
+ return (w);
}
static jit_word_t
@@ -5400,14 +5402,16 @@ _patch_at(jit_state_t *_jit, jit_code_t code,
i1 = (ic >> 61) & 0x1L;
i41 = (ic >> 22) & 0x1ffffffffffL;
i20 = ic & 0xfffffL;
- assert((tm & ~1) == TM_M_L_X_ &&
+ if (!((tm & ~1) == TM_M_L_X_ &&
(s2 & 0xfL<<37) == (0xcL<<37) &&
- s0 == nop_m);
+ s0 == nop_m))
+ goto short_jump;
s1 = i41;
s2 &= (0xcL<<37)|(0x7L<<33)|(1L<<12);
s2 |= (i1<<36)|(i20<<13);
break;
default:
+ short_jump:
/* Only B1 in slot 0 expected due to need to either
* a stop to update predicates, or a sync before
* unconditional short branch */
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月18日 15:09:57 +0000

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