37 Streamer.emitInstruction(MCI_STI.first, *MCI_STI.second);
44 bool EHBlock,
bool HasArgAreaLength,
bool HasName) {
45 enum class PPA1Flag1 :
uint8_t {
46 DSA64Bit = (0x80 >> 0),
50 enum class PPA1Flag2 :
uint8_t {
51 ExternalProcedure = (0x80 >> 0),
52 STACKPROTECTOR = (0x80 >> 3),
55 enum class PPA1Flag3 :
uint8_t {
56 HasArgAreaLength = (0x80 >> 1),
57 FPRMask = (0x80 >> 2),
60 enum class PPA1Flag4 :
uint8_t {
61 EPMOffsetPresent = (0x80 >> 0),
63 EHBlock = (0x80 >> 3),
64 ProcedureNamePresent = (0x80 >> 7),
69 auto Flags1 = PPA1Flag1(0);
70 auto Flags2 = PPA1Flag2::ExternalProcedure;
71 auto Flags3 = PPA1Flag3(0);
72 auto Flags4 = PPA1Flag4::EPMOffsetPresent;
74 Flags1 |= PPA1Flag1::DSA64Bit;
77 Flags1 |= PPA1Flag1::VarArg;
80 Flags2 |= PPA1Flag2::STACKPROTECTOR;
83 Flags3 |= PPA1Flag3::HasArgAreaLength;
87 Flags3 |= PPA1Flag3::FPRMask;
90 Flags4 |= PPA1Flag4::VRMask;
93 Flags4 |= PPA1Flag4::EHBlock;
96 Flags4 |= PPA1Flag4::ProcedureNamePresent;
99 OutStreamer.
AddComment(
" Bit 0: 1 = 64-bit DSA");
100 if ((Flags1 & PPA1Flag1::VarArg) == PPA1Flag1::VarArg)
101 OutStreamer.
AddComment(
" Bit 7: 1 = Vararg function");
105 if ((Flags2 & PPA1Flag2::ExternalProcedure) == PPA1Flag2::ExternalProcedure)
106 OutStreamer.
AddComment(
" Bit 0: 1 = External procedure");
107 if ((Flags2 & PPA1Flag2::STACKPROTECTOR) == PPA1Flag2::STACKPROTECTOR)
108 OutStreamer.
AddComment(
" Bit 3: 1 = STACKPROTECT is enabled");
110 OutStreamer.
AddComment(
" Bit 3: 0 = STACKPROTECT is not enabled");
114 if ((Flags3 & PPA1Flag3::HasArgAreaLength) == PPA1Flag3::HasArgAreaLength)
116 " Bit 1: 1 = Argument Area Length is in optional area");
117 if ((Flags3 & PPA1Flag3::FPRMask) == PPA1Flag3::FPRMask)
118 OutStreamer.
AddComment(
" Bit 2: 1 = FP Reg Mask is in optional area");
123 if ((Flags4 & PPA1Flag4::VRMask) == PPA1Flag4::VRMask)
124 OutStreamer.
AddComment(
" Bit 2: 1 = Vector Reg Mask is in optional area");
125 if ((Flags4 & PPA1Flag4::EHBlock) == PPA1Flag4::EHBlock)
126 OutStreamer.
AddComment(
" Bit 3: 1 = C++ EH block");
127 if ((Flags4 & PPA1Flag4::ProcedureNamePresent) ==
128 PPA1Flag4::ProcedureNamePresent)
129 OutStreamer.
AddComment(
" Bit 7: 1 = Name Length and Name");
140 OutName = OutName.
substr(0, UINT16_MAX);
141 OutSize = UINT16_MAX;
144 uint8_t ExtraZeros = 4 - ((2 + OutSize) % 4);
148 OutName = OutnameConv.
str();
172 bool HasArgAreaLength = (Info.AllocaReg != 0) || (Info.CallFrameSize > 128);
176 bool HasPersonalityFn = Info.PersonalityADADisp > 0 || Info.GCCEHADADisp > 0;
186 OutStreamer.
emitInt16(Info.SavedGPRMask);
190 emitPPA1Flags(OutStreamer, Info.IsVarArg, Info.HasStackProtector,
191 Info.SavedFPRMask != 0, Info.SavedVRMask != 0, HasPersonalityFn,
192 HasArgAreaLength, Info.Name.size() > 0);
196 static_cast<uint16_t>(Info.SizeOfFnParams / 4));
198 OutStreamer.
AddComment(
"Length/2 of Prolog ");
199 if (Info.EndOfProlog)
205 OutStreamer.
AddComment(
"Alloca Reg + Offset/2 to SP Update");
209 const MCExpr *AllocaRegExpr =
211 if (Info.StackUpdate)
215 AllocaRegExpr, OutContext),
223 if (HasArgAreaLength) {
224 OutStreamer.
AddComment(
"Argument Area Length");
225 OutStreamer.
emitInt32(Info.CallFrameSize);
229 if (Info.SavedFPRMask) {
231 OutStreamer.
emitInt16(Info.SavedFPRMask);
234 OutStreamer.
AddComment(
"FPR Save Area Locator");
235 uint64_t FPRSaveAreaOffset = Info.OffsetFPR;
236 assert(FPRSaveAreaOffset < 0x10000000 &&
"Offset out of range");
237 FPRSaveAreaOffset &= 0x0FFFFFFF;
242 OutStreamer.
emitInt32(FPRSaveAreaOffset |
243 (Info.FrameReg << 28));
249 if (Info.SavedVRMask) {
251 OutStreamer.
emitInt8(Info.SavedVRMask);
254 uint64_t VRSaveAreaOffset = Info.OffsetVR;
255 assert(VRSaveAreaOffset < 0x10000000 &&
"Offset out of range");
256 VRSaveAreaOffset &= 0x0FFFFFFF;
257 OutStreamer.
AddComment(
"VR Save Area Locator");
262 OutStreamer.
emitInt32(VRSaveAreaOffset | (Info.FrameReg << 28));
266 if (HasPersonalityFn) {
271 OutStreamer.
AddComment(
"Personality routine");
272 OutStreamer.
emitInt64(Info.PersonalityADADisp);
274 OutStreamer.
emitInt64(Info.GCCEHADADisp);
278 if (Info.Name.size() > 0)
305 assert(
Hi &&
Lo &&
"Symbols required to calculate expression");
306 MCSymbol *Temp = Ctx.createTempSymbol();
307 OS << Temp->
getName() <<
" EQU ";
310 Ctx.getAsmInfo().printExpr(OS, *TempExpr);
318 assert(
Hi &&
Lo &&
"Symbols required to calculate expression");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file provides utility functions for converting between EBCDIC-1047 and UTF-8.
static void emitPPA1Flags(MCStreamer &OutStreamer, bool VarArg, bool StackProtector, bool FPRMask, bool VRMask, bool EHBlock, bool HasArgAreaLength, bool HasName)
static void emitPPA1Name(MCStreamer &OutStreamer, StringRef OutName)
Binary assembler expressions.
static const MCBinaryExpr * createLShr(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createOr(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Context object for machine code objects.
const MCObjectFileInfo * getObjectFileInfo() const
Base class for the full range of assembler expressions which are needed for parsing.
MCSection * getTextSection() const
Streaming machine code generation interface.
MCContext & getContext() const
virtual void AddComment(const Twine &T, bool EOL=true)
Add a textual comment.
void emitValue(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
virtual void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size)
Emit the absolute difference between two symbols.
virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
void emitInt16(uint64_t Value)
void emitInt64(uint64_t Value)
virtual void switchSection(MCSection *Section, uint32_t Subsec=0)
Set the current section where code is being emitted to Section.
void emitInt32(uint64_t Value)
void emitZeros(uint64_t NumBytes)
Emit NumBytes worth of zeros.
void emitInt8(uint64_t Value)
virtual void emitBytes(StringRef Data)
Emit the bytes in Data into the output.
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 ...
StringRef getName() const
getName - Get the symbol name.
MCStreamer & getStreamer()
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringRef str() const
Explicit conversion to 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
Get the string size.
const MCExpr * createWordDiffExpr(MCContext &Ctx, const MCSymbol *Hi, const MCSymbol *Lo) override
SystemZHLASMAsmStreamer & getHLASMStreamer()
const MCExpr * createWordDiffExpr(MCContext &Ctx, const MCSymbol *Hi, const MCSymbol *Lo) override
void emitConstantPools() override
std::pair< MCInst, const MCSubtargetInfo * > MCInstSTIPair
EXRLT2SymMap EXRLTargets2Sym
virtual const MCExpr * createWordDiffExpr(MCContext &Ctx, const MCSymbol *Hi, const MCSymbol *Lo)=0
SmallVector< PPA1Info, 0 > DeferredPPA1
void emitConstantPools() override
void emitPPA1(PPA1Info &Info)
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.
LLVM_ABI std::error_code convertToEBCDIC(StringRef Source, SmallVectorImpl< char > &Result)
constexpr size_t NameSize
This is an optimization pass for GlobalISel generic memory operations.
@ LLVM_MARK_AS_BITMASK_ENUM
std::string utostr(uint64_t X, bool isNeg=false)
detail::concat_range< ValueT, RangeTs... > concat(RangeTs &&...Ranges)
Returns a concatenated range across two or more ranges.
Information about a single function needed to emit a PPA1 block.