79 if (
MI->memoperands_empty())
84 if (MMO->getAlign() < Alignment)
85 Alignment = MMO->getAlign();
87 unsigned AlignmentHint = 0;
88 if (Alignment >=
Align(16))
90 else if (Alignment >=
Align(8))
92 if (AlignmentHint == 0)
106 .
addReg(
MI->getOperand(3).getReg());
140 SystemZ_MC::verifyInstructionPredicates(
MI->getOpcode(),
145 switch (
MI->getOpcode()) {
146 case SystemZ::Return:
151 case SystemZ::CondReturn:
158 case SystemZ::CRBReturn:
167 case SystemZ::CGRBReturn:
176 case SystemZ::CIBReturn:
185 case SystemZ::CGIBReturn:
194 case SystemZ::CLRBReturn:
203 case SystemZ::CLGRBReturn:
212 case SystemZ::CLIBReturn:
221 case SystemZ::CLGIBReturn:
230 case SystemZ::CallBR:
232 .
addReg(
MI->getOperand(0).getReg());
235 case SystemZ::CallBCR:
239 .
addReg(
MI->getOperand(2).getReg());
242 case SystemZ::CRBCall:
251 case SystemZ::CGRBCall:
260 case SystemZ::CIBCall:
269 case SystemZ::CGIBCall:
278 case SystemZ::CLRBCall:
287 case SystemZ::CLGRBCall:
296 case SystemZ::CLIBCall:
305 case SystemZ::CLGIBCall:
314 case SystemZ::IILF64:
317 .
addImm(
MI->getOperand(2).getImm());
320 case SystemZ::IIHF64:
323 .
addImm(
MI->getOperand(2).getImm());
326 case SystemZ::RISBHH:
327 case SystemZ::RISBHL:
331 case SystemZ::RISBLH:
332 case SystemZ::RISBLL:
336 case SystemZ::VLVGP32:
399 case SystemZ::LFER_16:
407 case SystemZ::LEFR_16:
411#define LOWER_LOW(NAME) \
412 case SystemZ::NAME##64: LoweredMI = lowerRILow(MI, SystemZ::NAME); break
428#define LOWER_HIGH(NAME) \
429 case SystemZ::NAME##64: LoweredMI = lowerRIHigh(MI, SystemZ::NAME); break
445 case SystemZ::Serialize:
458 case SystemZ::Trap: {
471 case SystemZ::CondTrap: {
484 case TargetOpcode::PATCHABLE_FUNCTION_EXIT:
487 case TargetOpcode::PATCHABLE_TAIL_CALL:
491 "around this assert.");
493 case SystemZ::EXRL_Pseudo: {
494 unsigned TargetInsOpc =
MI->getOperand(0).getImm();
495 Register LenMinus1Reg =
MI->getOperand(1).getReg();
496 Register DestReg =
MI->getOperand(2).getReg();
497 int64_t DestDisp =
MI->getOperand(3).getImm();
499 int64_t SrcDisp =
MI->getOperand(5).getImm();
516 MCInstBuilder(SystemZ::EXRL).addReg(LenMinus1Reg).addExpr(Dot));
526 case SystemZ::EH_SjLj_Setup:
561 else if (MCOp.
isImm())
587 const char *ExtraCode,
593 if ((ExtraCode[0] ==
'N' || ExtraCode[0] ==
'M') && !ExtraCode[1] &&
594 MO.
isReg() && SystemZ::GR128BitRegClass.contains(MO.
getReg()))
601 MCOp =
Lower.lowerOperand(MO);
609 const char *ExtraCode,
611 if (ExtraCode && ExtraCode[0] && !ExtraCode[1]) {
612 switch (ExtraCode[0]) {
619 OS <<
MI->getOperand(OpNo + 1).getImm();
628 MI->getOperand(OpNo + 2).getReg(), OS);
635 "SystemZ Assembly Printer",
false,
false)
640 if (TM.getTargetTriple().isOSzOS())
649 createSystemZAsmPrinter);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define LLVM_EXTERNAL_VISIBILITY
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
static MCInst lowerVecEltExtraction(const MachineInstr *MI, unsigned Opcode)
std::unique_ptr< MCStreamer > && Streamer
return new SystemZELFAsmPrinter(TM, std::move(Streamer))
static void lowerAlignmentHint(const MachineInstr *MI, MCInst &LoweredMI, unsigned Opcode)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSystemZAsmPrinter()
static void printFormattedRegName(const MCAsmInfo *MAI, unsigned RegNo, raw_ostream &OS)
static MCInst lowerRILow(const MachineInstr *MI, unsigned Opcode)
static MCInst lowerRIHigh(const MachineInstr *MI, unsigned Opcode)
static void printAddress(const MCAsmInfo *MAI, unsigned Base, const MCOperand &DispMO, unsigned Index, raw_ostream &OS)
static MCInst lowerSubvectorStore(const MachineInstr *MI, unsigned Opcode)
static MCInst lowerVecEltInsertion(const MachineInstr *MI, unsigned Opcode)
static MCInst lowerSubvectorLoad(const MachineInstr *MI, unsigned Opcode)
static MCInst lowerRIEfLow(const MachineInstr *MI, unsigned Opcode)
This class is intended to be used as a driving class for all asm writers.
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
TargetMachine & TM
Target machine description.
MachineFunction * MF
The current machine function.
MCContext & OutContext
This is the context for the output file that we are streaming.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
const MCAsmInfo & MAI
Target Asm Printer information.
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.
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)
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...
MCRegister getSubReg(MCRegister Reg, unsigned Idx) const
Returns the physical register number of sub-register "Index" for physical register RegNo.
Streaming machine code generation interface.
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 ...
Representation of each machine instruction.
A description of a memory reference used in the backend.
MachineOperand class - Representation of each machine instruction operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Register getReg() const
getReg - Returns the register number.
Wrapper class representing virtual and physical registers.
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...
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.
static const char * getRegisterName(MCRegister Reg)
static const char * getRegisterName(MCRegister Reg)
std::pair< MCInst, const MCSubtargetInfo * > MCInstSTIPair
EXRLT2SymMap EXRLTargets2Sym
Primary interface to the complete machine description for the target machine.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned getRegAsGR32(unsigned Reg)
unsigned getRegAsGRH32(unsigned Reg)
unsigned getRegAsVR128(unsigned Reg)
unsigned getRegAsGR64(unsigned Reg)
This is an optimization pass for GlobalISel generic memory operations.
Target & getTheSystemZTarget()
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.
Implement std::hash so that hash_code can be used in STL containers.
This struct is a compact representation of a valid (non-zero power of two) alignment.
static void RegisterAsmPrinter(Target &T, Target::AsmPrinterCtorTy Fn)
RegisterAsmPrinter - Register an AsmPrinter implementation for the given target.