From: fennecdjay Date: Sat, 15 Oct 2022 19:41:15 +0000 (+0200) Subject: :art: more clean X-Git-Tag: nightly~214 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=6d8201c35e0b6a647acf4914ec9fa1ea4d3c8ae1;p=gwion.git :art: more clean --- diff --git a/include/opcode.h b/include/opcode.h index 26655c39..7daf9908 100644 --- a/include/opcode.h +++ b/include/opcode.h @@ -6,7 +6,6 @@ enum { eRegPushImm2, eRegPushImm3, eRegPushImm4, - eRegPush2Imm, eRegPushMem, eRegPushMem2, eRegPushMem3, @@ -225,7 +224,6 @@ enum { #define RegPushImm2 (f_instr)eRegPushImm2 #define RegPushImm3 (f_instr)eRegPushImm3 #define RegPushImm4 (f_instr)eRegPushImm4 -#define RegPush2Imm (f_instr)eRegPush2Imm #define RegPushMem (f_instr)eRegPushMem #define RegPushMem2 (f_instr)eRegPushMem2 #define RegPushMem3 (f_instr)eRegPushMem3 @@ -475,12 +473,6 @@ ANN static inline void dump_opcodes(const VM_Code code) { gw_out(" {-M}%-14"UINT_F"{0}", instr->m_val2); gw_out("\n"); break; - case eRegPush2Imm: - gw_out("{Y}┃{0}{-}% 4lu{0}: RegPush2Imm ", j); - gw_out(" {-R}%-14p{0}", instr->m_val); - gw_out(" {-M}%-14"UINT_F"{0}", instr->m_val2); - gw_out("\n"); - break; case eRegPushMem: gw_out("{Y}┃{0}{-}% 4lu{0}: RegPushMem ", j); gw_out(" {-R}%-14"UINT_F"{0}", instr->m_val); diff --git a/opcode.txt b/opcode.txt index 07347091..9cbb9db3 100644 --- a/opcode.txt +++ b/opcode.txt @@ -3,7 +3,6 @@ RegPushImm~p~u RegPushImm2~f~u RegPushImm3~p~u RegPushImm4~p~u -RegPush2Imm~p~u RegPushMem~u~u RegPushMem2~f~u RegPushMem3~u~u diff --git a/src/vm/vm.c b/src/vm/vm.c index 9addd9ac..94925406 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -420,7 +420,7 @@ _Pragma(STRINGIFY(COMPILER diagnostic ignored UNINITIALIZED) __attribute__((hot)) void vm_prepare(const VM *vm, m_bit *prepare_code) { // lgtm [cpp/use-of-goto] static const void *dispatch[] = { - &®setimm, &®pushimm, &®pushfloat, &®pushother, &®pushaddr, &®pushtwoimm, + &®setimm, &®pushimm, &®pushfloat, &®pushother, &®pushaddr, &®pushmem, &®pushmemfloat, &®pushmemother, &®pushmemaddr, &®pushmemderef, &&pushnow, &&baseint, &&basefloat, &&baseother, &&baseaddr, &®toreg, &®toregother, &®toregother2, &®toregaddr, &®toregderef, @@ -518,11 +518,6 @@ vm_prepare(const VM *vm, m_bit *prepare_code) { // lgtm [cpp/use-of-goto] *(m_uint **)reg = &VAL; reg += SZ_INT; DISPATCH() - regpushtwoimm: - *(m_uint *)reg = VAL; - *(m_uint *)(reg + SZ_INT)= VAL2; - reg += SZ_INT*2; - DISPATCH() regpushmem: *(m_uint *)reg = *(m_uint *)(mem + IVAL); reg += SZ_INT; @@ -1281,7 +1276,7 @@ fflush(stdout); } else { static void *_dispatch[] = { - &&_regsetimm, &&_regpushimm, &&_regpushfloat, &&_regpushother, &&_regpushaddr, &&_regpushtwoimm, + &&_regsetimm, &&_regpushimm, &&_regpushfloat, &&_regpushother, &&_regpushaddr, &&_regpushmem, &&_regpushmemfloat, &&_regpushmemother, &&_regpushmemaddr, &&_regpushmemderef, &&_pushnow, &&_baseint, &&_basefloat, &&_baseother, &&_baseaddr, &&_regtoreg, &&_regtoregother, &&_regtoregother2, &&_regtoregaddr, &&_regtoregderef, @@ -1342,7 +1337,6 @@ goto *_dispatch[*(m_bit*)prepare_code]; PREPARE(regpushfloat); PREPARE(regpushother); PREPARE(regpushaddr); - PREPARE(regpushtwoimm); PREPARE(regpushmem); PREPARE(regpushmemfloat); PREPARE(regpushmemother); diff --git a/src/vm/vm_code.c b/src/vm/vm_code.c index 940b9ae3..e8602b8c 100644 --- a/src/vm/vm_code.c +++ b/src/vm/vm_code.c @@ -103,13 +103,6 @@ ANN static m_bit *tobytecode(MemPool p, const VM_Code code) { instr->m_val = next->m_val; next->opcode = eNoOp; } - } else if (instr->opcode == eRegPushImm) { - const Instr next = (Instr)vector_at(v, i+1); - if (next->opcode == eRegPushImm) { - instr->opcode = eRegPush2Imm; - instr->m_val2 = next->m_val; - next->opcode = eNoOp; - } } else if (instr->opcode == eUnroll2) { const Instr unroll = (Instr)instr->m_val; const m_uint pc = vector_find(v, (m_uint)unroll);