Fixed IMUL_RCP if divisor is a power of 2

This commit is contained in:
tevador
2019-05-04 18:00:17 +02:00
parent 197cd90e07
commit b1f1e1d6ad
5 changed files with 14 additions and 10 deletions
+2 -2
View File
@@ -435,8 +435,8 @@ namespace randomx {
} break;
CASE_REP(IMUL_RCP) {
uint32_t divisor = instr.getImm32();
if (divisor != 0) {
uint64_t divisor = instr.getImm32();
if (!isPowerOf2(divisor)) {
auto dst = instr.dst % RegistersCount;
ibc.type = InstructionType::IMUL_R;
ibc.idst = &r[dst];