From 141e2991619719b590cf0864964950dca4d3a51f Mon Sep 17 00:00:00 2001 From: degasus Date: Thu, 25 Feb 2016 08:52:26 +0100 Subject: [PATCH] JitArm64: Track single precision in fctiwzx. --- .../PowerPC/JitArm64/JitArm64_FloatingPoint.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp index 4e4dcf6729..d38a959a8f 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp @@ -278,7 +278,9 @@ void JitArm64::fctiwzx(UGeckoInstruction inst) u32 b = inst.FB, d = inst.FD; - ARM64Reg VB = fpr.R(b, REG_LOWER_PAIR); + bool single = fpr.IsSingle(b, true); + + ARM64Reg VB = fpr.R(b, single ? REG_LOWER_PAIR_SINGLE : REG_LOWER_PAIR); ARM64Reg VD = fpr.RW(d); ARM64Reg V0 = fpr.GetReg(); @@ -287,8 +289,15 @@ void JitArm64::fctiwzx(UGeckoInstruction inst) m_float_emit.MOVI(64, EncodeRegToDouble(V0), 0xFFFF000000000000ULL); m_float_emit.BIC(16, EncodeRegToDouble(V0), 0x7); - m_float_emit.FCVT(32, 64, EncodeRegToDouble(VD), EncodeRegToDouble(VB)); - m_float_emit.FCVTS(EncodeRegToSingle(VD), EncodeRegToSingle(VD), ROUND_Z); + if (single) + { + m_float_emit.FCVTS(EncodeRegToSingle(VD), EncodeRegToSingle(VB), ROUND_Z); + } + else + { + m_float_emit.FCVT(32, 64, EncodeRegToDouble(VD), EncodeRegToDouble(VB)); + m_float_emit.FCVTS(EncodeRegToSingle(VD), EncodeRegToSingle(VD), ROUND_Z); + } m_float_emit.ORR(EncodeRegToDouble(VD), EncodeRegToDouble(VD), EncodeRegToDouble(V0)); fpr.Unlock(V0); }