diff --git a/Source/Core/Common/Arm64Emitter.cpp b/Source/Core/Common/Arm64Emitter.cpp index 6f4f42c027..4dd39c4357 100644 --- a/Source/Core/Common/Arm64Emitter.cpp +++ b/Source/Core/Common/Arm64Emitter.cpp @@ -4051,14 +4051,15 @@ void ARM64XEmitter::ANDI2R(ARM64Reg Rd, ARM64Reg Rn, u64 imm, ARM64Reg scratch) imm = (imm << 32) | (imm & 0xFFFFFFFF); } - if ((~imm) == 0) - { - // Do nothing - } - else if (imm == 0) + if (imm == 0) { MOVZ(Rd, 0); } + else if ((~imm) == 0) + { + if (Rd != Rn) + MOV(Rd, Rn); + } else if (const auto result = LogicalImm(imm, GPRSize::B64)) { AND(Rd, Rn, result); @@ -4090,7 +4091,8 @@ void ARM64XEmitter::ORRI2R(ARM64Reg Rd, ARM64Reg Rn, u64 imm, ARM64Reg scratch) if (imm == 0) { - // Do nothing + if (Rd != Rn) + MOV(Rd, Rn); } else if ((~imm) == 0) { @@ -4127,7 +4129,8 @@ void ARM64XEmitter::EORI2R(ARM64Reg Rd, ARM64Reg Rn, u64 imm, ARM64Reg scratch) if (imm == 0) { - // Do nothing + if (Rd != Rn) + MOV(Rd, Rn); } else if ((~imm) == 0) {