MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / FTST

Method FTST

FEXCore/Source/Interface/Core/OpcodeDispatcher/X87.cpp:694–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

692}
693
694void OpDispatchBuilder::FTST(OpcodeArgs) {
695 Ref Res = _F80StackTest(0);
696
697 Ref HostFlag_CF = _Bfe(OpSize::i64Bit, 1, FCMP_FLAG_LT, Res);
698 Ref HostFlag_ZF = _Bfe(OpSize::i64Bit, 1, FCMP_FLAG_EQ, Res);
699 Ref HostFlag_Unordered = _Bfe(OpSize::i64Bit, 1, FCMP_FLAG_UNORDERED, Res);
700 HostFlag_CF = _Or(OpSize::i32Bit, HostFlag_CF, HostFlag_Unordered);
701 HostFlag_ZF = _Or(OpSize::i32Bit, HostFlag_ZF, HostFlag_Unordered);
702
703 SetRFLAG<FEXCore::X86State::X87FLAG_C0_LOC>(HostFlag_CF);
704 SetRFLAG<FEXCore::X86State::X87FLAG_C1_LOC>(Constant(0));
705 SetRFLAG<FEXCore::X86State::X87FLAG_C2_LOC>(HostFlag_Unordered);
706 SetRFLAG<FEXCore::X86State::X87FLAG_C3_LOC>(HostFlag_ZF);
707
708 // Set Invalid Operation flag when unordered (NaN comparison)
709 SetRFLAG<FEXCore::X86State::X87FLAG_IE_LOC>(HostFlag_Unordered);
710}
711
712void OpDispatchBuilder::X87OpHelper(OpcodeArgs, FEXCore::IR::IROps IROp, bool ZeroC2) {
713 DeriveOp(Result, IROp, _F80SCALEStack());

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected