From 4ac52cf0535e0b007b8a844292984a8f450f5fef Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 20 Apr 2024 11:30:06 +0200 Subject: [PATCH] JitArm64: Minor mtfsfix optimization BFI takes two cycles on many CPUs, whereas AND (immediate) only takes one. --- Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp index fe61d9cd29..3cbd0e6de4 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp @@ -896,7 +896,8 @@ void JitArm64::mtfsfix(UGeckoInstruction inst) } else if (imm == 0x0) { - BFI(WA, ARM64Reg::WZR, shift, 4); + const u32 inverted_mask = ~mask; + AND(WA, WA, LogicalImm(inverted_mask, GPRSize::B32)); } else {