AMDGPUInstPrinter.cpp revision e30b4644b613a130318cdf240ad237b0afbc525a
1
2#include "AMDGPUInstPrinter.h"
3#include "llvm/MC/MCInst.h"
4
5using namespace llvm;
6
7void AMDGPUInstPrinter::printInst(const MCInst *MI, raw_ostream &OS,
8                             StringRef Annot) {
9  printInstruction(MI, OS);
10
11  printAnnotation(OS, Annot);
12}
13
14void 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
29void AMDGPUInstPrinter::printMemOperand(const MCInst *MI, unsigned OpNo,
30                                        raw_ostream &O) {
31  printOperand(MI, OpNo, O);
32}
33
34#include "AMDGPUGenAsmWriter.inc"
35