Optimized randomx_reciprocal

Also limited it to 32 bit because it's supposed to work only with 32-bit values, according to the specs.
This commit is contained in:
SChernykh
2023-10-20 10:54:25 +02:00
parent 5fc512e71c
commit 5c49ab12a0
8 changed files with 23 additions and 42 deletions

View File

@@ -477,7 +477,7 @@ int analyze(randomx::Program& p) {
}
if (opcode < randomx::ceil_IMUL_RCP) {
uint64_t divisor = instr.getImm32();
const uint32_t divisor = instr.getImm32();
if (!randomx::isZeroOrPowerOf2(divisor)) {
instr.dst = instr.dst % randomx::RegistersCount;
instr.opcode |= DST_INT;