From 2df55d303a57fdb70dfed2cbb9682eeabf1b6c2a Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sun, 17 Nov 2019 17:02:15 -0800 Subject: [PATCH] Fixes bug in SHR op Smaller ops could have been shifting data from the larger source in to the smaller op space when it should have been zero'd --- Source/Interface/Core/OpcodeDispatcher.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Interface/Core/OpcodeDispatcher.cpp b/Source/Interface/Core/OpcodeDispatcher.cpp index 2312cd8cf..2c9e6a31d 100644 --- a/Source/Interface/Core/OpcodeDispatcher.cpp +++ b/Source/Interface/Core/OpcodeDispatcher.cpp @@ -1124,6 +1124,10 @@ void OpDispatchBuilder::SHROp(OpcodeArgs) { else Src = _And(Src, _Constant(0x1F)); + if (Size != 64) { + Dest = _Bfe(Size, 0, Dest); + } + auto ALUOp = _Lshr(Dest, Src); StoreResult(Op, ALUOp, -1);