94 unsigned AlignmentHint = 0;
99 if (AlignmentHint == 0)
135 case SystemZ::CondReturn:
139 .addReg(SystemZ::R14D);
142 case SystemZ::CRBReturn:
147 .addReg(SystemZ::R14D)
151 case SystemZ::CGRBReturn:
156 .addReg(SystemZ::R14D)
160 case SystemZ::CIBReturn:
165 .addReg(SystemZ::R14D)
169 case SystemZ::CGIBReturn:
174 .addReg(SystemZ::R14D)
178 case SystemZ::CLRBReturn:
183 .addReg(SystemZ::R14D)
187 case SystemZ::CLGRBReturn:
192 .addReg(SystemZ::R14D)
196 case SystemZ::CLIBReturn:
201 .addReg(SystemZ::R14D)
205 case SystemZ::CLGIBReturn:
210 .addReg(SystemZ::R14D)
214 case SystemZ::CallBRASL:
220 case SystemZ::CallBASR:
226 case SystemZ::CallJG:
231 case SystemZ::CallBRCL:
238 case SystemZ::CallBR:
242 case SystemZ::CallBCR:
246 .addReg(SystemZ::R1D);
249 case SystemZ::CRBCall:
254 .addReg(SystemZ::R1D)
258 case SystemZ::CGRBCall:
263 .addReg(SystemZ::R1D)
267 case SystemZ::CIBCall:
272 .addReg(SystemZ::R1D)
276 case SystemZ::CGIBCall:
281 .addReg(SystemZ::R1D)
285 case SystemZ::CLRBCall:
290 .addReg(SystemZ::R1D)
294 case SystemZ::CLGRBCall:
299 .addReg(SystemZ::R1D)
303 case SystemZ::CLIBCall:
308 .addReg(SystemZ::R1D)
312 case SystemZ::CLGIBCall:
317 .addReg(SystemZ::R1D)
341 case SystemZ::IILF64:
347 case SystemZ::IIHF64:
353 case SystemZ::RISBHH:
354 case SystemZ::RISBHL:
358 case SystemZ::RISBLH:
359 case SystemZ::RISBLL:
363 case SystemZ::VLVGP32:
378 Lower.lower(MI, LoweredMI);
383 Lower.lower(MI, LoweredMI);
388 Lower.lower(MI, LoweredMI);
393 Lower.lower(MI, LoweredMI);
428 #define LOWER_LOW(NAME) \ 429 case SystemZ::NAME##64: LoweredMI = lowerRILow(MI, SystemZ::NAME); break 445 #define LOWER_HIGH(NAME) \ 446 case SystemZ::NAME##64: LoweredMI = lowerRIHigh(MI, SystemZ::NAME); break 462 case SystemZ::Serialize:
472 case SystemZ::MemBarrier:
480 case SystemZ::Trap: {
493 case SystemZ::CondTrap: {
506 case TargetOpcode::FENTRY_CALL:
507 LowerFENTRY_CALL(*MI,
Lower);
510 case TargetOpcode::STACKMAP:
514 case TargetOpcode::PATCHPOINT:
515 LowerPATCHPOINT(*MI,
Lower);
519 Lower.lower(MI, LoweredMI);
534 else if (NumBytes < 4) {
536 .addImm(0).addReg(SystemZ::R0D), STI);
539 else if (NumBytes < 6) {
541 .addImm(0).addReg(0).addImm(0).addReg(0),
550 .addImm(0).addExpr(Dot), STI);
580 void SystemZAsmPrinter::LowerSTACKMAP(
const MachineInstr &MI) {
587 MCSymbol *MILabel = Ctx.createTempSymbol();
591 assert(NumNOPBytes % 2 == 0 &&
"Invalid number of NOP bytes requested!");
594 unsigned ShadowBytes = 0;
598 while (ShadowBytes < NumNOPBytes) {
599 if (MII == MBB.
end() ||
600 MII->getOpcode() == TargetOpcode::PATCHPOINT ||
601 MII->getOpcode() == TargetOpcode::STACKMAP)
610 while (ShadowBytes < NumNOPBytes)
617 void SystemZAsmPrinter::LowerPATCHPOINT(
const MachineInstr &MI,
620 MCSymbol *MILabel = Ctx.createTempSymbol();
626 unsigned EncodedBytes = 0;
629 if (CalleeMO.
isImm()) {
630 uint64_t CallTarget = CalleeMO.
getImm();
632 unsigned ScratchIdx = -1;
633 unsigned ScratchReg = 0;
637 }
while (ScratchReg == SystemZ::R0D);
642 .addImm(CallTarget & 0xFFFFFFFF));
644 if (CallTarget >> 32) {
647 .addImm(CallTarget >> 32));
652 .addReg(SystemZ::R14D)
653 .addReg(ScratchReg));
659 .addReg(SystemZ::R14D)
666 assert(NumBytes >= EncodedBytes &&
667 "Patchpoint can't request size less than the length of a call.");
668 assert((NumBytes - EncodedBytes) % 2 == 0 &&
669 "Invalid number of NOP bytes requested!");
670 while (EncodedBytes < NumBytes)
702 const char *ExtraCode,
714 const char *ExtraCode,
void EmitEndOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the end of their file...
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
unsigned getNextScratchIdx(unsigned StartIdx=0) const
Get the next scratch register operand index.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
static void printAddress(unsigned Base, int64_t Disp, unsigned Index, raw_ostream &O)
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
This class represents lattice values for constants.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
A Module instance is used to store all the information related to an LLVM module. ...
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
MCContext & OutContext
This is the context for the output file that we are streaming.
bool hasFastSerialization() const
const MCSubtargetInfo & getSubtargetInfo() const
Return information about subtarget.
static unsigned EmitNop(MCContext &OutContext, MCStreamer &OutStreamer, unsigned NumBytes, const MCSubtargetInfo &STI)
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
static void lowerAlignmentHint(const MachineInstr *MI, MCInst &LoweredMI, unsigned Opcode)
MachineFunction * MF
The current machine function.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
static MCInst lowerSubvectorLoad(const MachineInstr *MI, unsigned Opcode)
A description of a memory reference used in the backend.
unsigned getRegAsGRH32(unsigned Reg)
const HexagonInstrInfo * TII
unsigned getRegAsGR32(unsigned Reg)
Base class for the full range of assembler expressions which are needed for parsing.
Represent a reference to a symbol from inside an expression.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override
Context object for machine code objects.
RegisterAsmPrinter - Helper template for registering a target specific assembly printer, for use in the target machine initialization function.
virtual const TargetInstrInfo * getInstrInfo() const
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
MCInstBuilder & addExpr(const MCExpr *Val)
Add a new MCExpr operand.
Instances of this class represent a single low-level machine instruction.
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false)
MCOperand lowerOperand(const MachineOperand &MO) const
MCContext & getContext() const
static MCInst lowerSubvectorStore(const MachineInstr *MI, unsigned Opcode)
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...
Streaming machine code generation interface.
MCInstBuilder & addReg(unsigned Reg)
Add a new register operand.
Control flow instructions. These all have token chains.
MCSymbol * createTempSymbol(bool CanBeUnnamed=true)
Create and return a new assembler temporary symbol with a unique but unspecified name.
const MCAsmInfo * MAI
Target Asm Printer information.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
bool isCompare(QueryType Type=IgnoreBundle) const
Return true if this instruction is a comparison.
static MCInst lowerRIEfLow(const MachineInstr *MI, unsigned Opcode)
TypeSize getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
static MCInst lowerRIHigh(const MachineInstr *MI, unsigned Opcode)
bool hasOneMemOperand() const
Return true if this instruction has exactly one MachineMemOperand.
MCInstBuilder & addImm(int64_t Val)
Add a new integer immediate operand.
MI-level patchpoint operands.
void emitStackMaps(StackMaps &SM)
Emit the stack maps.
Abstract base class for all machine specific constantpool value subclasses.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
uint64_t getAlignment() const
Return the minimum known alignment in bytes of the actual memory reference.
static const MCSymbolRefExpr * getTLSGetOffset(MCContext &Context)
void recordPatchPoint(const MCSymbol &L, const MachineInstr &MI)
Generate a stackmap record for a patchpoint instruction.
void setOpcode(unsigned Op)
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
mmo_iterator memoperands_begin() const
Access to memory operands of the instruction.
MCSymbol * getSymbol(const GlobalValue *GV) const
MachineOperand class - Representation of each machine instruction operand.
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
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...
static MCSymbolRefExpr::VariantKind getModifierVariantKind(SystemZCP::SystemZCPModifier Modifier)
unsigned getRegAsGR64(unsigned Reg)
#define LLVM_EXTERNAL_VISIBILITY
unsigned getRegAsVR128(unsigned Reg)
const Function & getFunction() const
Return the LLVM function that this machine code represents.
static MCInst lowerRILow(const MachineInstr *MI, unsigned Opcode)
const MachineBasicBlock * getParent() const
Target & getTheSystemZTarget()
Representation of each machine instruction.
unsigned getInstSizeInBytes(const MachineInstr &MI) const override
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
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 EmitInstruction(const MachineInstr *MI) override
Targets should implement this to emit instructions.
static const MCSymbolRefExpr * getGlobalOffsetTable(MCContext &Context)
Generic base class for all target subtargets.
uint32_t getNumPatchBytes() const
Return the number of patchable bytes the given patchpoint should emit.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
static void printOperand(const MCOperand &MO, const MCAsmInfo *MAI, raw_ostream &O)
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSystemZAsmPrinter()
virtual void EmitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
This class implements an extremely fast bulk output stream that can only output to a stream...
A SystemZ-specific constant pool value.
const DataLayout & getDataLayout() const
Return information about data layout.
void recordStackMap(const MCSymbol &L, const MachineInstr &MI)
Generate a stackmap record for a stackmap instruction.
const MachineOperand & getCallTarget() const
Returns the target of the underlying call.
void addOperand(const MCOperand &Op)
StringRef - Represent a constant reference to a string, i.e.
Register getReg() const
getReg - Returns the register number.
const MachineOperand & getOperand(unsigned i) const
Instances of this class represent operands of the MCInst class.
static MCOperand createImm(int64_t Val)
const MCExpr * getExpr(const MachineOperand &MO, MCSymbolRefExpr::VariantKind Kind) const