mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-11 07:03:33 +02:00
x86jit: Small Clz codesize optimization.
This commit is contained in:
@@ -160,11 +160,11 @@ void X64JitBackend::CompIR_Bits(IRInst inst) {
|
||||
if (cpu_info.bLZCNT) {
|
||||
LZCNT(32, regs_.RX(inst.dest), regs_.R(inst.src1));
|
||||
} else {
|
||||
BSR(32, SCRATCH1, regs_.R(inst.src1));
|
||||
BSR(32, regs_.RX(inst.dest), regs_.R(inst.src1));
|
||||
FixupBranch notFound = J_CC(CC_Z);
|
||||
|
||||
MOV(32, regs_.R(inst.dest), Imm32(31));
|
||||
SUB(32, regs_.R(inst.dest), R(SCRATCH1));
|
||||
// Since one of these bits must be set, and none outside, this subtracts from 31.
|
||||
XOR(32, regs_.R(inst.dest), Imm8(31));
|
||||
FixupBranch skip = J();
|
||||
|
||||
SetJumpTarget(notFound);
|
||||
|
||||
Reference in New Issue
Block a user