diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compile/compile.c | 25 | ||||
-rw-r--r-- | src/ejit.c | 3 | ||||
-rw-r--r-- | src/interp.c | 2 |
3 files changed, 29 insertions, 1 deletions
diff --git a/src/compile/compile.c b/src/compile/compile.c index c979305..50f12dc 100644 --- a/src/compile/compile.c +++ b/src/compile/compile.c @@ -2140,6 +2140,31 @@ static size_t compile_fn_body(struct ejit_func *f, jit_state_t *j, void *arena, case JMP: compile_jmp(f, j, i, &relocs); break; + case ARG_I: { + jit_operand_t type = jit_operand_imm(JIT_OPERAND_ABI_WORD, i.r1); + jit_operand_t arg = jit_operand_imm(jit_abi_from(i.r1), i.o); + operands_append(&src, type); + operands_append(&src, arg); + operands_append(&direct, arg); + + jit_operand_t to[2] = { + jit_operand_mem(JIT_OPERAND_ABI_WORD, JIT_SP, + type_offset(i)), + jit_operand_mem(jit_abi_from(i.r1), JIT_SP, + arg_offset(i)) + }; + + operands_append(&dst, to[0]); + operands_append(&dst, to[1]); + break; + } + + case ARG_FI: { + assert(false && "immediate floats (currently?) not supported"); + abort(); + break; + } + case ARG: { size_t r2 = gpr_stats_at(&f->gpr, i.r2)->rno; jit_operand_t type = jit_operand_imm(JIT_OPERAND_ABI_WORD, i.r1); @@ -1,4 +1,5 @@ #include <assert.h> +#include <stdio.h> #include <sys/mman.h> #include <ejit/ejit.h> @@ -161,6 +162,8 @@ static void emit_insn_af(struct ejit_func *f, enum ejit_opcode op, size_t idx, e static void emit_insn_ad(struct ejit_func *f, enum ejit_opcode op, size_t idx, enum ejit_type type, double d) { + fprintf(stderr, "warning: immediate floats are currently not supported.\n" + "Consider moving values into FPRs.\n"); struct ejit_insn i = {.op = op, .r0 = idx, .r1 = type, .d = d}; insns_append(&f->insns, i); } diff --git a/src/interp.c b/src/interp.c index 80a9edc..aa40c53 100644 --- a/src/interp.c +++ b/src/interp.c @@ -1009,7 +1009,7 @@ union interp_ret ejit_run(struct ejit_func *f, size_t paramc, struct ejit_arg pa if (i.r1 == EJIT_DOUBLE) a = ejit_build_arg_f(i.r1, i.d); else - a = ejit_build_arg_f(i.r1, i.f); + a = ejit_build_arg_f(i.r1, i.d); args[argc++] = a; DISPATCH(); |