Add support to the X86 backend for emitting ELF files. To use this, we
[oota-llvm.git] / lib / Target / X86 / X86.h
1 //===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
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 // This file contains the entry points for global functions defined in the x86
11 // target library, as used by the LLVM JIT.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef TARGET_X86_H
16 #define TARGET_X86_H
17
18 #include <iosfwd>
19
20 namespace llvm {
21
22 class TargetMachine;
23 class FunctionPass;
24 class IntrinsicLowering;
25
26 enum X86VectorEnum {
27   NoSSE, SSE, SSE2, SSE3
28 };
29
30 extern X86VectorEnum X86Vector;
31
32 /// createX86SimpleInstructionSelector - This pass converts an LLVM function
33 /// into a machine code representation in a very simple peep-hole fashion.  The
34 /// generated code sucks but the implementation is nice and simple.
35 ///
36 FunctionPass *createX86SimpleInstructionSelector(TargetMachine &TM);
37
38 /// createX86PatternInstructionSelector - This pass converts an LLVM function
39 /// into a machine code representation in a more aggressive way.
40 ///
41 FunctionPass *createX86PatternInstructionSelector(TargetMachine &TM);
42
43 /// createX86SSAPeepholeOptimizerPass - Create a pass to perform SSA-based X86
44 /// specific peephole optimizations.
45 ///
46 FunctionPass *createX86SSAPeepholeOptimizerPass();
47
48 /// createX86PeepholeOptimizer - Create a pass to perform X86 specific peephole
49 /// optimizations.
50 ///
51 FunctionPass *createX86PeepholeOptimizerPass();
52
53 /// createX86FloatingPointKiller - This function returns a pass which
54 /// kills every floating point register at the end of each basic block
55 /// because our FloatingPointStackifier cannot handle them.
56 ///
57 FunctionPass *createX86FloatingPointKillerPass();
58
59 /// createX86FloatingPointStackifierPass - This function returns a pass which
60 /// converts floating point register references and pseudo instructions into
61 /// floating point stack references and physical instructions.
62 ///
63 FunctionPass *createX86FloatingPointStackifierPass();
64
65 /// createX86CodePrinterPass - Returns a pass that prints the X86
66 /// assembly code for a MachineFunction to the given output stream,
67 /// using the given target machine description.  This should work
68 /// regardless of whether the function is in SSA form.
69 ///
70 FunctionPass *createX86CodePrinterPass(std::ostream &o,TargetMachine &tm);
71
72 /// createX86ELFObjectWriterPass - Returns a pass that outputs the generated
73 /// code as an ELF object file.
74 ///
75 FunctionPass *createX86ELFObjectWriterPass(std::ostream &o, TargetMachine &tm);
76
77
78 /// createX86EmitCodeToMemory - Returns a pass that converts a register
79 /// allocated function into raw machine code in a dynamically
80 /// allocated chunk of memory.
81 ///
82 FunctionPass *createEmitX86CodeToMemory();
83
84 } // End llvm namespace
85
86 // Defines symbolic names for X86 registers.  This defines a mapping from
87 // register name to register number.
88 //
89 #include "X86GenRegisterNames.inc"
90
91 // Defines symbolic names for the X86 instructions.
92 //
93 #include "X86GenInstrNames.inc"
94
95 #endif