112 case SystemZ::CondReturn:
116 .addReg(SystemZ::R14D);
119 case SystemZ::CRBReturn:
124 .addReg(SystemZ::R14D)
128 case SystemZ::CGRBReturn:
133 .addReg(SystemZ::R14D)
137 case SystemZ::CIBReturn:
142 .addReg(SystemZ::R14D)
146 case SystemZ::CGIBReturn:
151 .addReg(SystemZ::R14D)
155 case SystemZ::CLRBReturn:
160 .addReg(SystemZ::R14D)
164 case SystemZ::CLGRBReturn:
169 .addReg(SystemZ::R14D)
173 case SystemZ::CLIBReturn:
178 .addReg(SystemZ::R14D)
182 case SystemZ::CLGIBReturn:
187 .addReg(SystemZ::R14D)
191 case SystemZ::CallBRASL:
197 case SystemZ::CallBASR:
203 case SystemZ::CallJG:
208 case SystemZ::CallBRCL:
215 case SystemZ::CallBR:
219 case SystemZ::CallBCR:
223 .addReg(SystemZ::R1D);
226 case SystemZ::CRBCall:
231 .addReg(SystemZ::R1D)
235 case SystemZ::CGRBCall:
240 .addReg(SystemZ::R1D)
244 case SystemZ::CIBCall:
249 .addReg(SystemZ::R1D)
253 case SystemZ::CGIBCall:
258 .addReg(SystemZ::R1D)
262 case SystemZ::CLRBCall:
267 .addReg(SystemZ::R1D)
271 case SystemZ::CLGRBCall:
276 .addReg(SystemZ::R1D)
280 case SystemZ::CLIBCall:
285 .addReg(SystemZ::R1D)
289 case SystemZ::CLGIBCall:
294 .addReg(SystemZ::R1D)
318 case SystemZ::IILF64:
324 case SystemZ::IIHF64:
330 case SystemZ::RISBHH:
331 case SystemZ::RISBHL:
335 case SystemZ::RISBLH:
336 case SystemZ::RISBLL:
340 case SystemZ::VLVGP32:
385 #define LOWER_LOW(NAME) \ 386 case SystemZ::NAME##64: LoweredMI = lowerRILow(MI, SystemZ::NAME); break 402 #define LOWER_HIGH(NAME) \ 403 case SystemZ::NAME##64: LoweredMI = lowerRIHigh(MI, SystemZ::NAME); break 419 case SystemZ::Serialize:
429 case SystemZ::MemBarrier:
437 case SystemZ::Trap: {
450 case SystemZ::CondTrap: {
463 case TargetOpcode::STACKMAP:
467 case TargetOpcode::PATCHPOINT:
468 LowerPATCHPOINT(*MI,
Lower);
472 Lower.lower(MI, LoweredMI);
487 else if (NumBytes < 4) {
489 .addImm(0).addReg(SystemZ::R0D), STI);
492 else if (NumBytes < 6) {
494 .addImm(0).addReg(0).addImm(0).addReg(0),
502 .addImm(0).addExpr(Dot), STI);
515 assert(NumNOPBytes % 2 == 0 &&
"Invalid number of NOP bytes requested!");
518 unsigned ShadowBytes = 0;
522 while (ShadowBytes < NumNOPBytes) {
523 if (MII == MBB.
end() ||
524 MII->getOpcode() == TargetOpcode::PATCHPOINT ||
525 MII->getOpcode() == TargetOpcode::STACKMAP)
534 while (ShadowBytes < NumNOPBytes)
541 void SystemZAsmPrinter::LowerPATCHPOINT(
const MachineInstr &MI,
546 unsigned EncodedBytes = 0;
549 if (CalleeMO.
isImm()) {
550 uint64_t CallTarget = CalleeMO.
getImm();
552 unsigned ScratchIdx = -1;
553 unsigned ScratchReg = 0;
557 }
while (ScratchReg == SystemZ::R0D);
562 .addImm(CallTarget & 0xFFFFFFFF));
564 if (CallTarget >> 32) {
567 .addImm(CallTarget >> 32));
572 .addReg(SystemZ::R14D)
573 .addReg(ScratchReg));
579 .addReg(SystemZ::R14D)
586 assert(NumBytes >= EncodedBytes &&
587 "Patchpoint can't request size less than the length of a call.");
588 assert((NumBytes - EncodedBytes) % 2 == 0 &&
589 "Invalid number of NOP bytes requested!");
590 while (EncodedBytes < NumBytes)
624 const char *ExtraCode,
626 if (ExtraCode && *ExtraCode ==
'n') {
641 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. ...
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.
unsigned getReg() const
getReg - Returns the register number.
void LLVMInitializeSystemZAsmPrinter()
static unsigned EmitNop(MCContext &OutContext, MCStreamer &OutStreamer, unsigned NumBytes, const MCSubtargetInfo &STI)
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, bool PrintSchedInfo=false)
Emit the given Instruction into the current section.
static MCInst lowerSubvectorLoad(const MachineInstr *MI, unsigned Opcode)
amdgpu Simplify well known AMD library false Value Value const Twine & Name
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.
MCOperand lowerOperand(const MachineOperand &MO) const
MCContext & getContext() const
static MCInst lowerSubvectorStore(const MachineInstr *MI, unsigned Opcode)
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)
static MCInst lowerRIHigh(const MachineInstr *MI, unsigned Opcode)
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.
static const MCSymbolRefExpr * getTLSGetOffset(MCContext &Context)
void recordPatchPoint(const MachineInstr &MI)
Generate a stackmap record for a patchpoint instruction.
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant...
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
MCSymbol * getSymbol(const GlobalValue *GV) const
MachineOperand class - Representation of each machine instruction operand.
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as...
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
static MCSymbolRefExpr::VariantKind getModifierVariantKind(SystemZCP::SystemZCPModifier Modifier)
unsigned getRegAsGR64(unsigned Reg)
unsigned getRegAsVR128(unsigned Reg)
static MCInst lowerRILow(const MachineInstr *MI, unsigned Opcode)
void recordStackMap(const MachineInstr &MI)
Generate a stackmap record for a stackmap instruction.
const MachineBasicBlock * getParent() const
Target & getTheSystemZTarget()
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
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.
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())
static void printOperand(const MCOperand &MO, const MCAsmInfo *MAI, raw_ostream &O)
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.
const MachineOperand & getCallTarget() const
Returns the target of the underlying call.
StringRef - Represent a constant reference to a string, i.e.
const MachineOperand & getOperand(unsigned i) const
Instances of this class represent operands of the MCInst class.
const MCExpr * getExpr(const MachineOperand &MO, MCSymbolRefExpr::VariantKind Kind) const
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx)