From 2599cd545e41fcc81349bb27d37c88dc0ddd5ca0 Mon Sep 17 00:00:00 2001 From: magumagu Date: Mon, 26 May 2014 01:45:07 -0700 Subject: [PATCH] JIT: make backpatch handle sign-extend from 8 bits correctly. I don't think this is actually possible to trigger at the moment... but it matches the implementation of SafeLoadToReg. --- Source/Core/Core/PowerPC/JitCommon/JitBackpatch.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/PowerPC/JitCommon/JitBackpatch.cpp b/Source/Core/Core/PowerPC/JitCommon/JitBackpatch.cpp index 922064670233..53bc48cf9ca8 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitBackpatch.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/JitBackpatch.cpp @@ -86,7 +86,12 @@ const u8 *TrampolineCache::GetReadTrampoline(const InstructionInfo &info, u32 re break; } - if (dataReg != EAX) + if (info.signExtend && info.operandSize == 1) + { + // Need to sign extend value from Read_U8. + MOVSX(32, 8, dataReg, R(EAX)); + } + else if (dataReg != EAX) { MOV(32, R(dataReg), R(EAX)); }