From f2b9b57e18ec4e6e71917c3ecc179748d37ad287 Mon Sep 17 00:00:00 2001 From: "Herman S." <429230+has207@users.noreply.github.com> Date: Sat, 14 Feb 2026 02:23:58 +0900 Subject: [PATCH] Reapply "[x64] Zero extend on mov to 8bit register" This reverts commit 3a6f63f34f910991b5ac9da245a6b1e7a7727477. (The issue wasn't xbyak but rather cherrypick order wrt to other commits, xbyak upgrade was a red herring) --- src/xenia/cpu/backend/x64/x64_sequences.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xenia/cpu/backend/x64/x64_sequences.cc b/src/xenia/cpu/backend/x64/x64_sequences.cc index b411f6f0f..65ec1126c 100644 --- a/src/xenia/cpu/backend/x64/x64_sequences.cc +++ b/src/xenia/cpu/backend/x64/x64_sequences.cc @@ -2879,9 +2879,10 @@ struct SHL_V128 : Sequence> { // Linux/Mac System V ABI: __m128i passed in xmm0, return in xmm0 e.vmovaps(e.xmm0, src1); if (i.src2.is_constant) { - e.mov(e.GetNativeParam(1), i.src2.constant()); + e.mov(e.GetNativeParam(0), i.src2.constant()); } else { - e.mov(e.GetNativeParam(1), i.src2); + // Zero-extend the 8-bit register to avoid garbage in upper bits + e.movzx(e.GetNativeParam(0).cvt32(), i.src2); } #endif e.CallNativeSafe(reinterpret_cast(EmulateShlV128));