1 2 #include "AMDGPUInstPrinter.h" 3 #include "llvm/MC/MCInst.h" 4 5 using namespace llvm; 6 7 void AMDGPUInstPrinter::printInst(const MCInst *MI, raw_ostream &OS, 8 StringRef Annot) { 9 printInstruction(MI, OS); 10 11 printAnnotation(OS, Annot); 12 } 13 14 void AMDGPUInstPrinter::printOperand(const MCInst *MI, unsigned OpNo, 15 raw_ostream &O) { 16 17 const MCOperand &Op = MI->getOperand(OpNo); 18 if (Op.isReg()) { 19 O << getRegisterName(Op.getReg()); 20 } else if (Op.isImm()) { 21 O << Op.getImm(); 22 } else if (Op.isFPImm()) { 23 O << Op.getFPImm(); 24 } else { 25 assert(!"unknown operand type in printOperand"); 26 } 27 } 28 29 void AMDGPUInstPrinter::printMemOperand(const MCInst *MI, unsigned OpNo, 30 raw_ostream &O) { 31 printOperand(MI, OpNo, O); 32 } 33 34 #include "AMDGPUGenAsmWriter.inc" 35