summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSintendo <3380580+Sintendo@users.noreply.github.com>2026-11-10 16:54:33 +0100
committerSintendo <3380580+Sintendo@users.noreply.github.com>2026-11-10 16:55:20 +0100
commitb47056b6fdcbbafcf2dc2da1c252104be4dcca93 (patch)
treecf7fc10a08eddbcecdf24c3f572f700221a027dc
parent70c5a6ad0e62ce32d922dd2478d465e9f0f84424 (diff)
Jit64: mfspr - Sign-extend slice_length
`slice_length` is defined as an int, but was being zero-extended to 64 bits on x64. We should match what we do for ARM64 and sign-extend, as discussed in PR #14944.
-rw-r--r--Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp
index 70eb2e4027..71abc50b7d 100644
--- a/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp
+++ b/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp
@@ -333,7 +333,7 @@ void Jit64::mfspr(UGeckoInstruction inst)
CVTSI2SS(XMM0, PPCSTATE(downcount));
MULSS(XMM0, MDisp(rcx, offsetof(CoreTiming::Globals, last_OC_factor_inverted)));
CVTSS2SI(rdx, R(XMM0)); // RDX is downcount scaled by the overclocking factor
- MOV(32, rax, MDisp(rcx, offsetof(CoreTiming::Globals, slice_length)));
+ MOVSX(64, 32, rax, MDisp(rcx, offsetof(CoreTiming::Globals, slice_length)));
SUB(64, rax, rdx); // cycles since the last CoreTiming::Advance() event is (slicelength -
// Scaled_downcount)
ADD(64, rax, MDisp(rcx, offsetof(CoreTiming::Globals, global_timer)));