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

Method FNINIT

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

Source from the content-addressed store, hash-verified

774}
775
776void OpDispatchBuilder::FNINIT(OpcodeArgs) {
777 auto Zero = Constant(0);
778
779 if (ReducedPrecisionMode) {
780 _SetRoundingMode(Zero, false, Zero);
781 }
782
783 // Init FCW to 0x037F
784 auto NewFCW = Constant(0x037F);
785 _StoreContext(OpSize::i16Bit, GPRClass, NewFCW, offsetof(FEXCore::Core::CPUState, FCW));
786
787 // Set top to zero
788 SetX87Top(Zero);
789 // Tags all get marked as invalid
790 StoreContext(AbridgedFTWIndex, Zero);
791
792 // Reinits the simulated stack
793 _InitStack();
794
795 SetRFLAG<FEXCore::X86State::X87FLAG_C0_LOC>(Zero);
796 SetRFLAG<FEXCore::X86State::X87FLAG_C1_LOC>(Zero);
797 SetRFLAG<FEXCore::X86State::X87FLAG_C2_LOC>(Zero);
798 SetRFLAG<FEXCore::X86State::X87FLAG_C3_LOC>(Zero);
799 SetRFLAG<FEXCore::X86State::X87FLAG_IE_LOC>(Zero);
800}
801
802void OpDispatchBuilder::X87FFREE(OpcodeArgs) {
803 _InvalidateStack(Op->OP & 7);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected