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

Method BLSMSKBMIOp

FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp:1753–1771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1751}
1752
1753void OpDispatchBuilder::BLSMSKBMIOp(OpcodeArgs) {
1754 // Equivalent to: (Src - 1) ^ Src
1755 LOGMAN_THROW_A_FMT(Op->InstSize >= 4, "No masking needed");
1756 const auto Size = OpSizeFromSrc(Op);
1757
1758 auto* Src = LoadSource(GPRClass, Op, Op->Src[0], Op->Flags, {.AllowUpperGarbage = true});
1759 auto Result = _Xor(Size, Sub(Size, Src, 1), Src);
1760
1761 StoreResult(GPRClass, Op, Result, OpSize::iInvalid);
1762 InvalidatePF_AF();
1763
1764 // CF set according to the Src
1765 auto CFInv = To01(OpSize::i64Bit, Src);
1766
1767 // The output of BLSMSK is always nonzero, so TST will clear Z (along with C
1768 // and O) while setting S.
1769 SetNZ_ZeroCV(Size, Result);
1770 SetCFInverted(CFInv);
1771}
1772
1773void OpDispatchBuilder::BLSRBMIOp(OpcodeArgs) {
1774 // Equivalent to: (Src - 1) & Src

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected