From 6ca5d7c7c8230322e52bd3f08e8700c45f04d0c4 Mon Sep 17 00:00:00 2001 From: pierre Date: Fri, 8 Apr 2011 21:05:19 +0000 Subject: [PATCH] Core/DSP/Jit: Fix accumulator limiting in several extended ops Corrects some audio in Pikmin when using DSPLLE Jit. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7442 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/DSP/Jit/DSPJitExtOps.cpp | 40 ++++--------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/Source/Core/Core/Src/DSP/Jit/DSPJitExtOps.cpp b/Source/Core/Core/Src/DSP/Jit/DSPJitExtOps.cpp index 46527f8256..b85890c8fb 100644 --- a/Source/Core/Core/Src/DSP/Jit/DSPJitExtOps.cpp +++ b/Source/Core/Core/Src/DSP/Jit/DSPJitExtOps.cpp @@ -187,10 +187,7 @@ void DSPEmitter::ls(const UDSPInstruction opc) X64Reg tmp1; gpr.getFreeXReg(tmp1); - if (sreg >= DSP_REG_ACM0) - dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); - else - dsp_op_read_reg(sreg + DSP_REG_ACM0, tmp1, ZERO); + dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); dmem_write(tmp1); gpr.putXReg(tmp1); @@ -217,10 +214,7 @@ void DSPEmitter::lsn(const UDSPInstruction opc) X64Reg tmp1; gpr.getFreeXReg(tmp1); - if (sreg >= DSP_REG_ACM0) - dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); - else - dsp_op_read_reg(sreg + DSP_REG_ACM0, tmp1, ZERO); + dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); dmem_write(tmp1); gpr.putXReg(tmp1); @@ -246,10 +240,7 @@ void DSPEmitter::lsm(const UDSPInstruction opc) X64Reg tmp1; gpr.getFreeXReg(tmp1); - if (sreg >= DSP_REG_ACM0) - dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); - else - dsp_op_read_reg(sreg + DSP_REG_ACM0, tmp1, ZERO); + dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); dmem_write(tmp1); gpr.putXReg(tmp1); @@ -276,10 +267,7 @@ void DSPEmitter::lsnm(const UDSPInstruction opc) X64Reg tmp1; gpr.getFreeXReg(tmp1); - if (sreg >= DSP_REG_ACM0) - dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); - else - dsp_op_read_reg(sreg + DSP_REG_ACM0, tmp1, ZERO); + dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); dmem_write(tmp1); gpr.putXReg(tmp1); @@ -304,10 +292,7 @@ void DSPEmitter::sl(const UDSPInstruction opc) X64Reg tmp1; gpr.getFreeXReg(tmp1); - if (sreg >= DSP_REG_ACM0) - dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); - else - dsp_op_read_reg(sreg + DSP_REG_ACM0, tmp1, ZERO); + dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); dmem_write(tmp1); gpr.putXReg(tmp1); @@ -333,10 +318,7 @@ void DSPEmitter::sln(const UDSPInstruction opc) X64Reg tmp1; gpr.getFreeXReg(tmp1); - if (sreg >= DSP_REG_ACM0) - dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); - else - dsp_op_read_reg(sreg + DSP_REG_ACM0, tmp1, ZERO); + dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); dmem_write(tmp1); gpr.putXReg(tmp1); @@ -362,10 +344,7 @@ void DSPEmitter::slm(const UDSPInstruction opc) X64Reg tmp1; gpr.getFreeXReg(tmp1); - if (sreg >= DSP_REG_ACM0) - dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); - else - dsp_op_read_reg(sreg + DSP_REG_ACM0, tmp1, ZERO); + dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); dmem_write(tmp1); gpr.putXReg(tmp1); @@ -391,10 +370,7 @@ void DSPEmitter::slnm(const UDSPInstruction opc) X64Reg tmp1; gpr.getFreeXReg(tmp1); - if (sreg >= DSP_REG_ACM0) - dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); - else - dsp_op_read_reg(sreg + DSP_REG_ACM0, tmp1, ZERO); + dsp_op_read_reg_and_saturate(sreg + DSP_REG_ACM0, tmp1, ZERO); dmem_write(tmp1); gpr.putXReg(tmp1);