Merge pull request #3109 from lioncash/shlx

OpcodeDispatcher: Improve output of SHLX/SHRX/SARX
This commit is contained in:
Ryan Houdek authored and GitHub committed 2023-09-15 18:49:36 -07:00
commit ad8b0c673f
2 files changed
+77 -10

No files matched your search

@@ -2627,12 +2627,16 @@ void OpDispatchBuilder::BLSRBMIOp(OpcodeArgs) {
GenerateFlags_BLSR(Op, Result, Src);
}
// Handles SARX, SHLX, and SHRX
void OpDispatchBuilder::BMI2Shift(OpcodeArgs) {
// Handles SARX, SHLX, and SHRX
auto* Src = LoadSource(GPRClass, Op, Op->Src[0], Op->Flags, -1);
auto* Shift = LoadSource(GPRClass, Op, Op->Src[1], Op->Flags, -1);
// In the event the source is a memory operand, use the
// exact width instead of the GPR size.
const auto GPRSize = CTX->GetGPRSize();
const auto Size = GetSrcSize(Op);
const auto SrcSize = Op->Src[0].IsGPR() ? GPRSize : Size;
auto* Src = LoadSource_WithOpSize(GPRClass, Op, Op->Src[0], SrcSize, Op->Flags, -1);
auto* Shift = LoadSource_WithOpSize(GPRClass, Op, Op->Src[1], GPRSize, Op->Flags, -1);
auto* Result = [&]() -> OrderedNode* {
// SARX