aboutsummaryrefslogtreecommitdiff
path: root/ops/common.h
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-09-07 21:25:36 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-09-07 21:25:36 +0300
commit23db5514bf626801c8e752f12171eb45d2598946 (patch)
tree8a5fbd619ddb4d5c22b6c6fb1c1027c1fd2e7af4 /ops/common.h
parent4d8fdd4288cc3ca5e0a2bd6ac80b725c2ee52118 (diff)
downloadcopyjit-23db5514bf626801c8e752f12171eb45d2598946.tar.gz
copyjit-23db5514bf626801c8e752f12171eb45d2598946.zip
allow fibonacci in jit-comparison
Diffstat (limited to 'ops/common.h')
-rw-r--r--ops/common.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/ops/common.h b/ops/common.h
index 6d3119a..d283651 100644
--- a/ops/common.h
+++ b/ops/common.h
@@ -18,8 +18,10 @@ typedef reg_t (*op_call)(reg_t *sp, reg_t a, reg_t x, reg_t y, reg_t o);
return CALL(target, sp, a, x, y, o);
#define BRANCH(target, cond, sp, a, x, y, o) \
- return ((op_call)((cond) ? (void *)(target) : (void *)&__next_op)) \
- ((sp), (a), (x), (y), (o)); \
+ do {\
+ if (cond) {JUMP(target, sp, a, x, y, o);}\
+ else {NEXT_OP(sp, a, x, y, o);}\
+ } while (0)
#define DEFINE_OP(name) reg_t _op(reg_t *sp, reg_t a, reg_t x, reg_t y, reg_t o)