Skip to content

Commit

Permalink
Backport Alyssa's changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pmatos committed Jul 17, 2024
1 parent 3b8280e commit a4b0484
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions FEXCore/Source/Interface/Core/OpcodeDispatcher/X87.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -682,19 +682,18 @@ void OpDispatchBuilder::X87ModifySTP(OpcodeArgs, bool Inc) {
// during the function runtime.
Ref OpDispatchBuilder::ReconstructFSW_Helper(Ref T) {
// We must construct the FSW from our various bits
Ref FSW = _Constant(0);
auto* Top = T ? T : GetX87Top();
FSW = _Bfi(OpSize::i64Bit, 3, 11, FSW, Top);

auto* C0 = GetRFLAG(FEXCore::X86State::X87FLAG_C0_LOC);
auto* C1 = GetRFLAG(FEXCore::X86State::X87FLAG_C1_LOC);
auto* C2 = GetRFLAG(FEXCore::X86State::X87FLAG_C2_LOC);
auto* C3 = GetRFLAG(FEXCore::X86State::X87FLAG_C3_LOC);
auto C0 = GetRFLAG(FEXCore::X86State::X87FLAG_C0_LOC);
auto C1 = GetRFLAG(FEXCore::X86State::X87FLAG_C1_LOC);
auto C2 = GetRFLAG(FEXCore::X86State::X87FLAG_C2_LOC);
auto C3 = GetRFLAG(FEXCore::X86State::X87FLAG_C3_LOC);

FSW = _Orlshl(OpSize::i64Bit, FSW, C0, 8);
Ref FSW = _Lshl(OpSize::i64Bit, C0, _Constant(8));
FSW = _Orlshl(OpSize::i64Bit, FSW, C1, 9);
FSW = _Orlshl(OpSize::i64Bit, FSW, C2, 10);
FSW = _Orlshl(OpSize::i64Bit, FSW, C3, 14);

auto Top = GetX87Top();
FSW = _Bfi(OpSize::i64Bit, 3, 11, FSW, Top);
return FSW;
}

Expand Down

0 comments on commit a4b0484

Please sign in to comment.