Lines Matching refs:OS
60 void run(raw_ostream &OS);
63 void emitEnums(raw_ostream &OS);
81 void emitTIIHelperMethods(raw_ostream &OS, StringRef TargetName,
86 void emitMCIIHelperMethods(raw_ostream &OS, StringRef TargetName);
89 void emitFeatureVerifier(raw_ostream &OS, const CodeGenTarget &Target);
93 const OperandInfoMapTy &OperandInfo, raw_ostream &OS);
95 raw_ostream &OS, const CodeGenTarget &Target,
103 raw_ostream &OS, const CodeGenTarget &Target,
107 raw_ostream &OS, StringRef Namespace,
110 raw_ostream &OS, StringRef Namespace,
116 void EmitOperandInfo(raw_ostream &OS, OperandInfoListTy &OperandInfoList);
229 void InstrInfoEmitter::EmitOperandInfo(raw_ostream &OS, in EmitOperandInfo() argument
233 OS << " /* " << Offset << " */"; in EmitOperandInfo()
235 OS << " { " << Info << " },"; in EmitOperandInfo()
236 OS << '\n'; in EmitOperandInfo()
283 raw_ostream &OS, const CodeGenTarget &Target, in emitOperandNameMappings() argument
294 OS << "#ifdef GET_INSTRINFO_OPERAND_ENUM\n"; in emitOperandNameMappings()
295 OS << "#undef GET_INSTRINFO_OPERAND_ENUM\n"; in emitOperandNameMappings()
296 OS << "namespace llvm {\n"; in emitOperandNameMappings()
297 OS << "namespace " << Namespace << " {\n"; in emitOperandNameMappings()
298 OS << "namespace " << OpNameNS << " {\n"; in emitOperandNameMappings()
299 OS << "enum {\n"; in emitOperandNameMappings()
301 OS << " " << Op.first << " = " << Op.second << ",\n"; in emitOperandNameMappings()
303 OS << " OPERAND_LAST"; in emitOperandNameMappings()
304 OS << "\n};\n"; in emitOperandNameMappings()
305 OS << "} // end namespace OpName\n"; in emitOperandNameMappings()
306 OS << "} // end namespace " << Namespace << "\n"; in emitOperandNameMappings()
307 OS << "} // end namespace llvm\n"; in emitOperandNameMappings()
308 OS << "#endif //GET_INSTRINFO_OPERAND_ENUM\n\n"; in emitOperandNameMappings()
310 OS << "#ifdef GET_INSTRINFO_NAMED_OPS\n"; in emitOperandNameMappings()
311 OS << "#undef GET_INSTRINFO_NAMED_OPS\n"; in emitOperandNameMappings()
312 OS << "namespace llvm {\n"; in emitOperandNameMappings()
313 OS << "namespace " << Namespace << " {\n"; in emitOperandNameMappings()
314 OS << "LLVM_READONLY\n"; in emitOperandNameMappings()
315 OS << "int16_t getNamedOperandIdx(uint16_t Opcode, uint16_t NamedIdx) {\n"; in emitOperandNameMappings()
317 OS << " static const int16_t OperandMap [][" << Operands.size() in emitOperandNameMappings()
321 OS << "{"; in emitOperandNameMappings()
325 OS << (OpList.count(i) == 0 ? -1 : (int)OpList.find(i)->second) << ", "; in emitOperandNameMappings()
327 OS << "},\n"; in emitOperandNameMappings()
329 OS << "};\n"; in emitOperandNameMappings()
331 OS << " switch(Opcode) {\n"; in emitOperandNameMappings()
335 OS << " case " << Name << ":\n"; in emitOperandNameMappings()
337 OS << " return OperandMap[" << TableIndex++ << "][NamedIdx];\n"; in emitOperandNameMappings()
339 OS << " default: return -1;\n"; in emitOperandNameMappings()
340 OS << " }\n"; in emitOperandNameMappings()
343 OS << " return -1;\n"; in emitOperandNameMappings()
345 OS << "}\n"; in emitOperandNameMappings()
346 OS << "} // end namespace " << Namespace << "\n"; in emitOperandNameMappings()
347 OS << "} // end namespace llvm\n"; in emitOperandNameMappings()
348 OS << "#endif //GET_INSTRINFO_NAMED_OPS\n\n"; in emitOperandNameMappings()
355 raw_ostream &OS, const CodeGenTarget &Target, in emitOperandTypeMappings() argument
365 OS << "#ifdef GET_INSTRINFO_OPERAND_TYPES_ENUM\n"; in emitOperandTypeMappings()
366 OS << "#undef GET_INSTRINFO_OPERAND_TYPES_ENUM\n"; in emitOperandTypeMappings()
367 OS << "namespace llvm {\n"; in emitOperandTypeMappings()
368 OS << "namespace " << Namespace << " {\n"; in emitOperandTypeMappings()
369 OS << "namespace OpTypes {\n"; in emitOperandTypeMappings()
370 OS << "enum OperandType {\n"; in emitOperandTypeMappings()
377 OS << " " << Op->getName() << " = " << EnumVal << ",\n"; in emitOperandTypeMappings()
382 OS << " OPERAND_TYPE_LIST_END" in emitOperandTypeMappings()
384 OS << "} // end namespace OpTypes\n"; in emitOperandTypeMappings()
385 OS << "} // end namespace " << Namespace << "\n"; in emitOperandTypeMappings()
386 OS << "} // end namespace llvm\n"; in emitOperandTypeMappings()
387 OS << "#endif // GET_INSTRINFO_OPERAND_TYPES_ENUM\n\n"; in emitOperandTypeMappings()
389 OS << "#ifdef GET_INSTRINFO_OPERAND_TYPE\n"; in emitOperandTypeMappings()
390 OS << "#undef GET_INSTRINFO_OPERAND_TYPE\n"; in emitOperandTypeMappings()
391 OS << "namespace llvm {\n"; in emitOperandTypeMappings()
392 OS << "namespace " << Namespace << " {\n"; in emitOperandTypeMappings()
393 OS << "LLVM_READONLY\n"; in emitOperandTypeMappings()
394 OS << "static int getOperandType(uint16_t Opcode, uint16_t OpIdx) {\n"; in emitOperandTypeMappings()
424 OS << " static const " << getMinimalTypeForRange(OperandRecords.size()); in emitOperandTypeMappings()
425 OS << " Offsets[] = {\n"; in emitOperandTypeMappings()
427 OS << " /* " << getInstrName(I) << " */\n"; in emitOperandTypeMappings()
428 OS << " " << OperandOffsets[I] << ",\n"; in emitOperandTypeMappings()
430 OS << " };\n"; in emitOperandTypeMappings()
439 OS << "\n using namespace OpTypes;\n"; in emitOperandTypeMappings()
440 OS << " static"; in emitOperandTypeMappings()
441 OS << ((EnumVal <= INT8_MAX) ? " const int8_t" : " const int16_t"); in emitOperandTypeMappings()
442 OS << " OpcodeOperandTypes[] = {\n "; in emitOperandTypeMappings()
446 OS << "\n /* " << getInstrName(CurOffset) << " */\n "; in emitOperandTypeMappings()
448 OS << "/* " << getInstrName(CurOffset) << " */\n "; in emitOperandTypeMappings()
455 OS << OpR->getName(); in emitOperandTypeMappings()
457 OS << -1; in emitOperandTypeMappings()
458 OS << ", "; in emitOperandTypeMappings()
460 OS << "\n };\n"; in emitOperandTypeMappings()
462 OS << " return OpcodeOperandTypes[Offsets[Opcode] + OpIdx];\n"; in emitOperandTypeMappings()
464 OS << " llvm_unreachable(\"No instructions defined\");\n"; in emitOperandTypeMappings()
466 OS << "}\n"; in emitOperandTypeMappings()
467 OS << "} // end namespace " << Namespace << "\n"; in emitOperandTypeMappings()
468 OS << "} // end namespace llvm\n"; in emitOperandTypeMappings()
469 OS << "#endif // GET_INSTRINFO_OPERAND_TYPE\n\n"; in emitOperandTypeMappings()
471 OS << "#ifdef GET_INSTRINFO_MEM_OPERAND_SIZE\n"; in emitOperandTypeMappings()
472 OS << "#undef GET_INSTRINFO_MEM_OPERAND_SIZE\n"; in emitOperandTypeMappings()
473 OS << "namespace llvm {\n"; in emitOperandTypeMappings()
474 OS << "namespace " << Namespace << " {\n"; in emitOperandTypeMappings()
475 OS << "LLVM_READONLY\n"; in emitOperandTypeMappings()
476 OS << "static int getMemOperandSize(int OpType) {\n"; in emitOperandTypeMappings()
477 OS << " switch (OpType) {\n"; in emitOperandTypeMappings()
485 OS << " default: return 0;\n"; in emitOperandTypeMappings()
488 OS << " case OpTypes::" << OperandName << ":\n"; in emitOperandTypeMappings()
489 OS << " return " << KV.first << ";\n\n"; in emitOperandTypeMappings()
491 OS << " }\n}\n"; in emitOperandTypeMappings()
492 OS << "} // end namespace " << Namespace << "\n"; in emitOperandTypeMappings()
493 OS << "} // end namespace llvm\n"; in emitOperandTypeMappings()
494 OS << "#endif // GET_INSTRINFO_MEM_OPERAND_SIZE\n\n"; in emitOperandTypeMappings()
498 raw_ostream &OS, StringRef Namespace, in emitLogicalOperandSizeMappings() argument
526 OS << "#ifdef GET_INSTRINFO_LOGICAL_OPERAND_SIZE_MAP\n"; in emitLogicalOperandSizeMappings()
527 OS << "#undef GET_INSTRINFO_LOGICAL_OPERAND_SIZE_MAP\n"; in emitLogicalOperandSizeMappings()
528 OS << "namespace llvm {\n"; in emitLogicalOperandSizeMappings()
529 OS << "namespace " << Namespace << " {\n"; in emitLogicalOperandSizeMappings()
530 OS << "LLVM_READONLY static unsigned\n"; in emitLogicalOperandSizeMappings()
531 OS << "getLogicalOperandSize(uint16_t Opcode, uint16_t LogicalOpIdx) {\n"; in emitLogicalOperandSizeMappings()
538 OS << " static const unsigned SizeMap[][" << LogicalOpListSize in emitLogicalOperandSizeMappings()
542 OS << " {"; in emitLogicalOperandSizeMappings()
545 OS << Row[i] << ", "; in emitLogicalOperandSizeMappings()
548 OS << "0, "; in emitLogicalOperandSizeMappings()
550 OS << "}, "; in emitLogicalOperandSizeMappings()
551 OS << "\n"; in emitLogicalOperandSizeMappings()
553 OS << " };\n"; in emitLogicalOperandSizeMappings()
555 OS << " switch (Opcode) {\n"; in emitLogicalOperandSizeMappings()
556 OS << " default: return LogicalOpIdx;\n"; in emitLogicalOperandSizeMappings()
561 OS << " case " << Inst << ":\n"; in emitLogicalOperandSizeMappings()
563 OS << " return SizeMap[" << OpMapIdx << "][LogicalOpIdx];\n"; in emitLogicalOperandSizeMappings()
565 OS << " }\n"; in emitLogicalOperandSizeMappings()
567 OS << " return LogicalOpIdx;\n"; in emitLogicalOperandSizeMappings()
569 OS << "}\n"; in emitLogicalOperandSizeMappings()
571 OS << "LLVM_READONLY static inline unsigned\n"; in emitLogicalOperandSizeMappings()
572 OS << "getLogicalOperandIdx(uint16_t Opcode, uint16_t LogicalOpIdx) {\n"; in emitLogicalOperandSizeMappings()
573 OS << " auto S = 0U;\n"; in emitLogicalOperandSizeMappings()
574 OS << " for (auto i = 0U; i < LogicalOpIdx; ++i)\n"; in emitLogicalOperandSizeMappings()
575 OS << " S += getLogicalOperandSize(Opcode, i);\n"; in emitLogicalOperandSizeMappings()
576 OS << " return S;\n"; in emitLogicalOperandSizeMappings()
577 OS << "}\n"; in emitLogicalOperandSizeMappings()
579 OS << "} // end namespace " << Namespace << "\n"; in emitLogicalOperandSizeMappings()
580 OS << "} // end namespace llvm\n"; in emitLogicalOperandSizeMappings()
581 OS << "#endif // GET_INSTRINFO_LOGICAL_OPERAND_SIZE_MAP\n\n"; in emitLogicalOperandSizeMappings()
585 raw_ostream &OS, StringRef Namespace, in emitLogicalOperandTypeMappings() argument
619 OS << "#ifdef GET_INSTRINFO_LOGICAL_OPERAND_TYPE_MAP\n"; in emitLogicalOperandTypeMappings()
620 OS << "#undef GET_INSTRINFO_LOGICAL_OPERAND_TYPE_MAP\n"; in emitLogicalOperandTypeMappings()
621 OS << "namespace llvm {\n"; in emitLogicalOperandTypeMappings()
622 OS << "namespace " << Namespace << " {\n"; in emitLogicalOperandTypeMappings()
623 OS << "LLVM_READONLY static int\n"; in emitLogicalOperandTypeMappings()
624 OS << "getLogicalOperandType(uint16_t Opcode, uint16_t LogicalOpIdx) {\n"; in emitLogicalOperandTypeMappings()
631 OS << " static const int TypeMap[][" << OpTypeListSize << "] = {\n"; in emitLogicalOperandTypeMappings()
634 OS << " {"; in emitLogicalOperandTypeMappings()
638 OS << ", "; in emitLogicalOperandTypeMappings()
639 OS << Row[i]; in emitLogicalOperandTypeMappings()
643 OS << ", "; in emitLogicalOperandTypeMappings()
644 OS << "-1"; in emitLogicalOperandTypeMappings()
646 OS << "}"; in emitLogicalOperandTypeMappings()
648 OS << ","; in emitLogicalOperandTypeMappings()
649 OS << "\n"; in emitLogicalOperandTypeMappings()
651 OS << " };\n"; in emitLogicalOperandTypeMappings()
653 OS << " switch (Opcode) {\n"; in emitLogicalOperandTypeMappings()
654 OS << " default: return -1;\n"; in emitLogicalOperandTypeMappings()
659 OS << " case " << Inst << ":\n"; in emitLogicalOperandTypeMappings()
661 OS << " return TypeMap[" << OpMapIdx << "][LogicalOpIdx];\n"; in emitLogicalOperandTypeMappings()
663 OS << " }\n"; in emitLogicalOperandTypeMappings()
665 OS << " return -1;\n"; in emitLogicalOperandTypeMappings()
667 OS << "}\n"; in emitLogicalOperandTypeMappings()
668 OS << "} // end namespace " << Namespace << "\n"; in emitLogicalOperandTypeMappings()
669 OS << "} // end namespace llvm\n"; in emitLogicalOperandTypeMappings()
670 OS << "#endif // GET_INSTRINFO_LOGICAL_OPERAND_TYPE_MAP\n\n"; in emitLogicalOperandTypeMappings()
673 void InstrInfoEmitter::emitMCIIHelperMethods(raw_ostream &OS, in emitMCIIHelperMethods() argument
677 OS << "#ifdef GET_INSTRINFO_MC_HELPER_DECLS\n"; in emitMCIIHelperMethods()
678 OS << "#undef GET_INSTRINFO_MC_HELPER_DECLS\n\n"; in emitMCIIHelperMethods()
680 OS << "namespace llvm {\n"; in emitMCIIHelperMethods()
681 OS << "class MCInst;\n"; in emitMCIIHelperMethods()
682 OS << "class FeatureBitset;\n\n"; in emitMCIIHelperMethods()
684 OS << "namespace " << TargetName << "_MC {\n\n"; in emitMCIIHelperMethods()
687 OS << "bool " << Rec->getValueAsString("FunctionName") in emitMCIIHelperMethods()
691 OS << "void verifyInstructionPredicates(unsigned Opcode, const FeatureBitset " in emitMCIIHelperMethods()
694 OS << "\n} // end namespace " << TargetName << "_MC\n"; in emitMCIIHelperMethods()
695 OS << "} // end namespace llvm\n\n"; in emitMCIIHelperMethods()
697 OS << "#endif // GET_INSTRINFO_MC_HELPER_DECLS\n\n"; in emitMCIIHelperMethods()
699 OS << "#ifdef GET_INSTRINFO_MC_HELPERS\n"; in emitMCIIHelperMethods()
700 OS << "#undef GET_INSTRINFO_MC_HELPERS\n\n"; in emitMCIIHelperMethods()
702 OS << "namespace llvm {\n"; in emitMCIIHelperMethods()
703 OS << "namespace " << TargetName << "_MC {\n\n"; in emitMCIIHelperMethods()
709 OS << "bool " << Rec->getValueAsString("FunctionName"); in emitMCIIHelperMethods()
710 OS << "(const MCInst &MI) {\n"; in emitMCIIHelperMethods()
712 OS.indent(PE.getIndentLevel() * 2); in emitMCIIHelperMethods()
713 PE.expandStatement(OS, Rec->getValueAsDef("Body")); in emitMCIIHelperMethods()
714 OS << "\n}\n\n"; in emitMCIIHelperMethods()
717 OS << "} // end namespace " << TargetName << "_MC\n"; in emitMCIIHelperMethods()
718 OS << "} // end namespace llvm\n\n"; in emitMCIIHelperMethods()
720 OS << "#endif // GET_GENISTRINFO_MC_HELPERS\n\n"; in emitMCIIHelperMethods()
731 void InstrInfoEmitter::emitFeatureVerifier(raw_ostream &OS, in emitFeatureVerifier() argument
737 OS << "#if (defined(ENABLE_INSTR_PREDICATE_VERIFIER) && !defined(NDEBUG)) " in emitFeatureVerifier()
742 OS << "#ifdef GET_COMPUTE_FEATURES\n" in emitFeatureVerifier()
749 OS); in emitFeatureVerifier()
751 OS << "inline "; in emitFeatureVerifier()
753 Target.getName(), "", "computeAvailableFeatures", SubtargetFeatures, OS); in emitFeatureVerifier()
780 OS << "inline FeatureBitset computeRequiredFeatures(unsigned Opcode) {\n" in emitFeatureVerifier()
786 OS << " " << getNameForFeatureBitset(FeatureBitset) << ",\n"; in emitFeatureVerifier()
788 OS << " };\n\n" in emitFeatureVerifier()
794 OS << " {"; in emitFeatureVerifier()
798 OS << I->second.getEnumBitName() << ", "; in emitFeatureVerifier()
800 OS << "},\n"; in emitFeatureVerifier()
802 OS << " };\n" in emitFeatureVerifier()
807 OS << " CEFBS"; in emitFeatureVerifier()
812 OS << '_' << I->second.TheDef->getName(); in emitFeatureVerifier()
817 OS << "_None"; in emitFeatureVerifier()
818 OS << ", // " << Inst->TheDef->getName() << " = " << InstIdx << "\n"; in emitFeatureVerifier()
821 OS << " };\n\n" in emitFeatureVerifier()
826 OS << "} // end namespace " << Target.getName() << "_MC\n" in emitFeatureVerifier()
830 OS << "#ifdef GET_AVAILABLE_OPCODE_CHECKER\n" in emitFeatureVerifier()
834 OS << "bool isOpcodeAvailable(" in emitFeatureVerifier()
845 OS << "} // end namespace " << Target.getName() << "_MC\n" in emitFeatureVerifier()
849 OS << "#ifdef ENABLE_INSTR_PREDICATE_VERIFIER\n" in emitFeatureVerifier()
853 OS << "namespace llvm {\n"; in emitFeatureVerifier()
854 OS << "namespace " << Target.getName() << "_MC {\n\n"; in emitFeatureVerifier()
857 OS << "#ifndef NDEBUG\n"; in emitFeatureVerifier()
858 SubtargetFeatureInfo::emitNameTable(SubtargetFeatures, OS); in emitFeatureVerifier()
859 OS << "#endif // NDEBUG\n\n"; in emitFeatureVerifier()
862 OS << "void verifyInstructionPredicates(\n" in emitFeatureVerifier()
865 OS << " FeatureBitset AvailableFeatures = " in emitFeatureVerifier()
867 OS << " FeatureBitset RequiredFeatures = " in emitFeatureVerifier()
869 OS << " FeatureBitset MissingFeatures =\n" in emitFeatureVerifier()
884 OS << "}\n"; in emitFeatureVerifier()
885 OS << "} // end namespace " << Target.getName() << "_MC\n"; in emitFeatureVerifier()
886 OS << "} // end namespace llvm\n"; in emitFeatureVerifier()
887 OS << "#endif // ENABLE_INSTR_PREDICATE_VERIFIER\n\n"; in emitFeatureVerifier()
890 void InstrInfoEmitter::emitTIIHelperMethods(raw_ostream &OS, in emitTIIHelperMethods() argument
901 OS << (ExpandDefinition ? "" : "static ") << "bool "; in emitTIIHelperMethods()
903 OS << TargetName << "InstrInfo::"; in emitTIIHelperMethods()
904 OS << Rec->getValueAsString("FunctionName"); in emitTIIHelperMethods()
905 OS << "(const MachineInstr &MI)"; in emitTIIHelperMethods()
907 OS << ";\n"; in emitTIIHelperMethods()
911 OS << " {\n"; in emitTIIHelperMethods()
912 OS.indent(PE.getIndentLevel() * 2); in emitTIIHelperMethods()
913 PE.expandStatement(OS, Rec->getValueAsDef("Body")); in emitTIIHelperMethods()
914 OS << "\n}\n\n"; in emitTIIHelperMethods()
923 void InstrInfoEmitter::run(raw_ostream &OS) { in run() argument
924 emitSourceFileHeader("Target Instruction Enum Values and Descriptors", OS); in run()
925 emitEnums(OS); in run()
954 OS << "#if defined(GET_INSTRINFO_MC_DESC) || " in run()
956 OS << "namespace llvm {\n\n"; in run()
958 OS << "struct " << TargetName << "InstrTable {\n"; in run()
959 OS << " MCInstrDesc Insts[" << NumberedInstructions.size() << "];\n"; in run()
960 OS << " static_assert(alignof(MCInstrDesc) >= alignof(MCOperandInfo), " in run()
962 OS << " MCOperandInfo OperandInfo[" << OperandInfoSize << "];\n"; in run()
963 OS << " static_assert(alignof(MCOperandInfo) >= alignof(MCPhysReg), " in run()
965 OS << " MCPhysReg ImplicitOps[" << std::max(ImplicitListSize, 1U) << "];\n"; in run()
966 OS << "};\n\n"; in run()
968 OS << "} // end namespace llvm\n"; in run()
969 OS << "#endif // defined(GET_INSTRINFO_MC_DESC) || " in run()
972 OS << "#ifdef GET_INSTRINFO_MC_DESC\n"; in run()
973 OS << "#undef GET_INSTRINFO_MC_DESC\n"; in run()
974 OS << "namespace llvm {\n\n"; in run()
978 OS << "static_assert(sizeof(MCOperandInfo) % sizeof(MCPhysReg) == 0);\n"; in run()
979 OS << "static constexpr unsigned " << TargetName << "ImpOpBase = sizeof " in run()
982 OS << "extern const " << TargetName << "InstrTable " << TargetName in run()
990 emitRecord(*Inst, --Num, InstrInfo, EmittedLists, OperandInfoMap, OS); in run()
993 OS << " }, {\n"; in run()
997 EmitOperandInfo(OS, OperandInfoList); in run()
999 OS << " }, {\n"; in run()
1004 OS << " /* " << EmittedLists[List] << " */"; in run()
1006 OS << ' ' << getQualifiedName(Reg) << ','; in run()
1007 OS << '\n'; in run()
1010 OS << " }\n};\n\n"; in run()
1015 InstrNames.emitStringLiteralDef(OS, Twine("extern const char ") + TargetName + in run()
1018 OS << "extern const unsigned " << TargetName << "InstrNameIndices[] = {"; in run()
1023 OS << "\n "; in run()
1024 OS << InstrNames.get(std::string(Inst->TheDef->getName())) << "U, "; in run()
1027 OS << "\n};\n\n"; in run()
1035 OS << "extern const uint8_t " << TargetName in run()
1040 OS << "\n "; in run()
1043 OS << Target.getInstNamespace() << "::" << Inst->DeprecatedReason in run()
1046 OS << "uint8_t(-1), "; in run()
1049 OS << "\n};\n\n"; in run()
1057 OS << "extern const MCInstrInfo::ComplexDeprecationPredicate " << TargetName in run()
1062 OS << "\n "; in run()
1065 OS << "&get" << Inst->DeprecatedReason << "DeprecationInfo, "; in run()
1067 OS << "nullptr, "; in run()
1070 OS << "\n};\n\n"; in run()
1075 OS << "static inline void Init" << TargetName in run()
1077 OS << " II->InitMCInstrInfo(" << TargetName << "Descs.Insts, " << TargetName in run()
1080 OS << TargetName << "InstrDeprecationFeatures, "; in run()
1082 OS << "nullptr, "; in run()
1084 OS << TargetName << "InstrComplexDeprecationInfos, "; in run()
1086 OS << "nullptr, "; in run()
1087 OS << NumberedInstructions.size() << ");\n}\n\n"; in run()
1089 OS << "} // end namespace llvm\n"; in run()
1091 OS << "#endif // GET_INSTRINFO_MC_DESC\n\n"; in run()
1094 OS << "#ifdef GET_INSTRINFO_HEADER\n"; in run()
1095 OS << "#undef GET_INSTRINFO_HEADER\n"; in run()
1098 OS << "namespace llvm {\n"; in run()
1099 OS << "struct " << ClassName << " : public TargetInstrInfo {\n" in run()
1105 OS << "\n};\n} // end namespace llvm\n"; in run()
1107 OS << "#endif // GET_INSTRINFO_HEADER\n\n"; in run()
1109 OS << "#ifdef GET_INSTRINFO_HELPER_DECLS\n"; in run()
1110 OS << "#undef GET_INSTRINFO_HELPER_DECLS\n\n"; in run()
1111 emitTIIHelperMethods(OS, TargetName, /* ExpandDefinition = */ false); in run()
1112 OS << "\n"; in run()
1113 OS << "#endif // GET_INSTRINFO_HELPER_DECLS\n\n"; in run()
1115 OS << "#ifdef GET_INSTRINFO_HELPERS\n"; in run()
1116 OS << "#undef GET_INSTRINFO_HELPERS\n\n"; in run()
1117 emitTIIHelperMethods(OS, TargetName, /* ExpandDefinition = */ true); in run()
1118 OS << "#endif // GET_INSTRINFO_HELPERS\n\n"; in run()
1120 OS << "#ifdef GET_INSTRINFO_CTOR_DTOR\n"; in run()
1121 OS << "#undef GET_INSTRINFO_CTOR_DTOR\n"; in run()
1123 OS << "namespace llvm {\n"; in run()
1124 OS << "extern const " << TargetName << "InstrTable " << TargetName in run()
1126 OS << "extern const unsigned " << TargetName << "InstrNameIndices[];\n"; in run()
1127 OS << "extern const char " << TargetName << "InstrNameData[];\n"; in run()
1129 OS << "extern const uint8_t " << TargetName in run()
1132 OS << "extern const MCInstrInfo::ComplexDeprecationPredicate " << TargetName in run()
1134 OS << ClassName << "::" << ClassName in run()
1142 OS << TargetName << "InstrDeprecationFeatures, "; in run()
1144 OS << "nullptr, "; in run()
1146 OS << TargetName << "InstrComplexDeprecationInfos, "; in run()
1148 OS << "nullptr, "; in run()
1149 OS << NumberedInstructions.size() << ");\n}\n"; in run()
1150 OS << "} // end namespace llvm\n"; in run()
1152 OS << "#endif // GET_INSTRINFO_CTOR_DTOR\n\n"; in run()
1155 emitOperandNameMappings(OS, Target, NumberedInstructions); in run()
1158 emitOperandTypeMappings(OS, Target, NumberedInstructions); in run()
1161 emitLogicalOperandSizeMappings(OS, TargetName, NumberedInstructions); in run()
1164 emitLogicalOperandTypeMappings(OS, TargetName, NumberedInstructions); in run()
1167 emitMCIIHelperMethods(OS, TargetName); in run()
1170 emitFeatureVerifier(OS, Target); in run()
1176 const OperandInfoMapTy &OperandInfoMap, raw_ostream &OS) { in emitRecord() argument
1189 OS << " { "; in emitRecord()
1190 OS << Num << ",\t" << MinOperands << ",\t" << DefOperands << ",\t" in emitRecord()
1197 OS << Inst.ImplicitUses.size() << ",\t" << Inst.ImplicitDefs.size() << ",\t"; in emitRecord()
1200 OS << Target.getName() << "ImpOpBase + " << EmittedLists[ImplicitOps] in emitRecord()
1205 OS << OperandInfoMap.find(OperandInfo)->second << ",\t0"; in emitRecord()
1209 OS << "|(1ULL<<MCID::PreISelOpcode)"; in emitRecord()
1211 OS << "|(1ULL<<MCID::Pseudo)"; in emitRecord()
1213 OS << "|(1ULL<<MCID::Meta)"; in emitRecord()
1215 OS << "|(1ULL<<MCID::Return)"; in emitRecord()
1217 OS << "|(1ULL<<MCID::EHScopeReturn)"; in emitRecord()
1219 OS << "|(1ULL<<MCID::Branch)"; in emitRecord()
1221 OS << "|(1ULL<<MCID::IndirectBranch)"; in emitRecord()
1223 OS << "|(1ULL<<MCID::Compare)"; in emitRecord()
1225 OS << "|(1ULL<<MCID::MoveImm)"; in emitRecord()
1227 OS << "|(1ULL<<MCID::MoveReg)"; in emitRecord()
1229 OS << "|(1ULL<<MCID::Bitcast)"; in emitRecord()
1231 OS << "|(1ULL<<MCID::Add)"; in emitRecord()
1233 OS << "|(1ULL<<MCID::Trap)"; in emitRecord()
1235 OS << "|(1ULL<<MCID::Select)"; in emitRecord()
1237 OS << "|(1ULL<<MCID::Barrier)"; in emitRecord()
1239 OS << "|(1ULL<<MCID::DelaySlot)"; in emitRecord()
1241 OS << "|(1ULL<<MCID::Call)"; in emitRecord()
1243 OS << "|(1ULL<<MCID::FoldableAsLoad)"; in emitRecord()
1245 OS << "|(1ULL<<MCID::MayLoad)"; in emitRecord()
1247 OS << "|(1ULL<<MCID::MayStore)"; in emitRecord()
1249 OS << "|(1ULL<<MCID::MayRaiseFPException)"; in emitRecord()
1251 OS << "|(1ULL<<MCID::Predicable)"; in emitRecord()
1253 OS << "|(1ULL<<MCID::ConvertibleTo3Addr)"; in emitRecord()
1255 OS << "|(1ULL<<MCID::Commutable)"; in emitRecord()
1257 OS << "|(1ULL<<MCID::Terminator)"; in emitRecord()
1259 OS << "|(1ULL<<MCID::Rematerializable)"; in emitRecord()
1261 OS << "|(1ULL<<MCID::NotDuplicable)"; in emitRecord()
1263 OS << "|(1ULL<<MCID::HasOptionalDef)"; in emitRecord()
1265 OS << "|(1ULL<<MCID::UsesCustomInserter)"; in emitRecord()
1267 OS << "|(1ULL<<MCID::HasPostISelHook)"; in emitRecord()
1269 OS << "|(1ULL<<MCID::Variadic)"; in emitRecord()
1271 OS << "|(1ULL<<MCID::UnmodeledSideEffects)"; in emitRecord()
1273 OS << "|(1ULL<<MCID::CheapAsAMove)"; in emitRecord()
1275 OS << "|(1ULL<<MCID::ExtraSrcRegAllocReq)"; in emitRecord()
1277 OS << "|(1ULL<<MCID::ExtraDefRegAllocReq)"; in emitRecord()
1279 OS << "|(1ULL<<MCID::RegSequence)"; in emitRecord()
1281 OS << "|(1ULL<<MCID::ExtractSubreg)"; in emitRecord()
1283 OS << "|(1ULL<<MCID::InsertSubreg)"; in emitRecord()
1285 OS << "|(1ULL<<MCID::Convergent)"; in emitRecord()
1287 OS << "|(1ULL<<MCID::VariadicOpsAreDefs)"; in emitRecord()
1289 OS << "|(1ULL<<MCID::Authenticated)"; in emitRecord()
1303 OS << ", 0x"; in emitRecord()
1304 OS.write_hex(Value); in emitRecord()
1305 OS << "ULL"; in emitRecord()
1307 OS << " }, // Inst #" << Num << " = " << Inst.TheDef->getName() << "\n"; in emitRecord()
1311 void InstrInfoEmitter::emitEnums(raw_ostream &OS) { in emitEnums() argument
1312 OS << "#ifdef GET_INSTRINFO_ENUM\n"; in emitEnums()
1313 OS << "#undef GET_INSTRINFO_ENUM\n"; in emitEnums()
1315 OS << "namespace llvm {\n\n"; in emitEnums()
1325 OS << "namespace " << Namespace << " {\n"; in emitEnums()
1326 OS << " enum {\n"; in emitEnums()
1329 OS << " " << Inst->TheDef->getName() in emitEnums()
1331 OS << " INSTRUCTION_LIST_END = " << Num + 1 << "\n"; in emitEnums()
1332 OS << " };\n\n"; in emitEnums()
1333 OS << "} // end namespace " << Namespace << "\n"; in emitEnums()
1334 OS << "} // end namespace llvm\n"; in emitEnums()
1335 OS << "#endif // GET_INSTRINFO_ENUM\n\n"; in emitEnums()
1337 OS << "#ifdef GET_INSTRINFO_SCHED_ENUM\n"; in emitEnums()
1338 OS << "#undef GET_INSTRINFO_SCHED_ENUM\n"; in emitEnums()
1339 OS << "namespace llvm {\n\n"; in emitEnums()
1340 OS << "namespace " << Namespace << " {\n"; in emitEnums()
1341 OS << "namespace Sched {\n"; in emitEnums()
1342 OS << " enum {\n"; in emitEnums()
1345 OS << " " << Class.Name << "\t= " << Num++ << ",\n"; in emitEnums()
1346 OS << " SCHED_LIST_END = " << Num << "\n"; in emitEnums()
1347 OS << " };\n"; in emitEnums()
1348 OS << "} // end namespace Sched\n"; in emitEnums()
1349 OS << "} // end namespace " << Namespace << "\n"; in emitEnums()
1350 OS << "} // end namespace llvm\n"; in emitEnums()
1352 OS << "#endif // GET_INSTRINFO_SCHED_ENUM\n\n"; in emitEnums()
1355 static void EmitInstrInfo(RecordKeeper &RK, raw_ostream &OS) { in EmitInstrInfo() argument
1357 InstrInfoEmitter(RK).run(OS); in EmitInstrInfo()
1359 EmitMapTable(RK, OS); in EmitInstrInfo()