GTPin
Public Member Functions
gtpin::IGtInsFactory Class Reference

Class that defines virtual constructors of IGtIns objects representing various GEN instructions. More...

#include <igt_ins_factory.h>

Public Member Functions

virtual IGtInsMake (const ged_ins_t &gedIns)=0
 Given a GED instruction representation, create the corsponding IGtIns instance.
virtual IGtInsMake (const IGtIns &ins)=0
 Create a copy of the specified instruction.
virtual IGtInsMakeOpRR (GtOpcode op, const GtDstRegion &dst, const GtRegRegion &src0, GtExecMask execMask={1})=0
 Construct a common (arithmetic, logic) 1-source instruction: op(execMask) dst<Reg> src0<Reg>
virtual IGtInsMakeOpRI (GtOpcode op, const GtDstRegion &dst, const GtImm &src0, GtExecMask execMask={1})=0
 Construct a common (arithmetic, logic) 1-source instruction: op(execMask) dst<Reg> src0<Imm>
virtual IGtInsMakeOpRRR (GtOpcode op, const GtDstRegion &dst, const GtRegRegion &src0, const GtRegRegion &src1, GtExecMask execMask={1})=0
 Construct a common (arithmetic, logic) 2-source instruction: op(execMask) dst<Reg> src0<Reg> src1<Reg>
virtual IGtInsMakeOpRRI (GtOpcode op, const GtDstRegion &dst, const GtRegRegion &src0, const GtImm &src1, GtExecMask execMask={1})=0
 Construct a common (arithmetic, logic) 2-source instruction: op(execMask) dst<Reg> src0<Reg> src1<Imm>
virtual IGtInsMakeOp3Src (GtOpcode op, const GtDstRegion &dst, const GtRegRegion &src0, const GtRegRegion &src1, const GtRegRegion &src2, GtExecMask execMask={1})=0
 Construct a common 3-source instruction: op(execMask) dst<Reg> src0<Reg> src1<Reg> src2<Reg>
virtual IGtInsMakeRegMov (const GtReg &dst, const GtReg &src0)=0
 Construct an instruction that moves all bytes of src0 to dst.
virtual IGtInsMakeRegZero (const GtReg &reg)=0
 Construct an instruction that sets zero value in all bytes of the specified register.
virtual IGtInsMakeCmp (GtCondModifier cond, const GtReg &flagReg, const GtRegRegion &src0, const GtRegRegion &src1, GtExecMask execMask={1})=0
 Construct a CMP instruction: cmp(execMask) cond.flag null src0<Reg> src1<Reg>
virtual IGtInsMakeCmp (GtCondModifier cond, const GtReg &flagReg, const GtRegRegion &src0, const GtImm &src1, GtExecMask execMask={1})=0
 Construct a CMP instruction: cmp(execMask) cond.flag null src0<Reg> src1<Imm>
virtual IGtInsMakeIllegal ()=0
 Construct an illegal GEN instruction.
virtual IGtInsMakeNop ()=0
 Construct a NOP instruction.
virtual IGtInsMakeSendMsg (const GtReg &dst, const GtReg &src0, const GtReg &src1, uint32_t exDesc, uint32_t desc, GtExecMask execMask={1})=0
 Construct a SendMessage instruction: send (execMask) dst<Reg> src0<Reg> src1<Reg> exDesc<Imm>, desc<Imm>
virtual IGtInsMakeAtomicOp (GtAtomicOp aop, const GtReg &dst, const GtReg &addrReg, const GtReg &src, GtDataType dataType, GtExecMask execMask={1})=0
 Construct instruction that atomically accesses data in the profile buffer.
virtual bool CanAccessAtomically (GtDataType dataType) const =0
 Return true, if data of the specified type can be accessed atomically in the platform associated with this factory.
virtual const IGtGenModelGenModel () const =0
 Return GEN model of instructions created by this factory.
IGtInsMakeMov (const GtDstRegion &dst, const GtRegRegion &src0, GtExecMask execMask={1})
 Make MOV instruction.
IGtInsMakeMov (const GtDstRegion &dst, const GtImm &src0, GtExecMask execMask={1})
 Make MOV instruction.
IGtInsMakeNot (const GtDstRegion &dst, const GtRegRegion &src0, GtExecMask execMask={1})
 Make NOT instruction.
IGtInsMakeNot (const GtDstRegion &dst, const GtImm &src0, GtExecMask execMask={1})
 Make NOT instruction.
IGtInsMakeCbit (const GtDstRegion &dst, const GtRegRegion &src0, GtExecMask execMask={1})
 Make CBIT instruction.
IGtInsMakeCbit (const GtDstRegion &dst, const GtImm &src0, GtExecMask execMask={1})
 Make CBIT instruction.
IGtInsMakeAdd (const GtDstRegion &dst, const GtRegRegion &src0, const GtRegRegion &src1, GtExecMask execMask={1})
 Make ADD instruction.
