summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2021-06-18 18:26:49 +0200
committerJosJuice <josjuice@gmail.com>2021-06-18 18:26:49 +0200
commitb11b5955aef3ee2d2fb5386003716f548d593328 (patch)
tree75363c7fc023348152939d0b637913efd6c98e1c /Source
parent79a610b4b49e5622129dc44041c1640555007e94 (diff)
Jit64: Optimize mcrfs when mask == 0
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp
index 8044986492..c074fdd96a 100644
--- a/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp
+++ b/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp
@@ -638,20 +638,26 @@ void Jit64::mcrfs(UGeckoInstruction inst)
// Only clear exception bits (but not FEX/VX).
mask &= FPSCR_FX | FPSCR_ANY_X;
- MOV(32, R(RSCRATCH), PPCSTATE(fpscr));
if (cpu_info.bBMI1)
{
+ MOV(32, R(RSCRATCH), PPCSTATE(fpscr));
MOV(32, R(RSCRATCH2), Imm32((4 << 8) | shift));
BEXTR(32, RSCRATCH2, R(RSCRATCH), RSCRATCH2);
}
else
{
- MOV(32, R(RSCRATCH2), R(RSCRATCH));
+ MOV(32, R(RSCRATCH2), PPCSTATE(fpscr));
+ if (mask != 0)
+ MOV(32, R(RSCRATCH), R(RSCRATCH2));
+
SHR(32, R(RSCRATCH2), Imm8(shift));
AND(32, R(RSCRATCH2), Imm32(0xF));
}
- AND(32, R(RSCRATCH), Imm32(~mask));
- MOV(32, PPCSTATE(fpscr), R(RSCRATCH));
+ if (mask != 0)
+ {
+ AND(32, R(RSCRATCH), Imm32(~mask));
+ MOV(32, PPCSTATE(fpscr), R(RSCRATCH));
+ }
LEA(64, RSCRATCH, MConst(PowerPC::ConditionRegister::s_crTable));
MOV(64, R(RSCRATCH), MComplex(RSCRATCH, RSCRATCH2, SCALE_8, 0));
MOV(64, CROffset(inst.CRFD), R(RSCRATCH));