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

Method BSROp

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

Source from the content-addressed store, hash-verified

3736}
3737
3738void OpDispatchBuilder::BSROp(OpcodeArgs) {
3739 const auto GPRSize = GetGPROpSize();
3740 const auto DstSize = OpSizeFromDst(Op) == OpSize::i16Bit ? OpSize::i16Bit : GPRSize;
3741 Ref Dest = LoadSource_WithOpSize(GPRClass, Op, Op->Dest, DstSize, Op->Flags, {.AllowUpperGarbage = true});
3742 Ref Src = LoadSource(GPRClass, Op, Op->Src[0], Op->Flags, {.AllowUpperGarbage = true});
3743
3744 // Find the MSB of this source
3745 auto Result = _FindMSB(OpSizeFromSrc(Op), Src);
3746
3747 // OF, SF, AF, PF, CF all undefined
3748 // ZF is set to 1 if the source was zero
3749 SetZ_InvalidateNCV(OpSizeFromSrc(Op), Src);
3750
3751 // If Src was zero then the destination doesn't get modified
3752 auto SelectOp = NZCVSelect(GPRSize, {COND_EQ}, Dest, Result);
3753 StoreResult_WithOpSize(GPRClass, Op, Op->Dest, SelectOp, DstSize, OpSize::iInvalid);
3754}
3755
3756void OpDispatchBuilder::CMPXCHGOp(OpcodeArgs) {
3757 // CMPXCHG ModRM, reg, {RAX}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected