From 2ae6f13d2211de23dd0e9fe754762afdc862c367 Mon Sep 17 00:00:00 2001 From: Fiora Date: Tue, 16 Sep 2014 22:50:33 -0700 Subject: [PATCH] JIT: use cvtsi2ss in paired singles One less instruction for a few of the loads. --- Source/Core/Core/PowerPC/JitCommon/JitAsmCommon.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitCommon/JitAsmCommon.cpp b/Source/Core/Core/PowerPC/JitCommon/JitAsmCommon.cpp index f76acc6ba7..24f59e2701 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitAsmCommon.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/JitAsmCommon.cpp @@ -544,8 +544,7 @@ void CommonAsmRoutines::GenQuantizedLoads() SafeLoadToReg(RSCRATCH_EXTRA, R(RSCRATCH_EXTRA), 8, 0, QUANTIZED_REGS_TO_SAVE_LOAD, false, SAFE_LOADSTORE_NO_PROLOG); else UnsafeLoadRegToRegNoSwap(RSCRATCH_EXTRA, RSCRATCH_EXTRA, 8, 0); // RSCRATCH_EXTRA = 0x000000xx - MOVD_xmm(XMM0, R(RSCRATCH_EXTRA)); - CVTDQ2PS(XMM0, R(XMM0)); // Is CVTSI2SS better? + CVTSI2SS(XMM0, R(RSCRATCH_EXTRA)); SHR(32, R(RSCRATCH2), Imm8(5)); MOVSS(XMM1, MDisp(RSCRATCH2, (u32)(u64)m_dequantizeTableS)); MULSS(XMM0, R(XMM1)); @@ -585,8 +584,7 @@ void CommonAsmRoutines::GenQuantizedLoads() SafeLoadToReg(RSCRATCH_EXTRA, R(RSCRATCH_EXTRA), 8, 0, QUANTIZED_REGS_TO_SAVE_LOAD, true, SAFE_LOADSTORE_NO_PROLOG); else UnsafeLoadRegToRegNoSwap(RSCRATCH_EXTRA, RSCRATCH_EXTRA, 8, 0, true); - MOVD_xmm(XMM0, R(RSCRATCH_EXTRA)); - CVTDQ2PS(XMM0, R(XMM0)); + CVTSI2SS(XMM0, R(RSCRATCH_EXTRA)); SHR(32, R(RSCRATCH2), Imm8(5)); MOVSS(XMM1, MDisp(RSCRATCH2, (u32)(u64)m_dequantizeTableS)); MULSS(XMM0, R(XMM1)); @@ -621,8 +619,7 @@ void CommonAsmRoutines::GenQuantizedLoads() SafeLoadToReg(RSCRATCH_EXTRA, R(RSCRATCH_EXTRA), 16, 0, QUANTIZED_REGS_TO_SAVE_LOAD, false, SAFE_LOADSTORE_NO_PROLOG); else UnsafeLoadRegToReg(RSCRATCH_EXTRA, RSCRATCH_EXTRA, 16, 0, false); - MOVD_xmm(XMM0, R(RSCRATCH_EXTRA)); - CVTDQ2PS(XMM0, R(XMM0)); + CVTSI2SS(XMM0, R(RSCRATCH_EXTRA)); SHR(32, R(RSCRATCH2), Imm8(5)); MOVSS(XMM1, MDisp(RSCRATCH2, (u32)(u64)m_dequantizeTableS)); MULSS(XMM0, R(XMM1)); @@ -656,8 +653,7 @@ void CommonAsmRoutines::GenQuantizedLoads() SafeLoadToReg(RSCRATCH_EXTRA, R(RSCRATCH_EXTRA), 16, 0, QUANTIZED_REGS_TO_SAVE_LOAD, true, SAFE_LOADSTORE_NO_PROLOG); else UnsafeLoadRegToReg(RSCRATCH_EXTRA, RSCRATCH_EXTRA, 16, 0, true); - MOVD_xmm(XMM0, R(RSCRATCH_EXTRA)); - CVTDQ2PS(XMM0, R(XMM0)); + CVTSI2SS(XMM0, R(RSCRATCH_EXTRA)); SHR(32, R(RSCRATCH2), Imm8(5)); MOVSS(XMM1, MDisp(RSCRATCH2, (u32)(u64)m_dequantizeTableS)); MULSS(XMM0, R(XMM1));