From 1b6d9dfc4e976f7e34e0133f8a4f339375770394 Mon Sep 17 00:00:00 2001 From: degasus Date: Thu, 11 Feb 2016 00:09:04 +0100 Subject: [PATCH] JitArm64: Merge ps_maddsX. --- Source/Core/Core/PowerPC/JitArm64/Jit.h | 3 +-- .../Core/PowerPC/JitArm64/JitArm64_Paired.cpp | 27 +++---------------- .../Core/PowerPC/JitArm64/JitArm64_Tables.cpp | 4 +-- 3 files changed, 6 insertions(+), 28 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.h b/Source/Core/Core/PowerPC/JitArm64/Jit.h index 3c70a716ae..7e7ff5ad38 100644 --- a/Source/Core/Core/PowerPC/JitArm64/Jit.h +++ b/Source/Core/Core/PowerPC/JitArm64/Jit.h @@ -150,8 +150,7 @@ public: // Paired void ps_abs(UGeckoInstruction inst); void ps_madd(UGeckoInstruction inst); - void ps_madds0(UGeckoInstruction inst); - void ps_madds1(UGeckoInstruction inst); + void ps_maddsX(UGeckoInstruction inst); void ps_merge00(UGeckoInstruction inst); void ps_merge01(UGeckoInstruction inst); void ps_merge10(UGeckoInstruction inst); diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Paired.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Paired.cpp index fc84d0d451..4688231677 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Paired.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Paired.cpp @@ -53,7 +53,7 @@ void JitArm64::ps_madd(UGeckoInstruction inst) fpr.Unlock(V0); } -void JitArm64::ps_madds0(UGeckoInstruction inst) +void JitArm64::ps_maddsX(UGeckoInstruction inst) { INSTRUCTION_START JITDISABLE(bJITPairedOff); @@ -62,28 +62,7 @@ void JitArm64::ps_madds0(UGeckoInstruction inst) u32 a = inst.FA, b = inst.FB, c = inst.FC, d = inst.FD; - ARM64Reg VA = fpr.R(a, REG_REG); - ARM64Reg VB = fpr.R(b, REG_REG); - ARM64Reg VC = fpr.R(c, REG_REG); - ARM64Reg VD = fpr.RW(d, REG_REG); - ARM64Reg V0 = fpr.GetReg(); - - m_float_emit.DUP(64, V0, VC, 0); - m_float_emit.FMUL(64, V0, V0, VA); - m_float_emit.FADD(64, VD, V0, VB); - fpr.FixSinglePrecision(d); - - fpr.Unlock(V0); -} - -void JitArm64::ps_madds1(UGeckoInstruction inst) -{ - INSTRUCTION_START - JITDISABLE(bJITPairedOff); - FALLBACK_IF(inst.Rc); - FALLBACK_IF(SConfig::GetInstance().bFPRF && js.op->wantsFPRF); - - u32 a = inst.FA, b = inst.FB, c = inst.FC, d = inst.FD; + bool upper = inst.SUBOP5 == 15; ARM64Reg VA = fpr.R(a, REG_REG); ARM64Reg VB = fpr.R(b, REG_REG); @@ -91,7 +70,7 @@ void JitArm64::ps_madds1(UGeckoInstruction inst) ARM64Reg VD = fpr.RW(d, REG_REG); ARM64Reg V0 = fpr.GetReg(); - m_float_emit.DUP(64, V0, VC, 1); + m_float_emit.DUP(64, V0, VC, upper ? 1 : 0); m_float_emit.FMUL(64, V0, V0, VA); m_float_emit.FADD(64, VD, V0, VB); fpr.FixSinglePrecision(d); diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Tables.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Tables.cpp index 22752577e0..29e3cb4aff 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Tables.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Tables.cpp @@ -124,8 +124,8 @@ static GekkoOPTemplate table4_2[] = {11, &JitArm64::ps_sum1}, // ps_sum1 {12, &JitArm64::ps_muls0}, // ps_muls0 {13, &JitArm64::ps_muls1}, // ps_muls1 - {14, &JitArm64::ps_madds0}, // ps_madds0 - {15, &JitArm64::ps_madds1}, // ps_madds1 + {14, &JitArm64::ps_maddsX}, // ps_madds0 + {15, &JitArm64::ps_maddsX}, // ps_madds1 {18, &JitArm64::fp_arith}, // ps_div {20, &JitArm64::fp_arith}, // ps_sub {21, &JitArm64::fp_arith}, // ps_add