mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 15:00:17 +02:00
OpcodeDispatcher: Fixes SHLD by 16 behaviour
We were assuming that SHLD undefined behaviour matches SHL, but the specification actually changes a `ge` comparison to `gt`, which means a shift of 16 isn't UB! Thanks to the impeccable @OFFTKP in #5842 for bringing this up as it took a bit for me to figure out what was actually wrong here. I modified their unittest to cover more just to ensure we don't break it.
This commit is contained in:
4 files changed
+60
-4
No files matched your search
@@ -1526,7 +1526,7 @@ void OpDispatchBuilder::SHLDImmediateOp(OpcodeArgs) {
|
||||
Res = _Extr(OpSizeFromSrc(Op), Dest, Src, Size - Shift);
|
||||
}
|
||||
|
||||
CalculateFlags_ShiftLeftImmediate(OpSizeFromSrc(Op), Res, Dest, Shift);
|
||||
CalculateFlags_ShiftLeftImmediate(OpSizeFromSrc(Op), Res, Dest, Shift, true);
|
||||
CalculateDeferredFlags();
|
||||
StoreResultGPR(Op, Res);
|
||||
} else if (Shift == 0 && Size == 32) {
|
||||
|
||||
Reference in new issue
Block a user