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 { |
Chris Lattner | b36cbd0 | 2005-07-01 22:44:09 +0000 | [diff] [blame] | 21 | |
| 22 | struct X86ATTAsmPrinter : public X86SharedAsmPrinter { |
Evan Cheng | c4c6257 | 2006-03-13 23:20:37 +0000 | [diff] [blame] | 23 | X86ATTAsmPrinter(std::ostream &O, X86TargetMachine &TM) |
Chris Lattner | b36cbd0 | 2005-07-01 22:44:09 +0000 | [diff] [blame] | 24 | : X86SharedAsmPrinter(O, TM) { } |
| 25 | |
| 26 | virtual const char *getPassName() const { |
| 27 | return "X86 AT&T-Style Assembly Printer"; |
| 28 | } |
| 29 | |
| 30 | /// printInstruction - This method is automatically generated by tablegen |
| 31 | /// from the instruction set description. This method returns true if the |
| 32 | /// machine instruction was sufficiently described to print it, otherwise it |
| 33 | /// returns false. |
| 34 | bool printInstruction(const MachineInstr *MI); |
| 35 | |
Chris Lattner | a3b8c57 | 2006-02-06 23:41:19 +0000 | [diff] [blame] | 36 | // These methods are used by the tablegen'erated instruction printer. |
| 37 | void printOperand(const MachineInstr *MI, unsigned OpNo, |
| 38 | const char *Modifier = 0); |
Nate Begeman | 391c5d2 | 2005-11-30 18:54:35 +0000 | [diff] [blame] | 39 | void printi8mem(const MachineInstr *MI, unsigned OpNo) { |
Chris Lattner | b36cbd0 | 2005-07-01 22:44:09 +0000 | [diff] [blame] | 40 | printMemReference(MI, OpNo); |
| 41 | } |
Nate Begeman | 391c5d2 | 2005-11-30 18:54:35 +0000 | [diff] [blame] | 42 | void printi16mem(const MachineInstr *MI, unsigned OpNo) { |
| 43 | printMemReference(MI, OpNo); |
| 44 | } |
| 45 | void printi32mem(const MachineInstr *MI, unsigned OpNo) { |
| 46 | printMemReference(MI, OpNo); |
| 47 | } |
| 48 | void printi64mem(const MachineInstr *MI, unsigned OpNo) { |
| 49 | printMemReference(MI, OpNo); |
| 50 | } |
Evan Cheng | 470a6ad | 2006-02-22 02:26:30 +0000 | [diff] [blame] | 51 | void printi128mem(const MachineInstr *MI, unsigned OpNo) { |
| 52 | printMemReference(MI, OpNo); |
| 53 | } |
Nate Begeman | 391c5d2 | 2005-11-30 18:54:35 +0000 | [diff] [blame] | 54 | void printf32mem(const MachineInstr *MI, unsigned OpNo) { |
| 55 | printMemReference(MI, OpNo); |
| 56 | } |
| 57 | void printf64mem(const MachineInstr *MI, unsigned OpNo) { |
| 58 | printMemReference(MI, OpNo); |
| 59 | } |
Evan Cheng | 223547a | 2006-01-31 22:28:30 +0000 | [diff] [blame] | 60 | void printf128mem(const MachineInstr *MI, unsigned OpNo) { |
Nate Begeman | 391c5d2 | 2005-11-30 18:54:35 +0000 | [diff] [blame] | 61 | printMemReference(MI, OpNo); |
| 62 | } |
| 63 | |
Evan Cheng | 3d48a90 | 2006-04-28 21:19:05 +0000 | [diff] [blame^] | 64 | bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, |
| 65 | unsigned AsmVariant, const char *ExtraCode); |
| 66 | bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, |
| 67 | unsigned AsmVariant, const char *ExtraCode); |
| 68 | void printMachineInstruction(const MachineInstr *MI); |
Nate Begeman | 391c5d2 | 2005-11-30 18:54:35 +0000 | [diff] [blame] | 69 | void printSSECC(const MachineInstr *MI, unsigned Op); |
Chris Lattner | b36cbd0 | 2005-07-01 22:44:09 +0000 | [diff] [blame] | 70 | void printMemReference(const MachineInstr *MI, unsigned Op); |
Evan Cheng | 7ccced6 | 2006-02-18 00:15:05 +0000 | [diff] [blame] | 71 | void printPICLabel(const MachineInstr *MI, unsigned Op); |
Chris Lattner | b36cbd0 | 2005-07-01 22:44:09 +0000 | [diff] [blame] | 72 | bool runOnMachineFunction(MachineFunction &F); |
| 73 | }; |
| 74 | |
Chris Lattner | b36cbd0 | 2005-07-01 22:44:09 +0000 | [diff] [blame] | 75 | } // end namespace llvm |
| 76 | |
| 77 | #endif |