aboutsummaryrefslogtreecommitdiff
path: root/src/ejit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ejit.c')
-rw-r--r--src/ejit.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ejit.c b/src/ejit.c
index 2040865..1fcae9d 100644
--- a/src/ejit.c
+++ b/src/ejit.c
@@ -199,6 +199,11 @@ void ejit_addr_f(struct ejit_func *s, struct ejit_fpr r0, struct ejit_fpr r1, st
emit_insn_r(s, ADDR_F, r0.f, r1.f, r2.f);
}
+void ejit_addi(struct ejit_func *s, struct ejit_gpr r0, struct ejit_gpr r1, long o)
+{
+ emit_insn_i(s, ADDI, r0.r, r1.r, o);
+}
+
void ejit_subr(struct ejit_func *s, struct ejit_gpr r0, struct ejit_gpr r1, struct ejit_gpr r2)
{
emit_insn_r(s, SUBR, r0.r, r1.r, r2.r);
@@ -209,6 +214,11 @@ void ejit_subr_f(struct ejit_func *s, struct ejit_fpr r0, struct ejit_fpr r1, st
emit_insn_r(s, SUBR_F, r0.f, r1.f, r2.f);
}
+void ejit_subi(struct ejit_func *s, struct ejit_gpr r0, struct ejit_gpr r1, long o)
+{
+ emit_insn_i(s, SUBI, r0.r, r1.r, o);
+}
+
void ejit_mulr(struct ejit_func *s, struct ejit_gpr r0, struct ejit_gpr r1, struct ejit_gpr r2)
{
emit_insn_r(s, MULR, r0.r, r1.r, r2.r);
@@ -268,6 +278,13 @@ struct ejit_reloc ejit_beqi(struct ejit_func *s, struct ejit_gpr r0, long o)
return (struct ejit_reloc){.insn = addr};
}
+struct ejit_reloc ejit_bgti(struct ejit_func *s, struct ejit_gpr r0, long o)
+{
+ size_t addr = vec_len(&s->insns);
+ emit_insn_i(s, BGTI, 0, r0.r, o);
+ return (struct ejit_reloc){.insn = addr};
+}
+
struct ejit_reloc ejit_jmp(struct ejit_func *s)
{
size_t addr = vec_len(&s->insns);