From 1851458628fd5de7f76ebcaa823af499d997fe5e Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Thu, 12 May 2016 20:28:59 +0200 Subject: [PATCH] Bugfixes --- Core/MIPS/ARM64/Arm64CompVFPU.cpp | 2 ++ Core/MIPS/IR/IRCompVFPU.cpp | 23 +++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Core/MIPS/ARM64/Arm64CompVFPU.cpp b/Core/MIPS/ARM64/Arm64CompVFPU.cpp index 91500507ae..3cd5f03d7b 100644 --- a/Core/MIPS/ARM64/Arm64CompVFPU.cpp +++ b/Core/MIPS/ARM64/Arm64CompVFPU.cpp @@ -1297,6 +1297,8 @@ namespace MIPSComp { } void Arm64Jit::Comp_Vi2x(MIPSOpcode op) { + CONDITIONAL_DISABLE; + if (!cpu_info.bNEON) { DISABLE; } diff --git a/Core/MIPS/IR/IRCompVFPU.cpp b/Core/MIPS/IR/IRCompVFPU.cpp index 8ca4336c2b..ed2ab8d89b 100644 --- a/Core/MIPS/IR/IRCompVFPU.cpp +++ b/Core/MIPS/IR/IRCompVFPU.cpp @@ -1127,26 +1127,41 @@ namespace MIPSComp { GetVectorRegs(tregs, sz, _VT); GetVectorRegs(dregs, sz, _VD); + int tempregs[4]; + for (int i = 0; i < n; ++i) { + if (!IsOverlapSafe(dregs[i], n, sregs, n, tregs)) { + tempregs[i] = IRVTEMP_PFX_T + i; // using IRTEMP0 for other things + } else { + tempregs[i] = dregs[i]; + } + } + if (sz == V_Triple) { int temp0 = IRVTEMP_0; int temp1 = IRVTEMP_0 + 1; // Compute X ir.Write(IROp::FMul, temp0, sregs[1], tregs[2]); ir.Write(IROp::FMul, temp1, sregs[2], tregs[1]); - ir.Write(IROp::FSub, dregs[0], temp0, temp1); + ir.Write(IROp::FSub, tempregs[0], temp0, temp1); // Compute Y ir.Write(IROp::FMul, temp0, sregs[2], tregs[0]); ir.Write(IROp::FMul, temp1, sregs[0], tregs[2]); - ir.Write(IROp::FSub, dregs[1], temp0, temp1); + ir.Write(IROp::FSub, tempregs[1], temp0, temp1); // Compute Z ir.Write(IROp::FMul, temp0, sregs[0], tregs[1]); ir.Write(IROp::FMul, temp1, sregs[1], tregs[0]); - ir.Write(IROp::FSub, dregs[2], temp0, temp1); + ir.Write(IROp::FSub, tempregs[2], temp0, temp1); } else if (sz == V_Quad) { DISABLE; } + + for (int i = 0; i < n; i++) { + if (tempregs[i] != dregs[i]) + ir.Write(IROp::FMov, dregs[i], tempregs[i]); + } + // No D prefix supported } void IRFrontend::Comp_Vcmp(MIPSOpcode op) { @@ -1232,7 +1247,7 @@ namespace MIPSComp { int tempregs[4]; for (int i = 0; i < n; ++i) { if (!IsOverlapSafe(dregs[i], n, sregs)) { - tempregs[i] = IRVTEMP_PFX_T; // using IRTEMP0 for other things + tempregs[i] = IRVTEMP_PFX_T + i; // using IRTEMP0 for other things } else { tempregs[i] = dregs[i]; }