From 97b664968e8150ee7dd91f7f51b4a67ac55854cb Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 19 May 2017 10:26:51 +0200 Subject: [PATCH] - removed a few unused VM opcodes. --- src/scripting/vm/vmexec.cpp | 8 -------- src/scripting/vm/vmexec.h | 22 ---------------------- src/scripting/vm/vmops.h | 5 ----- 3 files changed, 35 deletions(-) diff --git a/src/scripting/vm/vmexec.cpp b/src/scripting/vm/vmexec.cpp index 0bad8c055..eb212a646 100644 --- a/src/scripting/vm/vmexec.cpp +++ b/src/scripting/vm/vmexec.cpp @@ -104,14 +104,6 @@ void ThrowVMException(VMException *x); if (a == NULL) { ThrowAbortException(x, nullptr); } \ ptr = (VM_SBYTE *)a + o -static const VM_UWORD ZapTable[16] = -{ - 0x00000000, 0x000000FF, 0x0000FF00, 0x0000FFFF, - 0x00FF0000, 0x00FF00FF, 0x00FFFF00, 0x00FFFFFF, - 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFF00FFFF, - 0xFFFF0000, 0xFFFF00FF, 0xFFFFFF00, 0xFFFFFFFF -}; - #ifdef NDEBUG #define WAS_NDEBUG 1 #else diff --git a/src/scripting/vm/vmexec.h b/src/scripting/vm/vmexec.h index 452414c99..7e8a53a6a 100644 --- a/src/scripting/vm/vmexec.h +++ b/src/scripting/vm/vmexec.h @@ -1195,28 +1195,6 @@ static int Exec(VMFrameStack *stack, const VMOP *pc, VMReturn *ret, int numret) reg.d[a] = ~reg.d[B]; NEXTOP; - OP(SEXT): - ASSERTD(a); ASSERTD(B); - reg.d[a] = (VM_SWORD)(reg.d[B] << C) >> C; - NEXTOP; - - OP(ZAP_R): - ASSERTD(a); ASSERTD(B); ASSERTD(C); - reg.d[a] = reg.d[B] & ZapTable[(reg.d[C] & 15) ^ 15]; - NEXTOP; - OP(ZAP_I): - ASSERTD(a); ASSERTD(B); - reg.d[a] = reg.d[B] & ZapTable[(C & 15) ^ 15]; - NEXTOP; - OP(ZAPNOT_R): - ASSERTD(a); ASSERTD(B); ASSERTD(C); - reg.d[a] = reg.d[B] & ZapTable[reg.d[C] & 15]; - NEXTOP; - OP(ZAPNOT_I): - ASSERTD(a); ASSERTD(B); - reg.d[a] = reg.d[B] & ZapTable[C & 15]; - NEXTOP; - OP(EQ_R): ASSERTD(B); ASSERTD(C); CMPJMP(reg.d[B] == reg.d[C]); diff --git a/src/scripting/vm/vmops.h b/src/scripting/vm/vmops.h index dac907580..fb0a9e50e 100644 --- a/src/scripting/vm/vmops.h +++ b/src/scripting/vm/vmops.h @@ -174,11 +174,6 @@ xx(MAX_RK, max, RIRIKI, MAX_RR, 4, REGT_INT), xx(ABS, abs, RIRI, NOP, 0, 0), // dA = abs(dB) xx(NEG, neg, RIRI, NOP, 0, 0), // dA = -dB xx(NOT, not, RIRI, NOP, 0, 0), // dA = ~dB -xx(SEXT, sext, RIRII8, NOP, 0, 0), // dA = dB, sign extended by shifting left then right by C -xx(ZAP_R, zap, RIRIRI, NOP, 0, 0), // dA = dB, with bytes zeroed where bits in C/dC are one -xx(ZAP_I, zap, RIRII8, NOP, 0, 0), -xx(ZAPNOT_R, zapnot, RIRIRI, NOP, 0, 0), // dA = dB, with bytes zeroed where bits in C/dC are zero -xx(ZAPNOT_I, zapnot, RIRII8, NOP, 0, 0), xx(EQ_R, beq, CIRR, NOP, 0, 0), // if ((dB == dkC) != A) then pc++ xx(EQ_K, beq, CIRK, EQ_R, 4, REGT_INT), xx(LT_RR, blt, CIRR, NOP, 0, 0), // if ((dkB < dkC) != A) then pc++