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