summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorMerryMage <MerryMage@users.noreply.github.com>2019-05-25 22:51:02 +0100
committerMerryMage <MerryMage@users.noreply.github.com>2019-05-25 23:07:50 +0100
commit12314577c19aa52a3c4d6e724280e6b7ef9af306 (patch)
treeb0a457d9f008357f60bf5ea71720ba30845f7a63 /Source
parentec8d57d882067e1cd933f7efaed9947e8a444b3c (diff)
Jit64AsmCommon: Make ConvertDoubleToSingle use RSCRATCH as output
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/PowerPC/Jit64/Jit_LoadStoreFloating.cpp2
-rw-r--r--Source/Core/Core/PowerPC/Jit64Common/Jit64AsmCommon.cpp9
-rw-r--r--Source/UnitTests/Core/PowerPC/Jit64Common/ConvertDoubleToSingle.cpp2
3 files changed, 7 insertions, 6 deletions
diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStoreFloating.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStoreFloating.cpp
index 9c1484cfe0..2ce40f08c8 100644
--- a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStoreFloating.cpp
+++ b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStoreFloating.cpp
@@ -110,6 +110,7 @@ void Jit64::stfXXX(UGeckoInstruction inst)
RCOpArg Rs = fpr.Use(s, RCMode::Read);
RegCache::Realize(Rs);
CVTSD2SS(XMM0, Rs);
+ MOVD_xmm(R(RSCRATCH), XMM0);
}
else
{
@@ -118,7 +119,6 @@ void Jit64::stfXXX(UGeckoInstruction inst)
MOVAPD(XMM0, Rs);
CALL(asm_routines.cdts);
}
- MOVD_xmm(R(RSCRATCH), XMM0);
}
else
{
diff --git a/Source/Core/Core/PowerPC/Jit64Common/Jit64AsmCommon.cpp b/Source/Core/Core/PowerPC/Jit64Common/Jit64AsmCommon.cpp
index d7f7077f6e..f841a216c2 100644
--- a/Source/Core/Core/PowerPC/Jit64Common/Jit64AsmCommon.cpp
+++ b/Source/Core/Core/PowerPC/Jit64Common/Jit64AsmCommon.cpp
@@ -50,8 +50,8 @@ alignas(16) static const __m128i double_bottom_bits = _mm_set_epi64x(0, 0x07ffff
void CommonAsmRoutines::GenConvertDoubleToSingle()
{
- // Input in XMM0, output to XMM0
- // Clobbers RSCRATCH/RSCRATCH2/XMM1
+ // Input in XMM0, output to RSCRATCH
+ // Clobbers RSCRATCH/RSCRATCH2/XMM0/XMM1
const void* start = GetCodePtr();
@@ -79,6 +79,7 @@ void CommonAsmRoutines::GenConvertDoubleToSingle()
// OR them togther
POR(XMM0, R(XMM1));
+ MOVD_xmm(R(RSCRATCH), XMM0);
RET();
// Denormalise
@@ -95,13 +96,13 @@ void CommonAsmRoutines::GenConvertDoubleToSingle()
// fraction >> shift
PSRLQ(XMM0, R(XMM1));
+ MOVD_xmm(R(RSCRATCH), XMM0);
// OR the sign bit in.
SHR(64, R(RSCRATCH2), Imm8(32));
AND(32, R(RSCRATCH2), Imm32(0x80000000));
- MOVQ_xmm(XMM1, R(RSCRATCH2));
- POR(XMM0, R(XMM1));
+ OR(32, R(RSCRATCH), R(RSCRATCH2));
RET();
JitRegister::Register(start, GetCodePtr(), "JIT_cdts");
diff --git a/Source/UnitTests/Core/PowerPC/Jit64Common/ConvertDoubleToSingle.cpp b/Source/UnitTests/Core/PowerPC/Jit64Common/ConvertDoubleToSingle.cpp
index c21ef579aa..41ca31b273 100644
--- a/Source/UnitTests/Core/PowerPC/Jit64Common/ConvertDoubleToSingle.cpp
+++ b/Source/UnitTests/Core/PowerPC/Jit64Common/ConvertDoubleToSingle.cpp
@@ -37,7 +37,7 @@ public:
// Call
MOVQ_xmm(XMM0, R(ABI_PARAM1));
ABI_CallFunction(raw_cdts);
- MOVQ_xmm(R(ABI_RETURN), XMM0);
+ MOV(32, R(ABI_RETURN), R(RSCRATCH));
ABI_PopRegistersAndAdjustStack(ABI_ALL_CALLEE_SAVED, 8, 16);
RET();