mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 06:39:14 +01:00
Arm64Emitter: Don't optimize ADD to MOV for SP
Unlike ADD (immediate), MOV (register) treats SP as ZR. Therefore the ADDI2R optimization that was added in 67791d227c can't optimize ADD to MOV when exactly one of the registers is SP. There currently isn't any code in Dolphin that calls ADDI2R with parameters that would trigger this case.
This commit is contained in:
parent
9240f579ea
commit
b5c5371848
@ -4222,9 +4222,15 @@ void ARM64XEmitter::ADDI2R_internal(ARM64Reg Rd, ARM64Reg Rn, u64 imm, bool nega
|
|||||||
// Special path for zeroes
|
// Special path for zeroes
|
||||||
if (imm == 0 && !flags)
|
if (imm == 0 && !flags)
|
||||||
{
|
{
|
||||||
if (Rd != Rn)
|
if (Rd == Rn)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (DecodeReg(Rd) != DecodeReg(ARM64Reg::SP) && DecodeReg(Rn) != DecodeReg(ARM64Reg::SP))
|
||||||
|
{
|
||||||
MOV(Rd, Rn);
|
MOV(Rd, Rn);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regular fast paths, aarch64 immediate instructions
|
// Regular fast paths, aarch64 immediate instructions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user