IGtInsMakeAdd (const GtDstRegion &dst, const GtRegRegion &src0, const GtImm &src1, GtExecMask execMask={1})
 Make ADD instruction.
IGtInsMakeAddc (const GtDstRegion &dst, const GtRegRegion &src0, const GtRegRegion &src1, GtExecMask execMask={1})
 Make ADDC instruction.
IGtInsMakeAddc (const GtDstRegion &dst, const GtRegRegion &src0, const GtImm &src1, GtExecMask execMask={1})
 Make ADDC instruction.
IGtInsMakeAnd (const GtDstRegion &dst, const GtRegRegion &src0, const GtRegRegion &src1, GtExecMask execMask={1})
 Make AND instruction.
IGtInsMakeAnd (const GtDstRegion &dst, const GtRegRegion &src0, const GtImm &src1, GtExecMask execMask={1})
 Make AND instruction.
IGtInsMakeOr (const GtDstRegion &dst, const GtRegRegion &src0, const GtRegRegion &src1, GtExecMask execMask={1})
 Make OR instruction.
IGtInsMakeOr (const GtDstRegion &dst, const GtRegRegion &src0, const GtImm &src1, GtExecMask execMask={1})
 Make OR instruction.
IGtInsMakeXor (const GtDstRegion &dst, const GtRegRegion &src0, const GtRegRegion &src1, GtExecMask execMask={1})
 Make XOR instruction.
IGtInsMakeXor (const GtDstRegion &dst, const GtRegRegion &src0, const GtImm &src1, GtExecMask execMask={1})
 Make XOR instruction.
IGtInsMakeShr (const GtDstRegion &dst, const GtRegRegion &src0, const GtRegRegion &src1, GtExecMask execMask={1})
 Make SHR instruction.
IGtInsMakeShr (const GtDstRegion &dst, const GtRegRegion &src0, const GtImm &src1, GtExecMask execMask={1})
 Make SHR instruction.
IGtInsMakeShl (const GtDstRegion &dst, const GtRegRegion &src0, const GtRegRegion &src1, GtExecMask execMask={1})
 Make SHL instruction.
IGtInsMakeShl (const GtDstRegion &dst, const GtRegRegion &src0, const GtImm &src1, GtExecMask execMask={1})
 Make SHL instruction.
IGtInsMakeMul (const GtDstRegion &dst, const GtRegRegion &src0, const GtRegRegion &src1, GtExecMask execMask={1})
 Make MUL instruction.
IGtInsMakeMul (const GtDstRegion &dst, const GtRegRegion &src0, const GtImm &src1, GtExecMask execMask={1})
 Make MUL instruction.
IGtInsMakeSel (const GtDstRegion &dst, const GtRegRegion &src0, const GtRegRegion &src1, GtExecMask execMask={1})
 Make SEL instruction.
IGtInsMakeSel (const GtDstRegion &dst, const GtRegRegion &src0, const GtImm &src1, GtExecMask execMask={1})
 Make SEL instruction.
IGtInsMakeSub (const GtDstRegion &dst, const GtRegRegion &src0, const GtRegRegion &src1, GtExecMask execMask={1})
 Make SUB instruction.
IGtInsMakeSub (const GtDstRegion &dst, const GtRegRegion &src0, const GtImm &src1, GtExecMask execMask={1})
 Make SUB instruction.
IGtInsMakeCsel (const GtDstRegion &dst, const GtRegRegion &src0, const GtRegRegion &src1, const GtRegRegion &src2, GtExecMask execMask={1})
 Make CSEL instruction.
IGtInsMakeAtomicInc (const GtReg &dst, const GtReg &addrReg, GtDataType dataType=GED_DATA_TYPE_ud, GtExecMask execMask={1})
 Construct instruction that atomically increments the [addrReg] value in the profile buffer.
IGtInsMakeAtomicDec (const GtReg &dst, const GtReg &addrReg, GtDataType dataType=GED_DATA_TYPE_ud, GtExecMask execMask={1})
 Construct instruction that atomically decrements the [addrReg] value in the profile buffer.
IGtInsMakeAtomicAnd (const GtReg &dst, const GtReg &addrReg, const GtReg &src, GtDataType dataType=GED_DATA_TYPE_ud, GtExecMask execMask={1})
 Construct instruction that atomically stores the bitwise AND of 'src' value and [addrReg] value in the profile buffer.
IGtInsMakeAtomicOr (const GtReg &dst, const GtReg &addrReg, const GtReg &src, GtDataType dataType=GED_DATA_TYPE_ud, GtExecMask execMask={1})
 Construct instruction that atomically stores the bitwise OR of 'src' value and [addrReg] value in the profile buffer.
IGtInsMakeAtomicXor (const GtReg &dst, const GtReg &addrReg, const GtReg &src, GtDataType dataType=GED_DATA_TYPE_ud, GtExecMask execMask={1})
 Construct instruction that atomically stores the bitwise XOR of 'src' value and [addrReg] value in the profile buffer.
