use predicates in DBG_VALUE printing code to simplify it.
[oota-llvm.git] / lib / Target / X86 / AsmPrinter / X86IntelInstPrinter.h
1 //===-- X86IntelInstPrinter.h - Convert X86 MCInst to assembly syntax -----===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This class prints an X86 MCInst to intel style .s file syntax.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef X86_INTEL_INST_PRINTER_H
15 #define X86_INTEL_INST_PRINTER_H
16
17 #include "llvm/MC/MCInstPrinter.h"
18 #include "llvm/Support/raw_ostream.h"
19
20 namespace llvm {
21   class MCOperand;
22   
23 class X86IntelInstPrinter : public MCInstPrinter {
24 public:
25   X86IntelInstPrinter(const MCAsmInfo &MAI)
26     : MCInstPrinter(MAI) {}
27   
28   virtual void printInst(const MCInst *MI, raw_ostream &OS);
29   virtual StringRef getOpcodeName(unsigned Opcode) const;
30   
31   // Autogenerated by tblgen.
32   void printInstruction(const MCInst *MI, raw_ostream &O);
33   static const char *getRegisterName(unsigned RegNo);
34   static const char *getInstructionName(unsigned Opcode);
35
36
37   void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
38   void printMemReference(const MCInst *MI, unsigned Op, raw_ostream &O);
39   void printLeaMemReference(const MCInst *MI, unsigned Op, raw_ostream &O);
40   void printSSECC(const MCInst *MI, unsigned Op, raw_ostream &O);
41   void print_pcrel_imm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
42   
43   void printopaquemem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
44     O << "OPAQUE PTR ";
45     printMemReference(MI, OpNo, O);
46   }
47   
48   void printi8mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
49     O << "BYTE PTR ";
50     printMemReference(MI, OpNo, O);
51   }
52   void printi16mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
53     O << "WORD PTR ";
54     printMemReference(MI, OpNo, O);
55   }
56   void printi32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
57     O << "DWORD PTR ";
58     printMemReference(MI, OpNo, O);
59   }
60   void printi64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
61     O << "QWORD PTR ";
62     printMemReference(MI, OpNo, O);
63   }
64   void printi128mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
65     O << "XMMWORD PTR ";
66     printMemReference(MI, OpNo, O);
67   }
68   void printf32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
69     O << "DWORD PTR ";
70     printMemReference(MI, OpNo, O);
71   }
72   void printf64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
73     O << "QWORD PTR ";
74     printMemReference(MI, OpNo, O);
75   }
76   void printf80mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
77     O << "XWORD PTR ";
78     printMemReference(MI, OpNo, O);
79   }
80   void printf128mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
81     O << "XMMWORD PTR ";
82     printMemReference(MI, OpNo, O);
83   }
84   void printlea32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
85     O << "DWORD PTR ";
86     printLeaMemReference(MI, OpNo, O);
87   }
88   void printlea64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
89     O << "QWORD PTR ";
90     printLeaMemReference(MI, OpNo, O);
91   }
92   void printlea64_32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
93     O << "QWORD PTR ";
94     printLeaMemReference(MI, OpNo, O);
95   }
96 };
97   
98 }
99
100 #endif