JitArm64: Implement FPRF updates for fres+frsqrte
This commit is contained in:
parent
4b3fda7906
commit
e5f2dcd891
|
@ -24,8 +24,16 @@ void JitArm64::SetFPRFIfNeeded(bool single, ARM64Reg reg)
|
|||
|
||||
gpr.Lock(ARM64Reg::W0, ARM64Reg::W1, ARM64Reg::W2, ARM64Reg::W3, ARM64Reg::W4, ARM64Reg::W30);
|
||||
|
||||
reg = single ? EncodeRegToSingle(reg) : EncodeRegToDouble(reg);
|
||||
m_float_emit.FMOV(single ? ARM64Reg::W0 : ARM64Reg::X0, reg);
|
||||
const ARM64Reg routine_input_reg = single ? ARM64Reg::W0 : ARM64Reg::X0;
|
||||
if (IsVector(reg))
|
||||
{
|
||||
m_float_emit.FMOV(routine_input_reg, single ? EncodeRegToSingle(reg) : EncodeRegToDouble(reg));
|
||||
}
|
||||
else if (reg != routine_input_reg)
|
||||
{
|
||||
MOV(routine_input_reg, reg);
|
||||
}
|
||||
|
||||
BL(single ? GetAsmRoutines()->fprf_single : GetAsmRoutines()->fprf_double);
|
||||
|
||||
gpr.Unlock(ARM64Reg::W0, ARM64Reg::W1, ARM64Reg::W2, ARM64Reg::W3, ARM64Reg::W4, ARM64Reg::W30);
|
||||
|
@ -435,7 +443,6 @@ void JitArm64::fresx(UGeckoInstruction inst)
|
|||
INSTRUCTION_START
|
||||
JITDISABLE(bJITFloatingPointOff);
|
||||
FALLBACK_IF(inst.Rc);
|
||||
FALLBACK_IF(SConfig::GetInstance().bFPRF && js.op->wantsFPRF);
|
||||
|
||||
const u32 b = inst.FB;
|
||||
const u32 d = inst.FD;
|
||||
|
@ -454,6 +461,8 @@ void JitArm64::fresx(UGeckoInstruction inst)
|
|||
|
||||
const ARM64Reg VD = fpr.RW(d, RegType::Duplicated);
|
||||
m_float_emit.FMOV(EncodeRegToDouble(VD), ARM64Reg::X0);
|
||||
|
||||
SetFPRFIfNeeded(false, ARM64Reg::X0);
|
||||
}
|
||||
|
||||
void JitArm64::frsqrtex(UGeckoInstruction inst)
|
||||
|
@ -461,7 +470,6 @@ void JitArm64::frsqrtex(UGeckoInstruction inst)
|
|||
INSTRUCTION_START
|
||||
JITDISABLE(bJITFloatingPointOff);
|
||||
FALLBACK_IF(inst.Rc);
|
||||
FALLBACK_IF(SConfig::GetInstance().bFPRF && js.op->wantsFPRF);
|
||||
|
||||
const u32 b = inst.FB;
|
||||
const u32 d = inst.FD;
|
||||
|
@ -480,6 +488,8 @@ void JitArm64::frsqrtex(UGeckoInstruction inst)
|
|||
|
||||
const ARM64Reg VD = fpr.RW(d, RegType::LowerPair);
|
||||
m_float_emit.FMOV(EncodeRegToDouble(VD), ARM64Reg::X0);
|
||||
|
||||
SetFPRFIfNeeded(false, ARM64Reg::X0);
|
||||
}
|
||||
|
||||
// Since the following float conversion functions are used in non-arithmetic PPC float
|
||||
|
|
|
@ -359,7 +359,6 @@ void JitArm64::ps_res(UGeckoInstruction inst)
|
|||
INSTRUCTION_START
|
||||
JITDISABLE(bJITPairedOff);
|
||||
FALLBACK_IF(inst.Rc);
|
||||
FALLBACK_IF(SConfig::GetInstance().bFPRF && js.op->wantsFPRF);
|
||||
|
||||
const u32 b = inst.FB;
|
||||
const u32 d = inst.FD;
|
||||
|
@ -383,6 +382,8 @@ void JitArm64::ps_res(UGeckoInstruction inst)
|
|||
fpr.Unlock(ARM64Reg::Q0);
|
||||
|
||||
fpr.FixSinglePrecision(d);
|
||||
|
||||
SetFPRFIfNeeded(true, VD);
|
||||
}
|
||||
|
||||
void JitArm64::ps_rsqrte(UGeckoInstruction inst)
|
||||
|
@ -390,7 +391,6 @@ void JitArm64::ps_rsqrte(UGeckoInstruction inst)
|
|||
INSTRUCTION_START
|
||||
JITDISABLE(bJITPairedOff);
|
||||
FALLBACK_IF(inst.Rc);
|
||||
FALLBACK_IF(SConfig::GetInstance().bFPRF && js.op->wantsFPRF);
|
||||
|
||||
const u32 b = inst.FB;
|
||||
const u32 d = inst.FD;
|
||||
|
@ -414,4 +414,6 @@ void JitArm64::ps_rsqrte(UGeckoInstruction inst)
|
|||
fpr.Unlock(ARM64Reg::Q0);
|
||||
|
||||
fpr.FixSinglePrecision(d);
|
||||
|
||||
SetFPRFIfNeeded(true, VD);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue