mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-11 21:00:40 +02:00
FEXCore: Fixes 16-bit operand size Leave
Weren't testing this edge case just like enter
This commit is contained in:
2 files changed
+32
-3
No files matched your search
@@ -498,15 +498,18 @@ void OpDispatchBuilder::POPSegmentOp(OpcodeArgs, uint32_t SegmentReg) {
|
||||
}
|
||||
|
||||
void OpDispatchBuilder::LEAVEOp(OpcodeArgs) {
|
||||
const auto GPRSize = GetGPROpSize();
|
||||
const auto OperandSize = (Op->Flags & FEXCore::X86Tables::DecodeFlags::FLAG_OPERAND_SIZE) ? OpSize::i16Bit : GPRSize;
|
||||
|
||||
// First we move RBP in to RSP and then behave effectively like a pop
|
||||
auto SP = _RMWHandle(LoadGPRRegister(X86State::REG_RBP));
|
||||
auto NewGPR = Pop(OpSizeFromSrc(Op), SP);
|
||||
auto NewGPR = Pop(OperandSize, SP);
|
||||
|
||||
// Store the new stack pointer
|
||||
StoreGPRRegister(X86State::REG_RSP, SP);
|
||||
StoreGPRRegister(X86State::REG_RSP, SP, OperandSize);
|
||||
|
||||
// Store what we loaded to RBP
|
||||
StoreGPRRegister(X86State::REG_RBP, NewGPR);
|
||||
StoreGPRRegister(X86State::REG_RBP, NewGPR, OperandSize);
|
||||
}
|
||||
|
||||
void OpDispatchBuilder::CALLOp(OpcodeArgs) {
|
||||
|
||||
Reference in new issue
Block a user