mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-02-08 15:47:10 +00:00
OpcodeDispatcher: improve bmi2 shift
allow upper garbage, use simpler clean. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
parent
7bd036d1ae
commit
0413a6bf68
@ -1859,21 +1859,19 @@ void OpDispatchBuilder::BMI2Shift(OpcodeArgs) {
|
||||
const auto SrcSize = Op->Src[0].IsGPR() ? GPRSize : Size;
|
||||
|
||||
auto* Src = LoadSource_WithOpSize(GPRClass, Op, Op->Src[0], SrcSize, Op->Flags);
|
||||
auto* Shift = LoadSource_WithOpSize(GPRClass, Op, Op->Src[1], GPRSize, Op->Flags);
|
||||
auto* Shift = LoadSource_WithOpSize(GPRClass, Op, Op->Src[1], GPRSize, Op->Flags, {.AllowUpperGarbage = true});
|
||||
|
||||
auto* Result = [&]() -> OrderedNode* {
|
||||
OrderedNode* Result;
|
||||
if (Op->OP == 0x6F7) {
|
||||
// SARX
|
||||
if (Op->OP == 0x6F7) {
|
||||
return _Ashr(IR::SizeToOpSize(Size), Src, Shift);
|
||||
}
|
||||
Result = _Ashr(IR::SizeToOpSize(Size), Src, Shift);
|
||||
} else if (Op->OP == 0x5F7) {
|
||||
// SHLX
|
||||
if (Op->OP == 0x5F7) {
|
||||
return _Lshl(IR::SizeToOpSize(Size), Src, Shift);
|
||||
}
|
||||
|
||||
Result = _Lshl(IR::SizeToOpSize(Size), Src, Shift);
|
||||
} else {
|
||||
// SHRX
|
||||
return _Lshr(IR::SizeToOpSize(Size), Src, Shift);
|
||||
}();
|
||||
Result = _Lshr(IR::SizeToOpSize(Size), Src, Shift);
|
||||
}
|
||||
|
||||
StoreResult(GPRClass, Op, Result, -1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user