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

Method MASKMOVOp

FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp:2334–2352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2332template void OpDispatchBuilder::XMM_To_MMX_Vector_CVT_Float_To_Int<OpSize::i64Bit, true>(OpcodeArgs);
2333
2334void OpDispatchBuilder::MASKMOVOp(OpcodeArgs) {
2335 const auto Size = OpSizeFromSrc(Op);
2336
2337 Ref MaskSrc = LoadSource(GPRClass, Op, Op->Src[0], Op->Flags);
2338 // Mask only cares about the top bit of each byte
2339 MaskSrc = _VCMPLTZ(Size, OpSize::i8Bit, MaskSrc);
2340
2341 // Vector that will overwrite byte elements.
2342 Ref VectorSrc = LoadSource(GPRClass, Op, Op->Dest, Op->Flags);
2343
2344 // RDI source (DS prefix by default)
2345 auto MemDest = MakeSegmentAddress(X86State::REG_RDI, Op->Flags, X86Tables::DecodeFlags::FLAG_DS_PREFIX);
2346
2347 Ref XMMReg = _LoadMem(FPRClass, Size, MemDest, OpSize::i8Bit);
2348
2349 // If the Mask element high bit is set then overwrite the element with the source, else keep the memory variant
2350 XMMReg = _VBSL(Size, MaskSrc, VectorSrc, XMMReg);
2351 _StoreMem(FPRClass, Size, MemDest, XMMReg, OpSize::i8Bit);
2352}
2353
2354void OpDispatchBuilder::VMASKMOVOpImpl(OpcodeArgs, IR::OpSize ElementSize, IR::OpSize DataSize, bool IsStore,
2355 const X86Tables::DecodedOperand& MaskOp, const X86Tables::DecodedOperand& DataOp) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected