diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp index ed17d69f1a..25fd1673a4 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp @@ -4457,9 +4457,6 @@ OrderedNode *OpDispatchBuilder::LoadSource_WithOpSize(RegisterClassType Class, X auto Constant = _Constant(GPRSize * 8, Operand.Data.SIB.Scale); Tmp = _Mul(IR::SizeToOpSize(GPRSize), Tmp, Constant); } - if (Operand.Data.SIB.Index == FEXCore::X86State::REG_RSP && AccessType == MemoryAccessType::DEFAULT) { - AccessType = MemoryAccessType::NONTSO; - } } if (Operand.Data.SIB.Base != FEXCore::X86State::REG_INVALID) { @@ -4471,10 +4468,6 @@ OrderedNode *OpDispatchBuilder::LoadSource_WithOpSize(RegisterClassType Class, X else { Tmp = GPR; } - - if (Operand.Data.SIB.Base == FEXCore::X86State::REG_RSP && AccessType == MemoryAccessType::DEFAULT) { - AccessType = MemoryAccessType::NONTSO; - } } } @@ -4495,6 +4488,12 @@ OrderedNode *OpDispatchBuilder::LoadSource_WithOpSize(RegisterClassType Class, X } } + if ((Operand.Data.SIB.Base == FEXCore::X86State::REG_RSP || + Operand.Data.SIB.Index == FEXCore::X86State::REG_RSP) + && AccessType == MemoryAccessType::DEFAULT) { + AccessType = MemoryAccessType::NONTSO; + } + LoadableType = true; } else { @@ -4744,6 +4743,12 @@ void OpDispatchBuilder::StoreResult_WithOpSize(FEXCore::IR::RegisterClassType Cl MemStoreDst = _Bfe(IR::SizeToOpSize(std::max(4u, AddrSize)), AddrSize * 8, 0, MemStoreDst); } + if ((Operand.Data.SIB.Base == FEXCore::X86State::REG_RSP || + Operand.Data.SIB.Index == FEXCore::X86State::REG_RSP) + && AccessType == MemoryAccessType::DEFAULT) { + AccessType = MemoryAccessType::NONTSO; + } + MemStore = true; }