99 if (
MI->memoperands_empty())
104 EE =
MI->memoperands_end(); MMOI != EE; ++MMOI)
105 if ((*MMOI)->getAlign() < Alignment)
106 Alignment = (*MMOI)->getAlign();
108 unsigned AlignmentHint = 0;
109 if (Alignment >=
Align(16))
111 else if (Alignment >=
Align(8))
113 if (AlignmentHint == 0)
127 .
addReg(
MI->getOperand(3).getReg());
165void SystemZAsmPrinter::emitCallInformation(CallType CT) {
174 auto Key = std::make_pair(
Sym, SlotKind);
175 auto It = Displacements.find(Key);
177 if (It != Displacements.end())
191 uint32_t Displacement = NextDisplacement;
192 Displacements[std::make_pair(
Sym, SlotKind)] = NextDisplacement;
193 NextDisplacement +=
Length;
199SystemZAsmPrinter::AssociatedDataAreaTable::insert(
const MachineOperand MO) {
213 return insert(
Sym, ADAslotType);
217 SystemZ_MC::verifyInstructionPredicates(
MI->getOpcode(),
222 switch (
MI->getOpcode()) {
223 case SystemZ::Return:
228 case SystemZ::Return_XPLINK:
235 case SystemZ::CondReturn:
242 case SystemZ::CondReturn_XPLINK:
251 case SystemZ::CRBReturn:
260 case SystemZ::CGRBReturn:
269 case SystemZ::CIBReturn:
278 case SystemZ::CGIBReturn:
287 case SystemZ::CLRBReturn:
296 case SystemZ::CLGRBReturn:
305 case SystemZ::CLIBReturn:
314 case SystemZ::CLGIBReturn:
323 case SystemZ::CallBRASL_XPLINK64:
325 .addReg(SystemZ::R7D)
326 .addExpr(
Lower.getExpr(
MI->getOperand(0),
328 emitCallInformation(CallType::BRASL7);
331 case SystemZ::CallBASR_XPLINK64:
333 .addReg(SystemZ::R7D)
334 .addReg(
MI->getOperand(0).getReg()));
335 emitCallInformation(CallType::BASR76);
338 case SystemZ::CallBASR_STACKEXT:
340 .addReg(SystemZ::R3D)
341 .addReg(
MI->getOperand(0).getReg()));
342 emitCallInformation(CallType::BASR33);
345 case SystemZ::ADA_ENTRY_VALUE:
346 case SystemZ::ADA_ENTRY: {
349 uint32_t Disp = ADATable.insert(
MI->getOperand(1));
350 Register TargetReg =
MI->getOperand(0).getReg();
353 Disp +=
MI->getOperand(3).getImm();
354 bool LoadAddr =
MI->getOpcode() == SystemZ::ADA_ENTRY;
356 unsigned Op0 = LoadAddr ? SystemZ::LA : SystemZ::LG;
357 unsigned Op =
TII->getOpcodeForOffset(Op0, Disp);
361 if (TargetReg != ADAReg) {
362 IndexReg = TargetReg;
366 MCInstBuilder(SystemZ::LLILF).addReg(TargetReg).addImm(Disp));
383 case SystemZ::CallBRASL:
389 case SystemZ::CallBASR:
392 .
addReg(
MI->getOperand(0).getReg());
395 case SystemZ::CallJG:
400 case SystemZ::CallBRCL:
407 case SystemZ::CallBR:
409 .
addReg(
MI->getOperand(0).getReg());
412 case SystemZ::CallBCR:
416 .
addReg(
MI->getOperand(2).getReg());
419 case SystemZ::CRBCall:
428 case SystemZ::CGRBCall:
437 case SystemZ::CIBCall:
446 case SystemZ::CGIBCall:
455 case SystemZ::CLRBCall:
464 case SystemZ::CLGRBCall:
473 case SystemZ::CLIBCall:
482 case SystemZ::CLGIBCall:
491 case SystemZ::TLS_GDCALL:
499 case SystemZ::TLS_LDCALL:
513 case SystemZ::IILF64:
516 .
addImm(
MI->getOperand(2).getImm());
519 case SystemZ::IIHF64:
522 .
addImm(
MI->getOperand(2).getImm());
525 case SystemZ::RISBHH:
526 case SystemZ::RISBHL:
530 case SystemZ::RISBLH:
531 case SystemZ::RISBLL:
535 case SystemZ::VLVGP32:
597 case SystemZ::LFER_16:
605 case SystemZ::LEFR_16:
609#define LOWER_LOW(NAME) \
610 case SystemZ::NAME##64: LoweredMI = lowerRILow(MI, SystemZ::NAME); break
626#define LOWER_HIGH(NAME) \
627 case SystemZ::NAME##64: LoweredMI = lowerRIHigh(MI, SystemZ::NAME); break
643 case SystemZ::Serialize:
656 case SystemZ::Trap: {
669 case SystemZ::CondTrap: {
682 case TargetOpcode::FENTRY_CALL:
686 case TargetOpcode::STACKMAP:
690 case TargetOpcode::PATCHPOINT:
694 case TargetOpcode::PATCHABLE_FUNCTION_ENTER:
695 LowerPATCHABLE_FUNCTION_ENTER(*
MI,
Lower);
698 case TargetOpcode::PATCHABLE_RET:
699 LowerPATCHABLE_RET(*
MI,
Lower);
702 case TargetOpcode::PATCHABLE_FUNCTION_EXIT:
705 case TargetOpcode::PATCHABLE_TAIL_CALL:
709 "around this assert.");
711 case SystemZ::EXRL_Pseudo: {
712 unsigned TargetInsOpc =
MI->getOperand(0).getImm();
713 Register LenMinus1Reg =
MI->getOperand(1).getReg();
714 Register DestReg =
MI->getOperand(2).getReg();
715 int64_t DestDisp =
MI->getOperand(3).getImm();
717 int64_t SrcDisp =
MI->getOperand(5).getImm();
734 MCInstBuilder(SystemZ::EXRL).addReg(LenMinus1Reg).addExpr(Dot));
740 case SystemZ::EH_SjLj_Setup:
758 else if (NumBytes < 4) {
760 MCInstBuilder(SystemZ::BCRAsm).addImm(0).addReg(SystemZ::R0D), STI);
763 else if (NumBytes < 6) {
765 MCInstBuilder(SystemZ::BCAsm).addImm(0).addReg(0).addImm(0).addReg(0),
774 MCInstBuilder(SystemZ::BRCLAsm).addImm(0).addExpr(Dot), STI);
808 unsigned NumNOPBytes =
MI.getOperand(1).getImm();
815 assert(NumNOPBytes % 2 == 0 &&
"Invalid number of NOP bytes requested!");
818 unsigned ShadowBytes = 0;
822 while (ShadowBytes < NumNOPBytes) {
824 MII->getOpcode() == TargetOpcode::PATCHPOINT ||
825 MII->getOpcode() == TargetOpcode::STACKMAP)
827 ShadowBytes +=
TII->getInstSizeInBytes(*MII);
834 while (ShadowBytes < NumNOPBytes)
850 unsigned EncodedBytes = 0;
853 if (CalleeMO.
isImm()) {
856 unsigned ScratchIdx = -1;
857 unsigned ScratchReg = 0;
859 ScratchIdx = Opers.getNextScratchIdx(ScratchIdx + 1);
860 ScratchReg =
MI.getOperand(ScratchIdx).getReg();
861 }
while (ScratchReg == SystemZ::R0D);
866 .addImm(CallTarget & 0xFFFFFFFF));
868 if (CallTarget >> 32) {
871 .addImm(CallTarget >> 32));
876 .addReg(SystemZ::R14D)
877 .addReg(ScratchReg));
883 .addReg(SystemZ::R14D)
889 unsigned NumBytes = Opers.getNumPatchBytes();
890 assert(NumBytes >= EncodedBytes &&
891 "Patchpoint can't request size less than the length of a call.");
892 assert((NumBytes - EncodedBytes) % 2 == 0 &&
893 "Invalid number of NOP bytes requested!");
894 while (EncodedBytes < NumBytes)
899void SystemZAsmPrinter::LowerPATCHABLE_FUNCTION_ENTER(
910 bool HasVectorFeature =
914 HasVectorFeature ?
"__xray_FunctionEntryVec" :
"__xray_FunctionEntry");
923 MCInstBuilder(SystemZ::LLILF).addReg(SystemZ::R2D).addImm(0));
925 .addReg(SystemZ::R14D)
934 unsigned OpCode =
MI.getOperand(0).getImm();
935 MCSymbol *FallthroughLabel =
nullptr;
936 if (OpCode == SystemZ::CondReturn) {
938 int64_t Cond0 =
MI.getOperand(1).getImm();
939 int64_t Cond1 =
MI.getOperand(2).getImm();
942 .addImm(Cond1 ^ Cond0)
955 bool HasVectorFeature =
959 HasVectorFeature ?
"__xray_FunctionExitVec" :
"__xray_FunctionExit");
966 MCInstBuilder(SystemZ::LLILF).addReg(SystemZ::R2D).addImm(0));
970 if (FallthroughLabel)
978void SystemZAsmPrinter::emitAttributes(
Module &M) {
979 if (
M.getModuleFlag(
"s390x-visible-vector-ABI")) {
980 bool HasVectorFeature =
982 OutStreamer->emitGNUAttribute(8, HasVectorFeature ? 2 : 1);
1039 else if (MCOp.
isImm())
1048 const MCOperand &DispMO,
unsigned Index,
1051 if (
Base || Index) {
1065 const char *ExtraCode,
1071 if (ExtraCode[0] ==
'N' && !ExtraCode[1] && MO.
isReg() &&
1072 SystemZ::GR128BitRegClass.contains(MO.
getReg()))
1079 MCOp =
Lower.lowerOperand(MO);
1087 const char *ExtraCode,
1089 if (ExtraCode && ExtraCode[0] && !ExtraCode[1]) {
1090 switch (ExtraCode[0]) {
1097 OS <<
MI->getOperand(OpNo + 1).getImm();
1106 MI->getOperand(OpNo + 2).getReg(),
OS);
1119 getTargetStreamer()->
emitEnd();
1122void SystemZAsmPrinter::emitADASection() {
1128 unsigned EmittedBytes = 0;
1129 for (
auto &Entry : ADATable.getTable()) {
1132 std::tie(
Sym, SlotKind) = Entry.first;
1133 unsigned Offset = Entry.second;
1134 assert(
Offset == EmittedBytes &&
"Offset not as expected");
1136#define EMIT_COMMENT(Str) \
1137 OutStreamer->AddComment(Twine("Offset ") \
1138 .concat(utostr(Offset)) \
1139 .concat(" " Str " ") \
1140 .concat(Sym->getName()));
1154 EmittedBytes += PointerSize * 2;
1162 EmittedBytes += PointerSize;
1176 EmittedBytes += PointerSize;
1188 std::string ProductID;
1189 if (
auto *MD = M.getModuleFlag(
"zos_product_id"))
1190 ProductID = cast<MDString>(MD)->getString().str();
1191 if (ProductID.empty())
1197 if (
auto *VersionVal = mdconst::extract_or_null<ConstantInt>(
1198 M.getModuleFlag(
"zos_product_major_version")))
1199 return VersionVal->getZExtValue();
1200 return LLVM_VERSION_MAJOR;
1204 if (
auto *ReleaseVal = mdconst::extract_or_null<ConstantInt>(
1205 M.getModuleFlag(
"zos_product_minor_version")))
1206 return ReleaseVal->getZExtValue();
1207 return LLVM_VERSION_MINOR;
1211 if (
auto *PatchVal = mdconst::extract_or_null<ConstantInt>(
1212 M.getModuleFlag(
"zos_product_patchlevel")))
1213 return PatchVal->getZExtValue();
1214 return LLVM_VERSION_PATCH;
1218 std::time_t Time = 0;
1219 if (
auto *Val = mdconst::extract_or_null<ConstantInt>(
1220 M.getModuleFlag(
"zos_translation_time"))) {
1221 long SecondsSinceEpoch = Val->getSExtValue();
1222 Time =
static_cast<time_t
>(SecondsSinceEpoch);
1227void SystemZAsmPrinter::emitIDRLSection(
Module &M) {
1230 constexpr unsigned IDRLDataLength = 30;
1240 O <<
formatv(
"{0,-10}{1,0-2:d}{2,0-2:d}{3:%Y%m%d%H%M%S}{4,0-2}",
1241 ProductID.substr(0, 10).c_str(), ProductVersion, ProductRelease,
1266 CurrentFnPPA1Sym =
nullptr;
1267 CurrentFnEPMarkerSym =
nullptr;
1273 bool EHBlock,
bool HasName) {
1274 enum class PPA1Flag1 :
uint8_t {
1275 DSA64Bit = (0x80 >> 0),
1276 VarArg = (0x80 >> 7),
1279 enum class PPA1Flag2 :
uint8_t {
1280 ExternalProcedure = (0x80 >> 0),
1281 STACKPROTECTOR = (0x80 >> 3),
1284 enum class PPA1Flag3 :
uint8_t {
1285 FPRMask = (0x80 >> 2),
1288 enum class PPA1Flag4 :
uint8_t {
1289 EPMOffsetPresent = (0x80 >> 0),
1290 VRMask = (0x80 >> 2),
1291 EHBlock = (0x80 >> 3),
1292 ProcedureNamePresent = (0x80 >> 7),
1297 auto Flags1 = PPA1Flag1(0);
1298 auto Flags2 = PPA1Flag2::ExternalProcedure;
1299 auto Flags3 = PPA1Flag3(0);
1300 auto Flags4 = PPA1Flag4::EPMOffsetPresent;
1302 Flags1 |= PPA1Flag1::DSA64Bit;
1305 Flags1 |= PPA1Flag1::VarArg;
1308 Flags2 |= PPA1Flag2::STACKPROTECTOR;
1312 Flags3 |= PPA1Flag3::FPRMask;
1315 Flags4 |= PPA1Flag4::VRMask;
1318 Flags4 |= PPA1Flag4::EHBlock;
1321 Flags4 |= PPA1Flag4::ProcedureNamePresent;
1323 OutStreamer->AddComment(
"PPA1 Flags 1");
1324 if ((Flags1 & PPA1Flag1::DSA64Bit) == PPA1Flag1::DSA64Bit)
1325 OutStreamer->AddComment(
" Bit 0: 1 = 64-bit DSA");
1327 OutStreamer->AddComment(
" Bit 0: 0 = 32-bit DSA");
1328 if ((Flags1 & PPA1Flag1::VarArg) == PPA1Flag1::VarArg)
1329 OutStreamer->AddComment(
" Bit 7: 1 = Vararg function");
1330 OutStreamer->emitInt8(
static_cast<uint8_t>(Flags1));
1332 OutStreamer->AddComment(
"PPA1 Flags 2");
1333 if ((Flags2 & PPA1Flag2::ExternalProcedure) == PPA1Flag2::ExternalProcedure)
1334 OutStreamer->AddComment(
" Bit 0: 1 = External procedure");
1335 if ((Flags2 & PPA1Flag2::STACKPROTECTOR) == PPA1Flag2::STACKPROTECTOR)
1336 OutStreamer->AddComment(
" Bit 3: 1 = STACKPROTECT is enabled");
1338 OutStreamer->AddComment(
" Bit 3: 0 = STACKPROTECT is not enabled");
1339 OutStreamer->emitInt8(
static_cast<uint8_t>(Flags2));
1341 OutStreamer->AddComment(
"PPA1 Flags 3");
1342 if ((Flags3 & PPA1Flag3::FPRMask) == PPA1Flag3::FPRMask)
1343 OutStreamer->AddComment(
" Bit 2: 1 = FP Reg Mask is in optional area");
1344 OutStreamer->emitInt8(
1345 static_cast<uint8_t>(Flags3));
1347 OutStreamer->AddComment(
"PPA1 Flags 4");
1348 if ((Flags4 & PPA1Flag4::VRMask) == PPA1Flag4::VRMask)
1349 OutStreamer->AddComment(
" Bit 2: 1 = Vector Reg Mask is in optional area");
1350 if ((Flags4 & PPA1Flag4::EHBlock) == PPA1Flag4::EHBlock)
1351 OutStreamer->AddComment(
" Bit 3: 1 = C++ EH block");
1352 if ((Flags4 & PPA1Flag4::ProcedureNamePresent) ==
1353 PPA1Flag4::ProcedureNamePresent)
1354 OutStreamer->AddComment(
" Bit 7: 1 = Name Length and Name");
1355 OutStreamer->emitInt8(
static_cast<uint8_t>(
1366 OutName = OutName.
substr(0, UINT16_MAX);
1367 OutSize = UINT16_MAX;
1370 uint8_t ExtraZeros = 4 - ((2 + OutSize) % 4);
1374 OutName = OutnameConv.
str();
1376 OutStreamer->AddComment(
"Length of Name");
1377 OutStreamer->emitInt16(OutSize);
1378 OutStreamer->AddComment(
"Name of Function");
1379 OutStreamer->emitBytes(OutName);
1380 OutStreamer->emitZeros(ExtraZeros);
1383void SystemZAsmPrinter::emitPPA1(
MCSymbol *FnEndSym) {
1384 assert(PPA2Sym !=
nullptr &&
"PPA2 Symbol not defined");
1388 const auto TargetHasVector = Subtarget.hasVector();
1401 int64_t OffsetFPR = 0;
1402 int64_t OffsetVR = 0;
1403 const int64_t TopOfStack =
1410 I && E &&
I <= E; ++
I) {
1412 assert(V < 16 &&
"GPR index out of range");
1413 SavedGPRMask |= 1 << (15 -
V);
1416 for (
auto &CS : CSI) {
1417 unsigned Reg = CS.getReg();
1418 unsigned I =
TRI->getEncodingValue(Reg);
1420 if (SystemZ::FP64BitRegClass.
contains(Reg)) {
1421 assert(
I < 16 &&
"FPR index out of range");
1422 SavedFPRMask |= 1 << (15 -
I);
1424 if (Temp < OffsetFPR)
1426 }
else if (SystemZ::VR128BitRegClass.
contains(Reg)) {
1427 assert(
I >= 16 &&
I <= 23 &&
"VPR index out of range");
1428 unsigned BitNum =
I - 16;
1429 SavedVRMask |= 1 << (7 - BitNum);
1431 if (Temp < OffsetVR)
1437 OffsetFPR += (OffsetFPR < 0) ? TopOfStack : 0;
1438 OffsetVR += (OffsetVR < 0) ? TopOfStack : 0;
1442 uint8_t AllocaReg = ZFL->hasFP(*
MF) ? FrameReg : 0;
1443 assert(AllocaReg < 16 &&
"Can't have alloca register larger than 15");
1449 uint64_t FPRSaveAreaOffset = OffsetFPR;
1450 assert(FPRSaveAreaOffset < 0x10000000 &&
"Offset out of range");
1452 FrameAndFPROffset = FPRSaveAreaOffset & 0x0FFFFFFF;
1453 FrameAndFPROffset |= FrameReg << 28;
1458 if (TargetHasVector && SavedVRMask) {
1459 uint64_t VRSaveAreaOffset = OffsetVR;
1460 assert(VRSaveAreaOffset < 0x10000000 &&
"Offset out of range");
1462 FrameAndVROffset = VRSaveAreaOffset & 0x0FFFFFFF;
1463 FrameAndVROffset |= FrameReg << 28;
1476 OutStreamer->emitAbsoluteSymbolDiff(PPA2Sym, CurrentFnPPA1Sym, 4);
1485 TargetHasVector && SavedVRMask != 0, NeedEmitEHBlock, HasName);
1491 OutStreamer->emitAbsoluteSymbolDiff(FnEndSym, CurrentFnEPMarkerSym, 4);
1501 .
concat(utostr(FrameAndFPROffset >> 28))
1504 .
concat(utostr(FrameAndFPROffset & 0x0FFFFFFF))
1512 if (TargetHasVector && SavedVRMask) {
1519 .
concat(utostr(FrameAndVROffset >> 28))
1522 .
concat(utostr(FrameAndVROffset & 0x0FFFFFFF))
1529 if (NeedEmitEHBlock) {
1530 Per = dyn_cast<Function>(
1534 assert(PersonalityRoutine &&
"Missing personality routine");
1555 OutStreamer->emitAbsoluteSymbolDiff(CurrentFnEPMarkerSym, CurrentFnPPA1Sym,
1565void SystemZAsmPrinter::emitPPA2(
Module &M) {
1571 const char *StartSymbolName =
"CELQSTRT";
1589 ostr <<
formatv(
"{0,0-2:d}{1,0-2:d}{2,0-2:d}", ProductVersion, ProductRelease,
1593 SmallString<
sizeof(CompilationTime) - 1> CompilationTimeStr;
1599 enum class PPA2MemberId :
uint8_t {
1604 enum class PPA2MemberSubId :
uint8_t {
1610 LLVMBasedLang = 0xe7,
1613 enum class PPA2Flags :
uint8_t {
1614 CompileForBinaryFloatingPoint = 0x80,
1615 CompiledWithXPLink = 0x01,
1616 CompiledUnitASCII = 0x04,
1617 HasServiceInfo = 0x20,
1620 PPA2MemberSubId MemberSubId = PPA2MemberSubId::LLVMBasedLang;
1621 if (
auto *MD =
M.getModuleFlag(
"zos_cu_language")) {
1624 .
Case(
"C", PPA2MemberSubId::C)
1625 .
Case(
"C++", PPA2MemberSubId::CXX)
1626 .
Case(
"Swift", PPA2MemberSubId::Swift)
1627 .
Case(
"Go", PPA2MemberSubId::Go)
1628 .
Default(PPA2MemberSubId::LLVMBasedLang);
1637 OutStreamer->emitAbsoluteSymbolDiff(CELQSTRT, PPA2Sym, 4);
1639 OutStreamer->emitAbsoluteSymbolDiff(DateVersionSym, PPA2Sym, 4);
1642 uint8_t Flgs =
static_cast<uint8_t>(PPA2Flags::CompileForBinaryFloatingPoint);
1643 Flgs |=
static_cast<uint8_t>(PPA2Flags::CompiledWithXPLink);
1645 if (
auto *MD =
M.getModuleFlag(
"zos_le_char_mode")) {
1646 const StringRef &CharMode = cast<MDString>(MD)->getString();
1647 if (CharMode ==
"ascii") {
1649 PPA2Flags::CompiledUnitASCII);
1650 }
else if (CharMode !=
"ebcdic") {
1652 "Only ascii or ebcdic are valid values for zos_le_char_mode "
1677 OutStreamer->emitAbsoluteSymbolDiff(PPA2Sym, CELQSTRT, 8);
1684 if (Subtarget.getTargetTriple().isOSzOS()) {
1692 CurrentFnEPMarkerSym =
1711 uint32_t DSAAndFlags = DSASize & 0xFFFFFFE0;
1712 DSAAndFlags |= Flags;
1715 OutStreamer->AddComment(
"XPLINK Routine Layout Entry");
1717 OutStreamer->AddComment(
"Eyecatcher 0x00C300C500C500");
1718 OutStreamer->emitIntValueInHex(0x00C300C500C500, 7);
1722 OutStreamer->emitAbsoluteSymbolDiff(CurrentFnPPA1Sym, CurrentFnEPMarkerSym,
1728 OutStreamer->AddComment(
" Bit 1: 1 = Leaf function");
1730 OutStreamer->AddComment(
" Bit 1: 0 = Non-leaf function");
1732 OutStreamer->AddComment(
" Bit 2: 1 = Uses alloca");
1734 OutStreamer->AddComment(
" Bit 2: 0 = Does not use alloca");
1745 "SystemZ Assembly Printer",
false,
false)
1749LLVMInitializeSystemZAsmPrinter() {
unsigned const MachineRegisterInfo * MRI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define LLVM_EXTERNAL_VISIBILITY
This file provides utility functions for converting between EBCDIC-1047 and UTF-8.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
const HexagonInstrInfo * TII
Module.h This file contains the declarations for the Module class.
Register const TargetRegisterInfo * TRI
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
static MCInst lowerVecEltExtraction(const MachineInstr *MI, unsigned Opcode)
static uint8_t getSpecifierFromModifier(SystemZCP::SystemZCPModifier Modifier)
static void emitPPA1Name(std::unique_ptr< MCStreamer > &OutStreamer, StringRef OutName)
static void lowerAlignmentHint(const MachineInstr *MI, MCInst &LoweredMI, unsigned Opcode)
#define EMIT_COMMENT(Str)
static const MCSymbolRefExpr * getGlobalOffsetTable(MCContext &Context)
static void printFormattedRegName(const MCAsmInfo *MAI, unsigned RegNo, raw_ostream &OS)
static MCInst lowerRILow(const MachineInstr *MI, unsigned Opcode)
static uint32_t getProductVersion(Module &M)
static std::string getProductID(Module &M)
static MCInst lowerRIHigh(const MachineInstr *MI, unsigned Opcode)
static void emitPPA1Flags(std::unique_ptr< MCStreamer > &OutStreamer, bool VarArg, bool StackProtector, bool FPRMask, bool VRMask, bool EHBlock, bool HasName)
static void printAddress(const MCAsmInfo *MAI, unsigned Base, const MCOperand &DispMO, unsigned Index, raw_ostream &OS)
static time_t getTranslationTime(Module &M)
static const MCSymbolRefExpr * getTLSGetOffset(MCContext &Context)
static MCInst lowerSubvectorStore(const MachineInstr *MI, unsigned Opcode)
static unsigned EmitNop(MCContext &OutContext, MCStreamer &OutStreamer, unsigned NumBytes, const MCSubtargetInfo &STI)
static MCInst lowerVecEltInsertion(const MachineInstr *MI, unsigned Opcode)
static uint32_t getProductRelease(Module &M)
static MCInst lowerSubvectorLoad(const MachineInstr *MI, unsigned Opcode)
static uint32_t getProductPatch(Module &M)
static MCInst lowerRIEfLow(const MachineInstr *MI, unsigned Opcode)
const TargetLoweringObjectFile & getObjFileLowering() const
Return information about object file lowering.
MCSymbol * getSymbol(const GlobalValue *GV) const
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
TargetMachine & TM
Target machine description.
const MCAsmInfo * MAI
Target Asm Printer information.
MachineFunction * MF
The current machine function.
virtual void emitStartOfAsmFile(Module &)
This virtual method can be overridden by targets that want to emit something at the start of their fi...
void recordSled(MCSymbol *Sled, const MachineInstr &MI, SledKind Kind, uint8_t Version=0)
MCContext & OutContext
This is the context for the output file that we are streaming.
MCSymbol * createTempSymbol(const Twine &Name) const
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
const DataLayout & getDataLayout() const
Return information about data layout.
virtual void emitFunctionEntryLabel()
EmitFunctionEntryLabel - Emit the label that is the entrypoint for the function.
const MCSubtargetInfo & getSubtargetInfo() const
Return information about subtarget.
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
const Constant * stripPointerCasts() const
This class represents an Operation in the Expression.
TypeSize getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
LLVM_ABI unsigned getPointerSize(unsigned AS=0) const
The pointer representation size in bytes, rounded up to a whole number of bytes.
Constant * getPersonalityFn() const
Get the personality function associated with this function.
bool isVarArg() const
isVarArg - Return true if this function takes a variable number of arguments.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
This class is intended to be used as a base class for asm properties and features specific to the tar...
unsigned getAssemblerDialect() const
void printExpr(raw_ostream &, const MCExpr &) const
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())
static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Context object for machine code objects.
LLVM_ABI MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
LLVM_ABI MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
const Triple & getTargetTriple() const
Base class for the full range of assembler expressions which are needed for parsing.
MCInstBuilder & addReg(MCRegister Reg)
Add a new register operand.
MCInstBuilder & addImm(int64_t Val)
Add a new integer immediate operand.
MCInstBuilder & addExpr(const MCExpr *Val)
Add a new MCExpr operand.
Instances of this class represent a single low-level machine instruction.
void addOperand(const MCOperand Op)
void setOpcode(unsigned Op)
Instances of this class represent operands of the MCInst class.
static MCOperand createReg(MCRegister Reg)
static MCOperand createImm(int64_t Val)
MCRegister getReg() const
Returns the register number.
const MCExpr * getExpr() const
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
static const MCSpecifierExpr * create(const MCExpr *Expr, Spec S, MCContext &Ctx, SMLoc Loc=SMLoc())
Streaming machine code generation interface.
virtual void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
Generic base class for all target subtargets.
bool hasFeature(unsigned Feature) const
Represent a reference to a symbol from inside an expression.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Abstract base class for all machine specific constantpool value subclasses.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects.
int64_t getOffsetAdjustment() const
Return the correction for frame offsets.
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
bool hasStackProtectorIndex() const
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
unsigned getFunctionNumber() const
getFunctionNumber - Return a unique ID for the current function.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
MCContext & getContext() const
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Function & getFunction()
Return the LLVM function that this machine code represents.
const std::vector< LandingPadInfo > & getLandingPads() const
Return a reference to the landing pad info for the current function.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Representation of each machine instruction.
LLVM_ABI const MachineFunction * getMF() const
Return the function that contains the basic block that this instruction belongs to.
MachineOperand class - Representation of each machine instruction operand.
const GlobalValue * getGlobal() const
bool isReg() const
isReg - Tests if this is a MO_Register operand.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
MachineInstr * getParent()
getParent - Return the instruction that this operand belongs to.
unsigned getTargetFlags() const
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
const char * getSymbolName() const
Register getReg() const
getReg - Returns the register number.
@ MO_GlobalAddress
Address of a global value.
@ MO_ExternalSymbol
Name of external global symbol.
const TargetRegisterInfo * getTargetRegisterInfo() const
A Module instance is used to store all the information related to an LLVM module.
MI-level patchpoint operands.
Wrapper class representing virtual and physical registers.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringRef str() const
Explicit conversion to StringRef.
LLVM_ABI void recordPatchPoint(const MCSymbol &L, const MachineInstr &MI)
Generate a stackmap record for a patchpoint instruction.
LLVM_ABI void recordStackMap(const MCSymbol &L, const MachineInstr &MI)
Generate a stackmap record for a stackmap instruction.
StringRef - Represent a constant reference to a string, i.e.
constexpr StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
constexpr size_t size() const
size - Get the string size.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override
void emitFunctionBodyEnd() override
Targets can override this to emit stuff after the last basic block in the function.
void emitStartOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the start of their fi...
void emitInstruction(const MachineInstr *MI) override
Targets should implement this to emit instructions.
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as...
void emitFunctionEntryLabel() override
EmitFunctionEntryLabel - Emit the label that is the entrypoint for the function.
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
void emitEndOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the end of their file...
A SystemZ-specific constant pool value.
static const char * getRegisterName(MCRegister Reg)
static const char * getRegisterName(MCRegister Reg)
SystemZ::GPRRegs getSpillGPRRegs() const
unsigned getSizeOfFnParams() const
const SystemZInstrInfo * getInstrInfo() const override
const TargetFrameLowering * getFrameLowering() const override
std::pair< MCInst, const MCSubtargetInfo * > MCInstSTIPair
EXRLT2SymMap EXRLTargets2Sym
const Triple & getTargetTriple() const
const MCSubtargetInfo * getMCSubtargetInfo() const
MCSymbol * getSymbol(const GlobalValue *GV) const
const MCRegisterInfo * getMCRegisterInfo() const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM_ABI std::string str() const
Return the twine contents as a std::string.
Twine concat(const Twine &Suffix) const
static Twine utohexstr(const uint64_t &Val)
LLVM_ABI StringRef getName() const
Return a constant reference to the value's name.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an SmallVector or SmallString.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Language[]
Key for Kernel::Metadata::mLanguage.
@ Swift
Calling convention for Swift.
@ C
The default llvm calling convention, compatible with C.
LLVM_ABI std::error_code convertToEBCDIC(StringRef Source, SmallVectorImpl< char > &Result)
@ MO_ADA_DATA_SYMBOL_ADDR
@ MO_ADA_DIRECT_FUNC_DESC
@ MO_ADA_INDIRECT_FUNC_DESC
unsigned getRegAsGR32(unsigned Reg)
const unsigned GR64Regs[16]
unsigned getRegAsGRH32(unsigned Reg)
unsigned getRegAsVR128(unsigned Reg)
unsigned getRegAsGR64(unsigned Reg)
Reg
All possible values of the reg field in the ModR/M byte.
constexpr size_t NameSize
constexpr uint64_t PointerSize
aarch64 pointer size.
UtcTime< std::chrono::seconds > toUtcTime(std::time_t T)
Convert a std::time_t to a UtcTime.
This is an optimization pass for GlobalISel generic memory operations.
Target & getTheSystemZTarget()
detail::concat_range< ValueT, RangeTs... > concat(RangeTs &&...Ranges)
Returns a concatenated range across two or more ranges.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
@ LLVM_MARK_AS_BITMASK_ENUM
LLVM_ABI Printable printReg(Register Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubIdx=0, const MachineRegisterInfo *MRI=nullptr)
Prints virtual and physical registers with or without a TRI instance.
@ MCSA_IndirectSymbol
.indirect_symbol (MachO)
This struct is a compact representation of a valid (non-zero power of two) alignment.
RegisterAsmPrinter - Helper template for registering a target specific assembly printer,...