Chris Lattner | b36cbd0 | 2005-07-01 22:44:09 +0000 | [diff] [blame] | 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 | |
Chris Lattner | a3b8c57 | 2006-02-06 23:41:19 +0000 | [diff] [blame^] | 37 | // These methods are used by the tablegen'erated instruction printer. |
| 38 | void printOperand(const MachineInstr *MI, unsigned OpNo, |
| 39 | const char *Modifier = 0); |
Nate Begeman | 391c5d2 | 2005-11-30 18:54:35 +0000 | [diff] [blame] | 40 | void printi8mem(const MachineInstr *MI, unsigned OpNo) { |
Chris Lattner | b36cbd0 | 2005-07-01 22:44:09 +0000 | [diff] [blame] | 41 | printMemReference(MI, OpNo); |
| 42 | } |
Nate Begeman | 391c5d2 | 2005-11-30 18:54:35 +0000 | [diff] [blame] | 43 | void printi16mem(const MachineInstr *MI, unsigned OpNo) { |
| 44 | printMemReference(MI, OpNo); |
| 45 | } |
| 46 | void printi32mem(const MachineInstr *MI, unsigned OpNo) { |
| 47 | printMemReference(MI, OpNo); |
| 48 | } |
| 49 | void printi64mem(const MachineInstr *MI, unsigned OpNo) { |
| 50 | printMemReference(MI, OpNo); |
| 51 | } |
| 52 | void printf32mem(const MachineInstr *MI, unsigned OpNo) { |
| 53 | printMemReference(MI, OpNo); |
| 54 | } |
| 55 | void printf64mem(const MachineInstr *MI, unsigned OpNo) { |
| 56 | printMemReference(MI, OpNo); |
| 57 | } |
Evan Cheng | 223547a | 2006-01-31 22:28:30 +0000 | [diff] [blame] | 58 | void printf128mem(const MachineInstr *MI, unsigned OpNo) { |
Nate Begeman | 391c5d2 | 2005-11-30 18:54:35 +0000 | [diff] [blame] | 59 | printMemReference(MI, OpNo); |
| 60 | } |
| 61 | |
Chris Lattner | b36cbd0 | 2005-07-01 22:44:09 +0000 | [diff] [blame] | 62 | void printMachineInstruction(const MachineInstr *MI); |
Nate Begeman | 391c5d2 | 2005-11-30 18:54:35 +0000 | [diff] [blame] | 63 | void printSSECC(const MachineInstr *MI, unsigned Op); |
Chris Lattner | b36cbd0 | 2005-07-01 22:44:09 +0000 | [diff] [blame] | 64 | void printMemReference(const MachineInstr *MI, unsigned Op); |
| 65 | bool runOnMachineFunction(MachineFunction &F); |
| 66 | }; |
| 67 | |
| 68 | } // end namespace x86 |
| 69 | } // end namespace llvm |
| 70 | |
| 71 | #endif |