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

Method FixupAF

FEXCore/Source/Interface/Core/OpcodeDispatcher/Flags.cpp:194–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194void OpDispatchBuilder::FixupAF() {
195 // The caller has set a desired value of AF in AF[4], regardless of the value
196 // of PF. We need to fixup AF[4] so that we get the right value when we XOR in
197 // PF[4] later. The easiest solution is to XOR by PF[4], since:
198 //
199 // (AF[4] ^ PF[4]) ^ PF[4] = AF[4]
200
201 auto PFRaw = GetRFLAG(FEXCore::X86State::RFLAG_PF_RAW_LOC);
202 auto AFRaw = GetRFLAG(FEXCore::X86State::RFLAG_AF_RAW_LOC);
203
204 // Again 64-bit as masking is more expensive.
205 Ref XorRes = _Xor(OpSize::i64Bit, AFRaw, PFRaw);
206 SetRFLAG<FEXCore::X86State::RFLAG_AF_RAW_LOC>(XorRes);
207}
208
209void OpDispatchBuilder::SetAFAndFixup(Ref AF) {
210 // We have a value of AF, we shift into AF[4]. We need to fixup AF[4] so that

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected