JitArm64: Read X1 instead of X3 in frsqrte denormal path

If we hit the denormal path, the sign and exponent are guaranteed to be
0, which means X1 and X3 have the same value.
This commit is contained in:
JosJuice 2023-10-11 20:54:17 +02:00
parent 9807cf0b82
commit 9b21046dfc

View File

@ -327,11 +327,10 @@ void JitArm64::GenerateFrsqrte()
CMP(ARM64Reg::X2, ARM64Reg::X3);
FixupBranch nan_or_inf = B(CCFlags::CC_EQ);
FixupBranch negative = TBNZ(ARM64Reg::X1, 63);
AND(ARM64Reg::X3, ARM64Reg::X1, LogicalImm(Common::DOUBLE_FRAC, 64));
FixupBranch normal = CBNZ(ARM64Reg::X2);
// "Normalize" denormal values
CLZ(ARM64Reg::X3, ARM64Reg::X3);
CLZ(ARM64Reg::X3, ARM64Reg::X1);
MOVI2R(ARM64Reg::X2, 12);
LSLV(ARM64Reg::X1, ARM64Reg::X1, ARM64Reg::X3);
LSR(ARM64Reg::X1, ARM64Reg::X1, 11);