diff --git a/public/jit/x86/assembler-x86.h b/public/jit/x86/assembler-x86.h index 276789215..974851174 100644 --- a/public/jit/x86/assembler-x86.h +++ b/public/jit/x86/assembler-x86.h @@ -538,6 +538,12 @@ class AssemblerX86 : public Assembler void imull(Register dest, Register src, int32_t imm) { imull(dest, Operand(src), imm); } + void mul(Register src) { + emit1(0xf7, 4, src.code); + } + void mul(const Operand &src) { + emit1(0xf7, 4, src); + } void testl(const Operand &op1, Register op2) { emit1(0x85, op2.code, op1); diff --git a/sourcepawn/include/smx/smx-v1-opcodes.h b/sourcepawn/include/smx/smx-v1-opcodes.h index c59017a0e..c4bff4796 100644 --- a/sourcepawn/include/smx/smx-v1-opcodes.h +++ b/sourcepawn/include/smx/smx-v1-opcodes.h @@ -143,7 +143,7 @@ namespace sp { _(SMUL, "smul") \ _(SDIV, "sdiv") \ _(SDIV_ALT, "sdiv.alt") \ - _(UNGEN_UMUL, "umul") \ + _(UMUL, "umul") \ _(UDIV, "udiv") \ _(UDIV_ALT, "udiv.alt") \ _(ADD, "add") \ diff --git a/sourcepawn/jit/x86/jit_x86.cpp b/sourcepawn/jit/x86/jit_x86.cpp index ab96118f0..9f212f3c0 100644 --- a/sourcepawn/jit/x86/jit_x86.cpp +++ b/sourcepawn/jit/x86/jit_x86.cpp @@ -598,6 +598,12 @@ Compiler::emitOp(OPCODE op) __ imull(pri, alt); break; + case OP_UMUL: + __ movl(tmp, alt); + __ mul(edx); // (edx:eax) = eax * edx + __ movl(alt, tmp); + break; + case OP_NOT: __ testl(eax, eax); __ movl(eax, 0);