IGtInsMakeAtomicAdd (const GtReg &dst, const GtReg &addrReg, const GtReg &src, GtDataType dataType=GED_DATA_TYPE_ud, GtExecMask execMask={1})
 Construct instruction that atomically adds 'src' value to the [addrReg] value in the profile buffer.
IGtInsMakeAtomicSub (const GtReg &dst, const GtReg &addrReg, const GtReg &src, GtDataType dataType=GED_DATA_TYPE_ud, GtExecMask execMask={1})
 Construct instruction that atomically substracts 'src' value from the [addrReg] value in the profile buffer.
IGtInsMakeAtomicImax (const GtReg &dst, const GtReg &addrReg, const GtReg &src, GtDataType dataType=GED_DATA_TYPE_ud, GtExecMask execMask={1})
 Construct instruction that atomically stores the signed MAX of 'src' value and the [addrReg] value in the profile buffer.
IGtInsMakeAtomicImin (const GtReg &dst, const GtReg &addrReg, const GtReg &src, GtDataType dataType=GED_DATA_TYPE_ud, GtExecMask execMask={1})
 Construct instruction that atomically stores the signed MIN of 'src' value and the [addrReg] value in the profile buffer.
IGtInsMakeAtomicUmax (const GtReg &dst, const GtReg &addrReg, const GtReg &src, GtDataType dataType=GED_DATA_TYPE_ud, GtExecMask execMask={1})
 Construct instruction that atomically stores the unsigned MAX of 'src' value and the [addrReg] value in the profile buffer.
IGtInsMakeAtomicUmin (const GtReg &dst, const GtReg &addrReg, const GtReg &src, GtDataType dataType=GED_DATA_TYPE_ud, GtExecMask execMask={1})
 Construct instruction that atomically stores the unsigned MIN of 'src' value and the [addrReg] value in the profile buffer.
IGtInsMakeAtomicXchg (const GtReg &dst, const GtReg &addrReg, const GtReg &src, GtDataType dataType=GED_DATA_TYPE_ud, GtExecMask execMask={1})
 Construct instruction that atomically exchanges 'src' value with the [addrReg] value in the profile buffer.
IGtInsMakeAtomicStore (const GtReg &addrReg, const GtReg &src, GtDataType dataType=GED_DATA_TYPE_ud, GtExecMask execMask={1})
 Construct instruction that atomically stores 'src' value at the [addrReg] location in the profile buffer.

Detailed Description

Class that defines virtual constructors of IGtIns objects representing various GEN instructions.

GTPin tools mainly use IGtInsFactory interface to make instructions for instrumentation procedures. They receive the IGtGenCoder object along with the IGtKernelInstrument object when GTPin invokes the IGtTool::OnKernelBuild function (

See also:
IGtKernelInstrument::Coder().InstructionFactory()).
Availability:

Member Function Documentation

virtual IGtIns& gtpin::IGtInsFactory::MakeAtomicOp ( GtAtomicOp  aop,
const GtReg dst,
const GtReg addrReg,
const GtReg src,
GtDataType  dataType 
) [pure virtual]

Construct instruction that atomically accesses data in the profile buffer.

Parameters:
[in]aopOpcode of the atomic operation
[in]dstRegister that receives output of the atomic operation. NullReg() indicates that no output data is requested
[in]addrRegRegister that specifies address of data within profile buffer to be modified by the atomic operation.
[in]srcRegister that holds the input data of the atomic operation, or NullReg() if this operation has no sources
[in]dataTypeType of the SIMD data element the instruction operates on. 32-bit integers (GED_DATA_TYPE_ud) are supported in all platforms. For any other type, check CanAccessAtomically(dataType).
[in]execMaskSpecifies SIMD data elements to be accesed by the instruction. Indirectly, this paramter also specifies the total data size.
Precondition:
addrReg, dst, and src registers are zero-aligned: GtReg::SubRegNum() == 0 for physical register, and IGtVreg::RequiredSubregNum() == 0 for virtual register. Virtual registers created by IGtVregFactory::MakeMsgAddrScratch() and IGtVregFactory::MakeMsgDataScratch() satisfy this requirement.
virtual IGtIns& gtpin::IGtInsFactory::MakeRegMov ( const GtReg dst,
const GtReg src0 
) [pure virtual]

Construct an instruction that moves all bytes of src0 to dst.

Precondition:
dst.ElementSize() == src0.ElementSize()
virtual IGtIns& gtpin::IGtInsFactory::MakeSendMsg ( const GtReg dst,
const GtReg src0,
const GtReg src1,
uint32_t  exDesc,
uint32_t  desc 
) [pure virtual]

Construct a SendMessage instruction: send (execMask) dst<Reg> src0<Reg> src1<Reg> exDesc<Imm>, desc<Imm>

Note:
This function ignores GtReg::SubRegNum() and GtReg::ElementSize() in the operands specifications.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator


  Copyright (C) 2013-2025 Intel Corporation
SPDX-License-Identifier: MIT