From ccd4eca1701392facf989474f6fd43e440737bdc Mon Sep 17 00:00:00 2001 From: Shaw Summa Date: Sun, 15 Oct 2023 15:37:53 -0400 Subject: [PATCH] push --- tb/src/x64/x64_emitter.h | 9 ++++++++- vm/jit/tb.c | 3 ++- vm/obj.h | 1 - 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tb/src/x64/x64_emitter.h b/tb/src/x64/x64_emitter.h index 3dafbbde..f2748c9f 100644 --- a/tb/src/x64/x64_emitter.h +++ b/tb/src/x64/x64_emitter.h @@ -142,7 +142,14 @@ static void inst2(TB_CGEmitter* restrict e, InstType type, const Val* a, const V if (type == MOVABS) { assert(a->type == VAL_GPR && b->type == VAL_ABS); - EMIT1(e, rex(true, a->reg, 0, 0)); + // if (a->reg < 8) { + // EMIT1(e, 0x48); + // } else { + // EMIT1(e, 0x49); + // } + + EMIT1(e, rex(true, 0, a->reg, 0)); + EMIT1(e, inst->op + (a->reg & 0b111)); EMIT8(e, b->abs); return; diff --git a/vm/jit/tb.c b/vm/jit/tb.c index 5f9c70f2..771ecd6a 100644 --- a/vm/jit/tb.c +++ b/vm/jit/tb.c @@ -267,7 +267,7 @@ TB_Node *vm_tb_func_body(vm_tb_state_t *state, TB_Module *module, TB_Function* f TB_MultiOutput multi = tb_inst_call( fun, comp_proto, - tb_inst_uint(fun, TB_TYPE_PTR, (uint64_t) &vm_tb_func_comp), + tb_inst_uint(fun, TB_TYPE_PTR, (uint64_t) &vm_tb_rfunc_comp), 2, comp_params ); @@ -619,6 +619,7 @@ void *vm_tb_func_comp(vm_tb_state_t *state, vm_block_t *block) { vm_tb_func_body_once(state, module, fun, args, block); TB_Passes *passes = tb_pass_enter(fun, tb_function_get_arena(fun)); + tb_pass_optimize(passes); fprintf(stdout, "\n--- tb ---\n"); tb_pass_print(passes); diff --git a/vm/obj.h b/vm/obj.h index 3e92e25d..6ccc6ae2 100644 --- a/vm/obj.h +++ b/vm/obj.h @@ -23,7 +23,6 @@ union vm_value_t { }; struct vm_pair_t { - uint8_t buf[256]; vm_value_t key_val; vm_value_t val_val; uint32_t key_tag;