Go to the documentation of this file.
158 std::ostream& o,
const TCEString& origPat,
161 std::ostream& o,
Operation& op,
bool skipPattern,
162 std::vector<TDGenerator::ValueType> inputs,
163 std::vector<TDGenerator::ValueType> outputs,
169 const std::string regName,
170 const std::string regTemplate,
171 const std::string aliases,
192 std::ostream& o,
Operation& op,
bool skipPattern);
195 const TCEString& attributes,
bool skipPattern);
199 std::ostream& o,
Operation& op,
bool skipPattern);
201 std::ostream& o,
Operation& op,
bool skipPattern);
217 std::ostream& o)
const;
223 std::ostream& o)
const;
232 std::ostream& o)
const;
234 std::ostream& o)
const;
239 std::ostream& o)
const;
261 std::ostream& o,
Operation& op,
const std::string& operandTypes,
262 const std::string& attrs,
bool skipPattern,
263 std::string backendPrefix =
"");
267 const std::string& operandTypes);
283 const Operation& op,
char operandType =
' ')
const;
290 std::set<std::string>* recursionCycleCheck = NULL,
291 bool recursionHasStore =
false);
294 std::set<std::string>* recursionCycleCheck = NULL,
295 bool recursionHasStore =
false);
308 const std::string& immDefName =
"");
313 const std::string& operandTypes);
319 const std::string& operandTypes,
325 const std::string& operandTypes,
const Operation* emulatingOp =
nullptr,
330 const std::string& operandTypes);
342 bool writePredicatedVersions);
359 std::ostream& o,
Operation& op,
const std::string& operandTypes,
360 const std::string& attrs,
bool skipPattern,
361 std::string backendPrefix =
"");
366 std::ostream& o,
Operation& op,
int bitsize,
int vectorLen);
376 bool addrImm,
const TCEString& resultType,
377 const TCEString& loadPatternName,
bool writePredicatedVersions);
380 std::ostream& o,
const std::string& defName,
381 const std::string& operandType,
const std::string& predicate);
383 std::ostream& o,
const std::string& instrDefName,
384 const std::string& outs,
const std::string& ins,
385 const std::string& asmString,
const std::string& pattern);
394 int64_t lowerBoundInclusive,
395 uint64_t upperBoundInclusive);
401 const std::string& operandTypes)
const;
427 std::ostream& os,
const TCEString& nodeName,
450 const Operation& op,
const std::string& operandTypes,
451 const std::string& operand0,
const std::string& operand1)
const;
457 const char& opdType,
const std::string& inputPattern)
const;
517 std::map<int, std::vector<TDGenerator::RegisterInfo> >
registers_;
545 std::map<std::pair<TCEString, std::vector<int>>,
TCEString>
588 std::map<std::string, RegInfo>
regs_;
628 typedef std::map<std::string, std::vector<std::string> >
RegClassMap;
647 unsigned regIndex,
unsigned regWidth)
701 int width,
bool onlyInts =
false);
731 std::vector<RegisterInfo>
registers()
const;
unsigned int requiredI64Regs_
std::vector< std::string > gprRegNames_
unsigned regWidth_
Register width in bits.
void createEndiannesQuery(std::ostream &os)
TCEString regFileName_
Name of the register file the register belongs to, e.g. "RF".
bool writePortGuardedJumpDefPair(std::ostream &os, const TCEString &tceop1, const TCEString &tceop2, bool fp=false)
void genGeneratedTCEPlugin_getVectorShuffle2Opcode(std::ostream &o) const
static const char OT_REG_FP
void write16bitRegisterInfo(std::ostream &o)
void genTCETargetLoweringSIMD_associatedVectorRegClass(std::ostream &o) const
void genGeneratedTCEPlugin_getExtractElemOpcode(std::ostream &o) const
static const char OT_REG_INT
const OperationDAG * getMatchableOperationDAG(const Operation &op)
void writeVectorStoreDefs(std::ostream &o, const TCEString &opName, const TCEString &opNameSuffix, bool addrImm, const TCEString &dataType, bool writePredicatedVersions)
void writeHWLoopDef(std::ostream &o)
std::map< TCEString, TCEString > vshuffle2Operations_
Contains machine's VSHUFFLE2 instructions (<ValueType, InstrName>).
void writeBooleanStorePatterns(std::ostream &os)
unsigned regIndex_
Register index in the register file.
std::map< TCEString, TCEString > iorSameOperations_
Contains machine's IORSAME instructions (<ValueType, InstrName>).
bool checkRequiredRegisters()
std::vector< std::string > resRegNames_
void createConstantMaterializationQuery(std::ostream &os)
void writeConstShiftPat(std::ostream &os, const TCEString &nodeName, const TCEString &opNameBase, int i)
TCEString instrName_
The instruction record name, e.g. "ADD32X4uuu".
void writeVectorRegisterClasses(std::ostream &o) const
static const char OT_IMM_HFP
static const char OT_VREG_INT32
RegisterClass(const ValueType &vt, const TCEString &name)
bool canBeImmediate(const OperationDAG &dag, const TerminalNode &node)
std::map< TCEString, TDGenerator::InstructionInfo > immediateStores_
All immediate store operations (<ValueType, InstrInfo>).
void write64bitRegisterInfo(std::ostream &o)
RegisterInfo registerInfo(int index) const
ValueType valueType() const
unsigned int requiredI32Regs_
Minimum number of 32 bit registers.
bool operator<(const RegInfo &other) const
static const char OT_VREG_BOOL
void writeVectorBitConversions(std::ostream &o) const
static const char OT_IMM_INT
static const std::set< TCEString > SUPPORTED_LLVM_VALUE_TYPES
Contains all supported LLVM value types (<ValueType>).
std::string tceOperationPattern(const Operation &op)
std::vector< RegisterInfo > registers() const
std::string operationPattern(const Operation &op, const OperationDAG &dag, const std::string &operandTypes)
std::string createDefaultOperandTypeString(const Operation &op)
void genGeneratedTCEPlugin_getVectorXorSameOpcode(std::ostream &o) const
void createByteExtLoadPatterns(std::ostream &os)
void writeVectorRegisterNames(std::ostream &o)
void writeCallDef(std::ostream &o)
void genGeneratedTCEPlugin_getVectorShrSameOpcode(std::ostream &o) const
void genGeneratedTCEPlugin_getIorOpcode(std::ostream &o) const
int subwCount_
Subword count of the value type.
void genGeneratedTCEPlugin_getVectorValueType(std::ostream &o) const
std::vector< RegInfo > regs16bit_
TCEString associatedVectorRegisterClass(const Operand &operand) const
void addRegisters(const std::vector< RegisterInfo > ®isters)
std::map< std::string, std::string > truePredOps_
int subwordWidthOfRawData(const Operation &op) const
static const int BOOL_SUBW_WIDTH
Bool type subword width.
void writeOperationDefs(std::ostream &o, Operation &op, bool skipPattern)
void writeCallSeqStart(std::ostream &os)
void writeInstrInfo(std::ostream &o)
void writeVectorImmediateWriteDefs(std::ostream &instrInfoTD)
void analyzeMachineRegisters()
std::map< std::string, std::string > falsePredOps_
std::map< std::string, std::vector< std::string > > RegClassMap
unsigned int argRegCount_
virtual void createVectorRVDRegNums(std::ostream &os)
std::map< TCEString, Operation * > scalarOps_
Contains all scalar operations (<Name, Operation>).
void genGeneratedTCEPlugin_getVectorSelectOpcode(std::ostream &o) const
virtual TCEString llvmOperationPattern(const Operation &op, char operandType=' ') const
static const char OT_REG_BOOL
static std::vector< std::string > supportedStackAccessOperations(const TTAMachine::Machine &mach)
static const char OT_VREG_HFP
void genGeneratedTCEPlugin_getVectorShuffle1Opcode(std::ostream &o) const
void write32bitRegisterInfo(std::ostream &o)
void genGeneratedTCEPlugin_getVectorShlSameOpcode(std::ostream &o) const
void orderEqualWidthRegistersToRoundRobin()
std::set< RegInfo > guardedRegs_
List of register that are associated with a guard on a bus.
static const char OT_REG_LONG
void writeScalarToVectorDefs(std::ostream &o) const
void writeVectorRegisterMoveDefs(std::ostream &o)
void writeVectorOperationDefs(std::ostream &o, Operation &op, bool skipPattern)
std::map< TCEString, TCEString > xorSameOperations_
Contains machine's XORSAME instructions (<ValueType, InstrName>).
static const char OT_VREG_INT8
void genGeneratedTCEPlugin_getLoad(std::ostream &o) const
void writeInstrDef(std::ostream &o, const std::string &instrDefName, const std::string &outs, const std::string &ins, const std::string &asmString, const std::string &pattern)
void writeVectorMemoryOperationDefs(std::ostream &o, Operation &op, bool skipPattern)
void write64bitMoveDefs(std::ostream &o)
std::vector< RegInfo > regs8bit_
std::map< TCEString, TCEString > vbcastOperations_
Contains machine's VBCAST instructions (<ValueType, InstrName>).
bool isVectorStoreOperation(const Operation &op) const
std::map< TCEString, TCEString > shlOperations_
Contains machine's shl instructions (<ValueType, InstrName>).
void generateBackend(std::string &path)
bool areImmediateOperandsLegal(const Operation &operation, const std::string &operandTypes) const
bool isVectorLoadOperation(const Operation &op) const
void writeGetPointerAdjustmentQuery(std::ostream &os) const
void genGeneratedTCEPlugin_getVectorShruSameOpcode(std::ostream &o) const
int alignment_
RegisterClass alignment in bits, at least 8.
OperationDAGSelector::OperationSet allOpNames_
Contains all operation names in upper case.
static const char OT_VREG_INT16
static ValueType valueType(const TCEString &vtStr)
void writeBroadcastDefs(std::ostream &o, Operation &op, int vectorLen)
void writeOperandDefs(std::ostream &o)
bool hasRegisterClassSupport(const Operation &op) const
void writeVectorLoadDefs(std::ostream &o, const TCEString &opName, const TCEString &opNameSuffix, bool addrImm, const TCEString &resultType, const TCEString &loadPatternName, bool writePredicatedVersions)
void writeVectorAnyextPattern(std::ostream &o, Operation &op, const TCEString &loadPatternName, int vectorLen)
bool hasConditionalMoves_
void genGeneratedTCEPlugin_getVectorIorSameOpcode(std::ostream &o) const
void genTCETargetLoweringSIMD_addVectorRegisterClasses(std::ostream &o) const
OperationDAG * createTrivialDAG(Operation &op)
std::map< TCEString, TDGenerator::RegisterClass > vRegClasses_
Contains required vector register classes (<ValueType, RegClass>).
void writeStartOfRegisterInfo(std::ostream &o)
void writeTopLevelTD(std::ostream &o)
std::map< TCEString, TDGenerator::InstructionInfo > registerStores_
All register store operations (<ValueType, InstrInfo>).
static std::vector< ValueType > vectorTypesOfSubwordWidth(int subwordWidth, bool onlyInt=false)
void writeCallingConvLicenceText(std::ostream &os)
virtual void createMinMaxGenerator(std::ostream &os)
std::map< TCEString, TDGenerator::InstructionInfo > immediateLoads_
All immediate load operations (<ValueType, InstrInfo>).
std::set< const TTAMachine::RegisterFile *, TTAMachine::MachinePart::Comparator > tempRegFiles_
Register files whose last reg reserved for temp reg copies.
std::string immediatePredicate(int64_t lowerBoundInclusive, uint64_t upperBoundInclusive)
void writeIntegerImmediateDefs(std::ostream &o, const ImmInfo &iivis)
RegClassMap regsInRFClasses_
TCEString getLLVMPatternWithConstants(const Operation &op, const std::string &operandTypes, const std::string &operand0, const std::string &operand1) const
std::map< TCEString, TCEString > extractElemOperations_
Contains machine's EXTRACTELEM instructions (<ValueType, InstrName>).
std::map< TCEString, TCEString > addOperations_
Contains machine's add instructions (<ValueType, InstrName>).
void analyzeRegisterFileClasses()
void writeAddressingModeDefs(std::ostream &o)
std::string operationNodeToString(const Operation &op, const OperationDAG &dag, const OperationNode &node, bool emulationPattern, const std::string &operandTypes)
ValueType & operator=(const ValueType &other)
void genGeneratedTCEPlugin_getVectorPackOpcode(std::ostream &o) const
void saveAdditionalVectorOperationInfo(const Operation &op, const TCEString &valueTypes, bool isRegisterOp)
int subwWidth_
Subword width of the value type.
void writeGuardRegisterClassInfo(std::ostream &o)
TCEString osalOpName_
The OSAL operation used to create the record, e.g. "ADD32X4".
bool canBePredicated(Operation &op, const std::string &operandTypes)
void writeVectorLoadStoreOperationExploitations(std::ostream &o)
bool isWrongEndianessVectorOp(const Operation &op) const
virtual std::string operandToString(const Operand &operand, bool match, char operandType, const std::string &immDefName="")
void writeOperationDef(std::ostream &o, Operation &op, const std::string &operandTypes, const std::string &attrs, bool skipPattern, std::string backendPrefix="")
static const int FP_SUBW_WIDTH
Float type subword width.
std::map< int, TCEString > baseClasses_
Contains vector base classes for register files (<Width, Name>).
void genTCERegisterInfo_setReservedVectorRegs(std::ostream &os) const
std::vector< RegisterInfo > registers_
Register file registers that this RegisterClass uses.
RegisterClass & operator=(const RegisterClass &other)
void writeArgRegsArray(std::ostream &os)
std::map< TCEString, TCEString > vshuffle1Operations_
Contains machine's VSHUFFLE1 instructions (<ValueType, InstrName>).
std::string subPattern(const Operation &op, const OperationDAG &dag)
static const std::map< TCEString, TCEString > OPERATION_PATTERNS_
Contains <BaseOpName, OpPattern> key-value pairs.
std::map< TCEString, TCEString > gatherOperations_
Contains machine's GATHER instructions (<ValueType, InstrName>).
void genGeneratedTCEPlugin_getLoadOpcode(std::ostream &o) const
std::map< int, std::vector< TDGenerator::RegisterInfo > > registers_
Contains registers fit for being vector registers (<Width, Registers>).
bool isSupportedByLLVM() const
void genGeneratedTCEPlugin_getStore(std::ostream &o) const
const TTAMachine::Machine & mach_
TCEString regName_
Register name in GenRegisterInfo.td, e.g. "KLUDGE_REGISTER".
void write8bitRegisterInfo(std::ostream &o)
void writeOperationDefUsingGivenOperandTypes(std::ostream &o, Operation &op, bool skipPattern, std::vector< TDGenerator::ValueType > inputs, std::vector< TDGenerator::ValueType > outputs, TCEString instrSuffix="")
std::map< TCEString, TCEString > shlSameOperations_
Contains machine's SHLSAME instructions (<ValueType, InstrName>).
bool hasRawOperands(const Operation &op) const
std::map< std::string, std::string > opNames_
void createBranchAnalysis(std::ostream &os)
bool isFloat_
If true, the value type is a floating point type.
void writeWiderVectorOperationExploitations(std::ostream &o)
static const int MAX_SCALAR_WIDTH
Distincts wide vs scalar registers.
static const bool EXPLOIT_BIGGER_REGISTERS
If set to true, smaller vector value types can be stored to larger register files,...
static const std::string guardRegTemplateName
TCETools::CIStringSet OperationSet
void writeRegisterDef(std::ostream &o, const RegInfo ®, const std::string regName, const std::string regTemplate, const std::string aliases, RegType type)
bool prebypassStackIndeces_
virtual char operandChar(Operand &operand)
ValueType(int subwWidth, int subwCount, bool isFloat)
void genGeneratedTCEPlugin_isVectorRegisterMove(std::ostream &o) const
TDGen(const TTAMachine::Machine &mach)
virtual void writeImmediateDef(std::ostream &o, const std::string &defName, const std::string &operandType, const std::string &predicate)
RegClassMap regsInClasses_
All registers in certain group.
std::vector< RegInfo > regs32bit_
static const int HFP_SUBW_WIDTH
Half float type subword width.
TCEString getMovePattern(const char &opdType, const std::string &inputPattern) const
void create32BitExtLoadPatterns(std::ostream &os)
void writeControlFlowInstrDefs(std::ostream &os)
void createGetMaxMemoryAlignment(std::ostream &os) const
void writeRARegisterInfo(std::ostream &o)
void genGeneratedTCEPlugin_getVectorAndSameOpcode(std::ostream &o) const
bool writeRegisterInfo(std::ostream &o)
void writePatternReplacement(std::ostream &o, const TCEString &origPat, const TCEString &replacerPat) const
void createMinMaxDef(const TCEString &opName, const TCEString &valueName, std::ostream &os)
std::map< TCEString, Operation * > vectorOps_
Contains all vector operations (<Name, Operation>).
static const char OT_IMM_LONG
void writeVectorRegisterBaseClasses(std::ostream &o) const
void writeCallingConv(std::ostream &os)
InstructionInfo(const TCEString &osalOpName, const TCEString &instrName)
void writeVectorTruncStoreDefs(std::ostream &o) const
void analyzeMachineVectorRegisterClasses()
void verbose(const TCEString &msg) const
std::map< TCEString, TCEString > shrSameOperations_
Contains machine's SHRSAME instructions (<ValueType, InstrName>).
static const char OT_REG_DOUBLE
void writeBackendCode(std::ostream &o)
void writeCondBranchDefs(std::ostream &os)
void writeMoveImmediateDefs(std::ostream &o)
std::string immediateOperandNameForEmulatedOperation(const OperationDAG &, const Operand &operand)
static const char OT_VREG_FP
void writeVectorOperationDef(std::ostream &o, Operation &op, TCEString valueTypes, const TCEString &attributes, bool skipPattern)
void writeRegisterClasses(std::ostream &o)
virtual void createConstantMaterializationPatterns(std::ostream &os)
std::vector< RegInfo > regs1bit_
std::map< std::string, RegInfo > regs_
Map of generated llvm register names to physical register in the machine.
std::string dagNodeToString(const Operation &op, const OperationDAG &dag, const OperationDAGNode &node, bool emulationPattern, const std::string &operandTypes, const Operation *emulatingOp=nullptr, const OperationDAGNode *successor=nullptr)
ValueType vt_
Value type that is supported by this RegisterClass, e.g. v4i32.
size_t numberOfRegisters() const
std::map< TCEString, TCEString > packOperations_
Contains machine's PACK instructions (<ValueType, InstrName>).
static std::vector< ValueType > vectorTypesOfWidth(int width, bool onlyInts=false)
std::map< TCEString, TCEString > andSameOperations_
Contains machine's ANDSAME instructions (<ValueType, InstrName>).
bool isVectorBitwiseOperation(const Operation &op) const
void genGeneratedTCEPlugin_getShlOpcode(std::ostream &o) const
std::string patOutputs(const Operation &op, const std::string &oprTypes)
void writeInstrFormats(std::ostream &o)
void createVectorMinMaxDef(const TCEString &opName, int bits, char llvmTypeChar, const TCEString &postFix, std::ostream &os)
virtual void writeCallDefRegs(std::ostream &o)
std::map< TCEString, TCEString > shruSameOperations_
Contains machine's SHRUSAME instructions (<ValueType, InstrName>).
void gatherAllMachineOperations()
void createShortExtLoadPatterns(std::ostream &os)
std::string constantNodeString(const Operation &op, const OperationDAG &dag, const ConstantNode &node, const std::string &operandTypes, const OperationDAGNode *successor=nullptr)
std::vector< std::string > constantMaterializationPredicates_
All predicates used in constant materialization patterns.
void genGeneratedTCEPlugin_getGatherOpcode(std::ostream &o) const
void writeScalarOperationExploitations(std::ostream &o)
std::map< TCEString, TDGenerator::InstructionInfo > registerLoads_
All register load operations (<ValueType, InstrInfo>).
std::vector< std::string > argRegNames_
void genGeneratedTCEPlugin_getVectorBroadcastOpcode(std::ostream &o) const
std::string patInputs(const Operation &op, const std::string &oprTypes)
bool operationDAGCanBeMatched(const OperationDAG &op, std::set< std::string > *recursionCycleCheck=NULL, bool recursionHasStore=false)
std::map< TCEString, TCEString > iorOperations_
Contains machine's shl instructions (<ValueType, InstrName>).
void createParamDRegNums(std::ostream &os)
TCEString valueTypeStr() const
void genGeneratedTCEPlugin_getVectorImmediateOpcode(std::ostream &o) const
void writeVectorBitwiseOperationDefs(std::ostream &o, Operation &op, bool skipPattern)
std::vector< std::pair< const Operation *, TCEString > > truncOperations_
Contains machine's TRUNCxx/CFH instructions (<ValueType, InstrName>).
std::vector< std::string > llvmGuardRegs_
The LLVM register defs used as guards.
void createBoolAndHalfLoadPatterns(std::ostream &os)
std::string emulatingOpNodeLLVMName(const Operation &op, const OperationDAG &dag, const OperationNode &node, const std::string &operandTypes)
char operandTypeToRegister(const char &opdType) const
std::map< ImmInfoKey, std::string > immOperandDefs_
Maps (operation, operand) pairs to i32 immediate operand definition names.
void associateRegistersWithVectorRegisterClasses()
Operand::OperandType operandType() const
void writeMiscPatterns(std::ostream &o)
bool operationCanBeMatched(const Operation &op, std::set< std::string > *recursionCycleCheck=NULL, bool recursionHasStore=false)
RegisterInfo(const TCEString ®Name, const TCEString ®FileName, unsigned regIndex, unsigned regWidth)
void createConstShiftPatterns(std::ostream &os)
std::map< std::pair< TCEString, std::vector< int > >, TCEString > vcshuffleOperations_
Contains machine's VCSHUFFLE instructions (<<ValueType, ConstantSelects>, InstrName>).
void genTCEInstrInfoSIMD_copyPhysVectorReg(std::ostream &o) const
virtual TCEString llvmOperationName(const TCEString &opName) const
void writeEmulationPattern(std::ostream &o, const Operation &op, const OperationDAG &dag)
void write1bitRegisterInfo(std::ostream &o)
void genTCEInstrInfo_copyPhys64bitReg(std::ostream &o) const
TCEString name_
RegisterClass name.
std::set< TCEString > movOperations_
Contains all moves between register classes (<InstrName>).
void genGeneratedTCEPlugin_getAddOpcode(std::ostream &o) const
std::vector< RegInfo > regs64bit_
void generateLoadStoreCopyGenerator(std::ostream &os)
virtual void createSelectPatterns(std::ostream &os)
std::string operandTypesToRegisters(const std::string &opdTypes) const
std::map< TCEString, TCEString > vselectOperations_
Contains machine's VSELECT instructions (<instrName, ValueType>).
static const char OT_IMM_BOOL
static const char OT_IMM_FP
void genGeneratedTCEPlugin_getConstantVectorShuffleOpcode(std::ostream &o) const
static const int MAX_SUBW_COUNT
Maximum number of subwords that any SIMD operation can have.
static const char OT_REG_HFP
void genTCETargetLoweringSIMD_getSetCCResultVT(std::ostream &o) const