17#define DEBUG_TYPE "asm-printer"
19#include "SystemZGenHLASMAsmWriter.inc"
21void SystemZHLASMInstPrinter::printFormattedRegName(
const MCAsmInfo *MAI,
35 unsigned Opcode =
MI->getOpcode();
36 if (Opcode == SystemZ::BRC || Opcode == SystemZ::BRCL ||
37 Opcode == SystemZ::BC || Opcode == SystemZ::BCR ||
38 Opcode == SystemZ::BIC) {
39 uint64_t CCValid =
MI->getOperand(0).getImm();
40 uint64_t CCMask =
MI->getOperand(1).getImm();
44 if (CCMask == 3 || CCMask == 5 || CCMask == 6 || CCMask == 9 ||
45 CCMask == 10 || CCMask == 12) {
46 if ((CCValid & 1) == 0) {
54 unsigned AsmOpcode = 0;
57 AsmOpcode = SystemZ::BRCAsm;
60 AsmOpcode = SystemZ::BRCLAsm;
63 AsmOpcode = SystemZ::BCAsm;
66 AsmOpcode = SystemZ::BCRAsm;
69 AsmOpcode = SystemZ::BICAsm;
74 for (
unsigned I = 2;
I <
MI->getNumOperands(); ++
I)
87 if (!Str.empty() && Str.front() ==
'\t')
88 O <<
" " << Str.substr(1, Str.length());
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This class is intended to be used as a base class for asm properties and features specific to the tar...
WithMarkup markup(raw_ostream &OS, Markup M)
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
Instances of this class represent a single low-level machine instruction.
void addOperand(const MCOperand Op)
void setOpcode(unsigned Op)
const MCOperand & getOperand(unsigned i) const
static MCOperand createImm(int64_t Val)
Wrapper class representing physical registers. Should be passed by value.
Generic base class for all target subtargets.
Represent a constant reference to a string, i.e.
static const char * getRegisterName(MCRegister Reg)
void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O)
void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &O) override
Print the specified MCInst to the specified raw_ostream.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
This is an optimization pass for GlobalISel generic memory operations.