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_loongarch.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jit_loongarch.c')
-rw-r--r--lib/jit_loongarch.c 33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/jit_loongarch.c b/lib/jit_loongarch.c
index f8853fe..1ee828a 100644
--- a/lib/jit_loongarch.c
+++ b/lib/jit_loongarch.c
@@ -46,6 +46,7 @@ static void _patch(jit_state_t*,jit_word_t,jit_node_t*);
/*
* Initialization
*/
+jit_cpu_t jit_cpu;
jit_register_t _rvs[] = {
{ rc(gpr) | 0x14, "$t8" },
{ rc(gpr) | 0x13, "$t7" },
@@ -135,6 +136,8 @@ _jit_init(jit_state_t *_jit)
{
_jitc->reglen = jit_size(_rvs) - 1;
jit_carry = _NOREG;
+ /* By default assume kernel or cpu will handle unaligned load/store */
+ jit_cpu.unaligned = 0;
}
void
@@ -1178,6 +1181,18 @@ _emit_code(jit_state_t *_jit)
case_rrw(ldx, _ui);
case_rrr(ldx, _l);
case_rrw(ldx, _l);
+ case jit_code_unldr:
+ unldr(rn(node->u.w), rn(node->v.w), node->w.w);
+ break;
+ case jit_code_unldi:
+ unldi(rn(node->u.w), node->v.w, node->w.w);
+ break;
+ case jit_code_unldr_u:
+ unldr_u(rn(node->u.w), rn(node->v.w), node->w.w);
+ break;
+ case jit_code_unldi_u:
+ unldi_u(rn(node->u.w), node->v.w, node->w.w);
+ break;
case_rr(st, _c);
case_wr(st, _c);
case_rr(st, _s);
@@ -1194,6 +1209,12 @@ _emit_code(jit_state_t *_jit)
case_wrr(stx, _i);
case_rrr(stx, _l);
case_wrr(stx, _l);
+ case jit_code_unstr:
+ unstr(rn(node->u.w), rn(node->v.w), node->w.w);
+ break;
+ case jit_code_unsti:
+ unsti(node->u.w, rn(node->v.w), node->w.w);
+ break;
case_rr(hton, _us);
case_rr(hton, _ui);
case_rr(hton, _ul);
@@ -1323,10 +1344,22 @@ _emit_code(jit_state_t *_jit)
case_rw(ld, _f);
case_rrr(ldx, _f);
case_rrw(ldx, _f);
+ case jit_code_unldr_x:
+ unldr_x(rn(node->u.w), rn(node->v.w), node->w.w);
+ break;
+ case jit_code_unldi_x:
+ unldi_x(rn(node->u.w), node->v.w, node->w.w);
+ break;
case_rr(st, _f);
case_wr(st, _f);
case_rrr(stx, _f);
case_wrr(stx, _f);
+ case jit_code_unstr_x:
+ unstr_x(rn(node->u.w), rn(node->v.w), node->w.w);
+ break;
+ case jit_code_unsti_x:
+ unsti_x(node->u.w, rn(node->v.w), node->w.w);
+ break;
case_rr(mov, _f);
case jit_code_movi_f:
assert_data(node);
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月28日 00:28:39 +0000

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