aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-06-26 21:51:15 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-06-26 21:51:15 +0300
commit827dec28e4c0b1c4972f1419e0ac23e4dbd9d916 (patch)
treeac2c01e1b0b7acdf8ce06823e416a49e19257aa5 /include
parent3bf4d1ada6df5c74aac2a371d5f1e05fd55b4f02 (diff)
downloadejit-827dec28e4c0b1c4972f1419e0ac23e4dbd9d916.tar.gz
ejit-827dec28e4c0b1c4972f1419e0ac23e4dbd9d916.zip
enough functionality to implement posthaste
Diffstat (limited to 'include')
-rw-r--r--include/ejit/ejit.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/ejit/ejit.h b/include/ejit/ejit.h
index ee3f466..3063ceb 100644
--- a/include/ejit/ejit.h
+++ b/include/ejit/ejit.h
@@ -112,8 +112,6 @@ static inline struct ejit_arg ejit_build_arg_f(enum ejit_type type, double x)
return a;
}
-#define EJIT_C(x) ((struct ejit_arg){.c = (int8_t)(x), .type = EJIT_INT8})
-
/* register allocator could be just pushing everything above V0 or whatever onto
* the stack, heh */
struct ejit_gpr {
@@ -160,6 +158,8 @@ void ejit_destroy_func(struct ejit_func *s);
#define EJIT_GPR(x) ((struct ejit_gpr){.r = (x)})
#define EJIT_FPR(x) ((struct ejit_fpr){.f = (x)})
+#define EJIT_ARG_POINTER(x) ((struct ejit_arg){.p = (x), .type = EJIT_POINTER})
+
#define EJIT_OPERAND_GPR(x, t) ((struct ejit_operand){ .kind = EJIT_OPERAND_GPR, .r = (long)(x), .type = (t)})
#define EJIT_OPERAND_FPR(x, t) ((struct ejit_operand){ .kind = EJIT_OPERAND_FPR, .r = (long)(x) .type =(t)})
#define EJIT_OPERAND_IMM(x, t) ((struct ejit_operand){ .kind = EJIT_OPERAND_IMM, .r = (long)(x), .type = (t)})
@@ -259,6 +259,7 @@ void ejit_ltr(struct ejit_func *s, struct ejit_gpr r0, struct ejit_gpr r1, struc
struct ejit_reloc ejit_bltr(struct ejit_func *s, struct ejit_gpr r0, struct ejit_gpr r1);
struct ejit_reloc ejit_bnei(struct ejit_func *s, struct ejit_gpr r0, long o);
+struct ejit_reloc ejit_beqi(struct ejit_func *s, struct ejit_gpr r0, long o);
struct ejit_reloc ejit_jmp(struct ejit_func *s);
void ejit_patch(struct ejit_func *s, struct ejit_reloc r, struct ejit_label l);