mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-14 11:01:01 +02:00
OpcodeDispatcher: Fixes CRC32 with high 8-bit register
Assertion failure in `_Bfe` IR operation when encountering this instruction. Ensure the GPR source is sized appropriately.
This commit is contained in:
1 file changed
+3
-2
@@ -5056,6 +5056,7 @@ void OpDispatchBuilder::CRC32(OpcodeArgs) {
|
||||
return;
|
||||
}
|
||||
const auto GPRSize = GetGPROpSize();
|
||||
const auto SrcSize = OpSizeFromSrc(Op);
|
||||
|
||||
// Destination GPR size is always 4 or 8 bytes depending on widening
|
||||
const auto DstSize = Op->Flags & FEXCore::X86Tables::DecodeFlags::FLAG_REX_WIDENING ? OpSize::i64Bit : OpSize::i32Bit;
|
||||
@@ -5064,11 +5065,11 @@ void OpDispatchBuilder::CRC32(OpcodeArgs) {
|
||||
// Incoming memory is 8, 16, 32, or 64
|
||||
Ref Src {};
|
||||
if (Op->Src[0].IsGPR()) {
|
||||
Src = LoadSourceGPR_WithOpSize(Op, Op->Src[0], GPRSize, Op->Flags);
|
||||
Src = LoadSourceGPR_WithOpSize(Op, Op->Src[0], SrcSize, Op->Flags, {.AllowUpperGarbage = true});
|
||||
} else {
|
||||
Src = LoadSourceGPR(Op, Op->Src[0], Op->Flags, {.Align = OpSize::i8Bit});
|
||||
}
|
||||
auto Result = _CRC32(Dest, Src, OpSizeFromSrc(Op));
|
||||
auto Result = _CRC32(Dest, Src, SrcSize);
|
||||
StoreResultGPR_WithOpSize(Op, Op->Dest, Result, DstSize);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user