Skip to content

Commit

Permalink
Improve 32bit ld/st addressing mode propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
pmatos committed Feb 12, 2024
1 parent 780b486 commit ec7caf3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions FEXCore/Source/Interface/IR/Passes/ConstProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ bool ConstProp::ConstantPropagation(IREmitter *IREmit, const IRListView& Current
auto Op = IROp->CW<IR::IROp_LoadMem>();
auto AddressHeader = IREmit->GetOpHeader(Op->Addr);

if (AddressHeader->Op == OP_ADD && AddressHeader->Size == 8) {
if (AddressHeader->Op == OP_ADD &&
(AddressHeader->Size == 8 || AddressHeader->Size == 4)) {
auto [OffsetType, OffsetScale, Arg0, Arg1] = MemExtendedAddressing(IREmit, IROp->Size, AddressHeader);

Op->OffsetType = OffsetType;
Expand All @@ -542,7 +543,8 @@ bool ConstProp::ConstantPropagation(IREmitter *IREmit, const IRListView& Current
auto Op = IROp->CW<IR::IROp_StoreMem>();
auto AddressHeader = IREmit->GetOpHeader(Op->Addr);

if (AddressHeader->Op == OP_ADD && AddressHeader->Size == 8) {
if (AddressHeader->Op == OP_ADD &&
(AddressHeader->Size == 8 || AddressHeader->Size == 4)) {
auto [OffsetType, OffsetScale, Arg0, Arg1] = MemExtendedAddressing(IREmit, IROp->Size, AddressHeader);

Op->OffsetType = OffsetType;
Expand Down

0 comments on commit ec7caf3

Please sign in to comment.