24 #define DEBUG_TYPE "asm-printer" 34 #define GET_INSTRUCTION_NAME 35 #define PRINT_ALIAS_INSTR 36 #include "SparcGenAsmWriter.inc" 49 if (!printAliasInstr(MI, STI, O) && !printSparcAliasInstr(MI, STI, O))
50 printInstruction(MI, STI, O);
51 printAnnotation(O, Annot);
58 default:
return false;
66 default:
return false;
72 case SP::I7: O <<
"\tret";
return true;
73 case SP::O7: O <<
"\tretl";
return true;
83 case SP::V9FCMPS:
case SP::V9FCMPD:
case SP::V9FCMPQ:
84 case SP::V9FCMPES:
case SP::V9FCMPED:
case SP::V9FCMPEQ: {
93 case SP::V9FCMPS: O <<
"\tfcmps ";
break;
94 case SP::V9FCMPD: O <<
"\tfcmpd ";
break;
95 case SP::V9FCMPQ: O <<
"\tfcmpq ";
break;
96 case SP::V9FCMPES: O <<
"\tfcmpes ";
break;
97 case SP::V9FCMPED: O <<
"\tfcmped ";
break;
98 case SP::V9FCMPEQ: O <<
"\tfcmpeq ";
break;
114 printRegName(O, MO.
getReg());
131 O << ((int) MO.
getImm() & 0x7f);
136 assert(MO.
isExpr() &&
"Unknown operand kind in printOperand");
146 if (Modifier && !strcmp(Modifier,
"arith")) {
175 case SP::MOVFCCrr:
case SP::V9MOVFCCrr:
176 case SP::MOVFCCri:
case SP::V9MOVFCCri:
177 case SP::FMOVS_FCC:
case SP::V9FMOVS_FCC:
178 case SP::FMOVD_FCC:
case SP::V9FMOVD_FCC:
179 case SP::FMOVQ_FCC:
case SP::V9FMOVQ_FCC:
181 CC = (CC < 16) ? (CC + 16) : CC;
186 CC = (CC < 32) ? (CC + 32) : CC;
202 static const char *
const TagNames[] = {
203 "#LoadLoad",
"#StoreLoad",
"#LoadStore",
"#StoreStore",
204 "#Lookaside",
"#MemIssue",
"#Sync"};
214 for (
unsigned i = 0; i <
sizeof(
TagNames) /
sizeof(
char *); i++) {
215 if (Imm & (1 << i)) {
216 O << (First ?
"" :
" | ") << TagNames[i];
This class represents lattice values for constants.
void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot, const MCSubtargetInfo &STI) override
Print the specified MCInst to the specified raw_ostream.
const FeatureBitset & getFeatureBits() const
void printMembarTag(const MCInst *MI, int opNum, const MCSubtargetInfo &STI, raw_ostream &O)
static const char * SPARCCondCodeToString(SPCC::CondCodes CC)
unsigned getReg() const
Returns the register number.
static std::string getRegisterName(const TargetRegisterInfo *TRI, unsigned Reg)
void printRegName(raw_ostream &OS, unsigned RegNo) const override
Print the assembler register name.
const MCExpr * getExpr() const
Instances of this class represent a single low-level machine instruction.
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
void printMemOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI, raw_ostream &OS, const char *Modifier=nullptr)
unsigned getNumOperands() const
static const EnumEntry< unsigned > TagNames[]
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static void printMemOperand(raw_ostream &OS, const MachineMemOperand &MMO, const MachineFunction *MF, const Module *M, const MachineFrameInfo *MFI, const TargetInstrInfo *TII, LLVMContext &Ctx)
const MCOperand & getOperand(unsigned i) const
bool printGetPCX(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &OS)
void printOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI, raw_ostream &OS)
void printCCOperand(const MCInst *MI, int opNum, const MCSubtargetInfo &STI, raw_ostream &OS)
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
bool isV9(const MCSubtargetInfo &STI) const
Generic base class for all target subtargets.
LLVM_NODISCARD std::string lower() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
unsigned getOpcode() const
Instances of this class represent operands of the MCInst class.
bool printSparcAliasInstr(const MCInst *MI, const MCSubtargetInfo &STI, raw_ostream &OS)