Added preliminary x86 subtarget support.
[oota-llvm.git] / lib / Target / X86 / X86ATTAsmPrinter.h
1 //===-- X86ATTAsmPrinter.h - Convert X86 LLVM code to Intel assembly ------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // AT&T assembly code printer class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef X86ATTASMPRINTER_H
15 #define X86ATTASMPRINTER_H
16
17 #include "X86AsmPrinter.h"
18 #include "llvm/CodeGen/ValueTypes.h"
19
20 namespace llvm {
21 namespace x86 {
22
23 struct X86ATTAsmPrinter : public X86SharedAsmPrinter {
24   X86ATTAsmPrinter(std::ostream &O, TargetMachine &TM)
25     : X86SharedAsmPrinter(O, TM) { }
26
27   virtual const char *getPassName() const {
28     return "X86 AT&T-Style Assembly Printer";
29   }
30
31   /// printInstruction - This method is automatically generated by tablegen
32   /// from the instruction set description.  This method returns true if the
33   /// machine instruction was sufficiently described to print it, otherwise it
34   /// returns false.
35   bool printInstruction(const MachineInstr *MI);
36
37   // This method is used by the tablegen'erated instruction printer.
38   void printOperand(const MachineInstr *MI, unsigned OpNo){
39     printOp(MI->getOperand(OpNo));
40   }
41   void printCallOperand(const MachineInstr *MI, unsigned OpNo) {
42     printOp(MI->getOperand(OpNo), true); // Don't print '$' prefix.
43   }
44   void printi8mem(const MachineInstr *MI, unsigned OpNo) {
45     printMemReference(MI, OpNo);
46   }
47   void printi16mem(const MachineInstr *MI, unsigned OpNo) {
48     printMemReference(MI, OpNo);
49   }
50   void printi32mem(const MachineInstr *MI, unsigned OpNo) {
51     printMemReference(MI, OpNo);
52   }
53   void printi64mem(const MachineInstr *MI, unsigned OpNo) {
54     printMemReference(MI, OpNo);
55   }
56   void printf32mem(const MachineInstr *MI, unsigned OpNo) {
57     printMemReference(MI, OpNo);
58   }
59   void printf64mem(const MachineInstr *MI, unsigned OpNo) {
60     printMemReference(MI, OpNo);
61   }
62   void printf80mem(const MachineInstr *MI, unsigned OpNo) {
63     printMemReference(MI, OpNo);
64   }
65   
66   void printMachineInstruction(const MachineInstr *MI);
67   void printOp(const MachineOperand &MO, bool isCallOperand = false);
68   void printSSECC(const MachineInstr *MI, unsigned Op);
69   void printMemReference(const MachineInstr *MI, unsigned Op);
70   bool runOnMachineFunction(MachineFunction &F);
71 };
72
73 } // end namespace x86
74 } // end namespace llvm
75
76 #endif