1 //===-- X86ATTAsmPrinter.h - Convert X86 LLVM code to AT&T assembly -------===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
10 // AT&T assembly code printer class.
12 //===----------------------------------------------------------------------===//
14 #ifndef X86ATTASMPRINTER_H
15 #define X86ATTASMPRINTER_H
17 #include "X86AsmPrinter.h"
18 #include "llvm/CodeGen/ValueTypes.h"
22 struct X86ATTAsmPrinter
: public X86SharedAsmPrinter
{
23 X86ATTAsmPrinter(std::ostream
&O
, X86TargetMachine
&TM
, const TargetAsmInfo
*T
)
24 : X86SharedAsmPrinter(O
, TM
, T
) { }
26 virtual const char *getPassName() const {
27 return "X86 AT&T-Style Assembly Printer";
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
34 bool printInstruction(const MachineInstr
*MI
);
36 // These methods are used by the tablegen'erated instruction printer.
37 void printOperand(const MachineInstr
*MI
, unsigned OpNo
,
38 const char *Modifier
= 0, bool NotRIPRel
= false);
39 void printi8mem(const MachineInstr
*MI
, unsigned OpNo
) {
40 printMemReference(MI
, OpNo
);
42 void printi16mem(const MachineInstr
*MI
, unsigned OpNo
) {
43 printMemReference(MI
, OpNo
);
45 void printi32mem(const MachineInstr
*MI
, unsigned OpNo
) {
46 printMemReference(MI
, OpNo
);
48 void printi64mem(const MachineInstr
*MI
, unsigned OpNo
) {
49 printMemReference(MI
, OpNo
);
51 void printi128mem(const MachineInstr
*MI
, unsigned OpNo
) {
52 printMemReference(MI
, OpNo
);
54 void printf32mem(const MachineInstr
*MI
, unsigned OpNo
) {
55 printMemReference(MI
, OpNo
);
57 void printf64mem(const MachineInstr
*MI
, unsigned OpNo
) {
58 printMemReference(MI
, OpNo
);
60 void printf80mem(const MachineInstr
*MI
, unsigned OpNo
) {
61 printMemReference(MI
, OpNo
);
63 void printf128mem(const MachineInstr
*MI
, unsigned OpNo
) {
64 printMemReference(MI
, OpNo
);
66 void printlea64_32mem(const MachineInstr
*MI
, unsigned OpNo
) {
67 printMemReference(MI
, OpNo
, "subreg64");
70 bool printAsmMRegister(const MachineOperand
&MO
, const char Mode
);
71 bool PrintAsmOperand(const MachineInstr
*MI
, unsigned OpNo
,
72 unsigned AsmVariant
, const char *ExtraCode
);
73 bool PrintAsmMemoryOperand(const MachineInstr
*MI
, unsigned OpNo
,
74 unsigned AsmVariant
, const char *ExtraCode
);
76 void printMachineInstruction(const MachineInstr
*MI
);
77 void printSSECC(const MachineInstr
*MI
, unsigned Op
);
78 void printMemReference(const MachineInstr
*MI
, unsigned Op
,
79 const char *Modifier
=NULL
);
80 void printPICLabel(const MachineInstr
*MI
, unsigned Op
);
81 bool runOnMachineFunction(MachineFunction
&F
);
83 /// getSectionForFunction - Return the section that we should emit the
84 /// specified function body into.
85 virtual std::string
getSectionForFunction(const Function
&F
) const;
88 } // end namespace llvm