blob: d8196fe6bb4ac7b7f84fb3e3f13487d95384441b [file] [log] [blame]
Chris Lattnerb36cbd02005-07-01 22:44:09 +00001//===-- 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
20namespace llvm {
Chris Lattnerb36cbd02005-07-01 22:44:09 +000021
22struct X86ATTAsmPrinter : public X86SharedAsmPrinter {
Evan Chengc4c62572006-03-13 23:20:37 +000023 X86ATTAsmPrinter(std::ostream &O, X86TargetMachine &TM)
Chris Lattnerb36cbd02005-07-01 22:44:09 +000024 : 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 Lattnera3b8c572006-02-06 23:41:19 +000036 // These methods are used by the tablegen'erated instruction printer.
37 void printOperand(const MachineInstr *MI, unsigned OpNo,
38 const char *Modifier = 0);
Nate Begeman391c5d22005-11-30 18:54:35 +000039 void printi8mem(const MachineInstr *MI, unsigned OpNo) {
Chris Lattnerb36cbd02005-07-01 22:44:09 +000040 printMemReference(MI, OpNo);
41 }
Nate Begeman391c5d22005-11-30 18:54:35 +000042 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 Cheng470a6ad2006-02-22 02:26:30 +000051 void printi128mem(const MachineInstr *MI, unsigned OpNo) {
52 printMemReference(MI, OpNo);
53 }
Nate Begeman391c5d22005-11-30 18:54:35 +000054 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 Cheng223547a2006-01-31 22:28:30 +000060 void printf128mem(const MachineInstr *MI, unsigned OpNo) {
Nate Begeman391c5d22005-11-30 18:54:35 +000061 printMemReference(MI, OpNo);
62 }
63
Evan Cheng3d48a902006-04-28 21:19:05 +000064 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 Begeman391c5d22005-11-30 18:54:35 +000069 void printSSECC(const MachineInstr *MI, unsigned Op);
Chris Lattnerb36cbd02005-07-01 22:44:09 +000070 void printMemReference(const MachineInstr *MI, unsigned Op);
Evan Cheng7ccced62006-02-18 00:15:05 +000071 void printPICLabel(const MachineInstr *MI, unsigned Op);
Chris Lattnerb36cbd02005-07-01 22:44:09 +000072 bool runOnMachineFunction(MachineFunction &F);
73};
74
Chris Lattnerb36cbd02005-07-01 22:44:09 +000075} // end namespace llvm
76
77#endif