AVX-512: Added intrinsics for vcvt, vcvtt, vrndscale, vcmp
[oota-llvm.git] / lib / Target / X86 / InstPrinter / X86IntelInstPrinter.h
1 //= X86IntelInstPrinter.h - Convert X86 MCInst to assembly syntax -*- C++ -*-=//
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
22 class MCOperand;
23   
24 class X86IntelInstPrinter : public MCInstPrinter {
25 public:
26   X86IntelInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
27                       const MCRegisterInfo &MRI)
28     : MCInstPrinter(MAI, MII, MRI) {}
29
30   virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
31   virtual void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot);
32   
33   // Autogenerated by tblgen.
34   void printInstruction(const MCInst *MI, raw_ostream &O);
35   static const char *getRegisterName(unsigned RegNo);
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 printSSECC(const MCInst *MI, unsigned Op, raw_ostream &O);
40   void printAVXCC(const MCInst *MI, unsigned Op, raw_ostream &O);
41   void printPCRelImm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
42   void printMemOffset(const MCInst *MI, unsigned OpNo, raw_ostream &O);
43   void printRoundingControl(const MCInst *MI, unsigned Op, raw_ostream &OS);
44
45   void printopaquemem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
46     O << "opaque ptr ";
47     printMemReference(MI, OpNo, O);
48   }
49   
50   void printi8mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
51     O << "byte ptr ";
52     printMemReference(MI, OpNo, O);
53   }
54   void printi16mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
55     O << "word ptr ";
56     printMemReference(MI, OpNo, O);
57   }
58   void printi32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
59     O << "dword ptr ";
60     printMemReference(MI, OpNo, O);
61   }
62   void printi64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
63     O << "qword ptr ";
64     printMemReference(MI, OpNo, O);
65   }
66   void printi128mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
67     O << "xmmword ptr ";
68     printMemReference(MI, OpNo, O);
69   }
70   void printi256mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
71     O << "ymmword ptr ";
72     printMemReference(MI, OpNo, O);
73   }
74   void printi512mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
75     O << "zmmword ptr ";
76     printMemReference(MI, OpNo, O);
77   }
78   void printf32mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
79     O << "dword ptr ";
80     printMemReference(MI, OpNo, O);
81   }
82   void printf64mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
83     O << "qword ptr ";
84     printMemReference(MI, OpNo, O);
85   }
86   void printf80mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
87     O << "xword ptr ";
88     printMemReference(MI, OpNo, O);
89   }
90   void printf128mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
91     O << "xmmword ptr ";
92     printMemReference(MI, OpNo, O);
93   }
94   void printf256mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
95     O << "ymmword ptr ";
96     printMemReference(MI, OpNo, O);
97   }
98   void printf512mem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
99     O << "zmmword ptr ";
100     printMemReference(MI, OpNo, O);
101   }
102
103   void printMemOffs8(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
104     O << "byte ptr ";
105     printMemOffset(MI, OpNo, O);
106   }
107   void printMemOffs16(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
108     O << "word ptr ";
109     printMemOffset(MI, OpNo, O);
110   }
111   void printMemOffs32(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
112     O << "dword ptr ";
113     printMemOffset(MI, OpNo, O);
114   }
115   void printMemOffs64(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
116     O << "qword ptr ";
117     printMemOffset(MI, OpNo, O);
118   }
119 };
120   
121 }
122
123 #endif