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

Method PINSROpImpl

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

Source from the content-addressed store, hash-verified

1515}
1516
1517Ref OpDispatchBuilder::PINSROpImpl(OpcodeArgs, IR::OpSize ElementSize, const X86Tables::DecodedOperand& Src1Op,
1518 const X86Tables::DecodedOperand& Src2Op, const X86Tables::DecodedOperand& Imm) {
1519 const auto Size = OpSizeFromDst(Op);
1520 const auto NumElements = IR::NumElements(Size, ElementSize);
1521 const uint64_t Index = Imm.Literal() & (NumElements - 1);
1522 Ref Src1 = LoadSource_WithOpSize(FPRClass, Op, Src1Op, Size, Op->Flags);
1523
1524 if (Src2Op.IsGPR()) {
1525 // If the source is a GPR then convert directly from the GPR.
1526 auto Src2 = LoadSource_WithOpSize(GPRClass, Op, Src2Op, GetGPROpSize(), Op->Flags);
1527 return _VInsGPR(Size, ElementSize, Index, Src1, Src2);
1528 }
1529
1530 // If loading from memory then we only load the element size
1531 Ref Src2 = MakeSegmentAddress(Op, Src2Op);
1532 return _VLoadVectorElement(Size, ElementSize, Src1, Index, Src2);
1533}
1534
1535template<IR::OpSize ElementSize>
1536void OpDispatchBuilder::PINSROp(OpcodeArgs) {

Callers

nothing calls this directly

Calls 3

NumElementsFunction · 0.85
LiteralMethod · 0.80
IsGPRMethod · 0.45

Tested by

no test coverage detected