From 322c7fba3d2f4c9b5b0d78b44feefd38ae44d017 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 29 Jun 2024 18:00:51 +0300 Subject: continue working through bytecode ops --- src/interp.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/interp.c') diff --git a/src/interp.c b/src/interp.c index 3395537..059b1d3 100644 --- a/src/interp.c +++ b/src/interp.c @@ -26,6 +26,9 @@ union interp_ret ejit_interp(struct ejit_func *f, size_t argc, [MULR] = &&MULR, [DIVR] = &&DIVR, + [ANDR] = &&ANDR, + [ANDI] = &&ANDI, + [EQR] = &&EQR, [LTR] = &<R, @@ -34,6 +37,7 @@ union interp_ret ejit_interp(struct ejit_func *f, size_t argc, [BLTR] = &&BLTR, [BNEI] = &&BNEI, + [BEQR] = &&BEQR, [BEQI] = &&BEQI, [BGTI] = &&BGTI, @@ -146,6 +150,14 @@ union interp_ret ejit_interp(struct ejit_func *f, size_t argc, gpr[i.r0] = gpr[i.r1] / gpr[i.r2]; DISPATCH(); + DO(ANDR); + gpr[i.r0] = gpr[i.r1] & gpr[i.r2]; + DISPATCH(); + + DO(ANDI); + gpr[i.r0] = gpr[i.r1] & i.o; + DISPATCH(); + DO(EQR); gpr[i.r0] = gpr[i.r1] == gpr[i.r2]; DISPATCH(); @@ -176,6 +188,12 @@ union interp_ret ejit_interp(struct ejit_func *f, size_t argc, DISPATCH(); + DO(BEQR); + if (gpr[i.r1] == gpr[i.r2]) + JUMP(i.r0); + + DISPATCH(); + DO(BEQI); if (gpr[i.r1] == i.o) JUMP(i.r0); -- cgit v1.2.3