aboutsummaryrefslogtreecommitdiff
path: root/ops
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-06-25 12:09:26 +0100
committerKimplul <kimi.h.kuparinen@gmail.com>2023-06-25 12:09:26 +0100
commitc8ebd81dfc4b8f4c1d488202d0962ac85e977b51 (patch)
tree4265b796348e8fdea95ceb4484398145231d2038 /ops
parent4a522e044886ed140cbf31f48e797edbd01cc9eb (diff)
downloadcopyjit-c8ebd81dfc4b8f4c1d488202d0962ac85e977b51.tar.gz
copyjit-c8ebd81dfc4b8f4c1d488202d0962ac85e977b51.zip
move over to linker based jumps
Diffstat (limited to 'ops')
-rw-r--r--ops/common.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/ops/common.h b/ops/common.h
index 4b41d71..8c504d3 100644
--- a/ops/common.h
+++ b/ops/common.h
@@ -9,18 +9,20 @@ typedef signed long sreg_t;
typedef void (*op_call)(reg_t *sp, reg_t a, reg_t x, reg_t y, reg_t o);
#define NEXT_OP(sp, a, x, y, o) \
- ((op_call)(&&_next_op))((sp), (a), (x), (y), (o)); _next_op: (void)1;
+ ((op_call)(&__next_op))((sp), (a), (x), (y), (o));
#define JUMP(target, sp, a, x, y, o) \
((op_call)(target))((sp), (a), (x), (y), (o));
#define BRANCH(target, cond, sp, a, x, y, o) \
- ((op_call)((cond) ? (void *)(target) : (void *)&&_next_op)) \
+ ((op_call)((cond) ? (void *)(target) : (void *)&__next_op)) \
((sp), (a), (x), (y), (o)); \
-_next_op: (void)1;
-#define DEFINE_OP(name) void name(reg_t *sp, reg_t a, reg_t x, reg_t y, reg_t o)
+#define DEFINE_OP(name) void _op(reg_t *sp, reg_t a, reg_t x, reg_t y, reg_t o)
#define UNUSED(x) (void)(x);
+#define __hidden __attribute__((visibility("hidden")))
+__hidden extern void *__next_op;
+
#endif /* OPS_COMMON_H */