Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 1 | //===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===// |
Misha Brukman | 0e0a7a45 | 2005-04-21 23:38:14 +0000 | [diff] [blame^] | 2 | // |
John Criswell | 856ba76 | 2003-10-21 15:17:13 +0000 | [diff] [blame] | 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. |
Misha Brukman | 0e0a7a45 | 2005-04-21 23:38:14 +0000 | [diff] [blame^] | 7 | // |
John Criswell | 856ba76 | 2003-10-21 15:17:13 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 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 | // |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef TARGET_X86_H |
| 16 | #define TARGET_X86_H |
| 17 | |
| 18 | #include <iosfwd> |
Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 19 | |
| 20 | namespace llvm { |
| 21 | |
Chris Lattner | a535fab | 2002-10-29 17:43:38 +0000 | [diff] [blame] | 22 | class TargetMachine; |
Brian Gaeke | 9826bdb | 2003-08-13 18:15:29 +0000 | [diff] [blame] | 23 | class FunctionPass; |
Chris Lattner | 4482715 | 2003-12-28 09:47:19 +0000 | [diff] [blame] | 24 | class IntrinsicLowering; |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 25 | |
Chris Lattner | 6f0161a | 2004-08-24 08:18:44 +0000 | [diff] [blame] | 26 | enum X86VectorEnum { |
| 27 | NoSSE, SSE, SSE2, SSE3 |
| 28 | }; |
| 29 | |
| 30 | extern X86VectorEnum X86Vector; |
| 31 | |
Chris Lattner | d281de2 | 2003-07-26 23:49:58 +0000 | [diff] [blame] | 32 | /// createX86SimpleInstructionSelector - This pass converts an LLVM function |
Chris Lattner | 8320035 | 2003-08-03 15:48:55 +0000 | [diff] [blame] | 33 | /// into a machine code representation in a very simple peep-hole fashion. The |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 34 | /// generated code sucks but the implementation is nice and simple. |
| 35 | /// |
Chris Lattner | f70e0c2 | 2003-12-28 21:23:38 +0000 | [diff] [blame] | 36 | FunctionPass *createX86SimpleInstructionSelector(TargetMachine &TM); |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 37 | |
Chris Lattner | 95cdb36 | 2005-01-07 07:48:33 +0000 | [diff] [blame] | 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 | |
Chris Lattner | 9b52770 | 2003-12-01 05:18:30 +0000 | [diff] [blame] | 43 | /// createX86SSAPeepholeOptimizerPass - Create a pass to perform SSA-based X86 |
| 44 | /// specific peephole optimizations. |
| 45 | /// |
| 46 | FunctionPass *createX86SSAPeepholeOptimizerPass(); |
| 47 | |
Chris Lattner | 31ad5dd | 2003-01-13 00:45:29 +0000 | [diff] [blame] | 48 | /// createX86PeepholeOptimizer - Create a pass to perform X86 specific peephole |
| 49 | /// optimizations. |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 50 | /// |
Brian Gaeke | 9826bdb | 2003-08-13 18:15:29 +0000 | [diff] [blame] | 51 | FunctionPass *createX86PeepholeOptimizerPass(); |
Chris Lattner | f2ab412 | 2002-12-28 20:26:16 +0000 | [diff] [blame] | 52 | |
Alkis Evlogimenos | 359b65f | 2003-12-13 05:36:22 +0000 | [diff] [blame] | 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 | |
Chris Lattner | 31ad5dd | 2003-01-13 00:45:29 +0000 | [diff] [blame] | 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. |
Chris Lattner | f2ab412 | 2002-12-28 20:26:16 +0000 | [diff] [blame] | 62 | /// |
Brian Gaeke | 9826bdb | 2003-08-13 18:15:29 +0000 | [diff] [blame] | 63 | FunctionPass *createX86FloatingPointStackifierPass(); |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 64 | |
Brian Gaeke | de420ae | 2003-07-23 20:25:08 +0000 | [diff] [blame] | 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. |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 69 | /// |
Brian Gaeke | 9826bdb | 2003-08-13 18:15:29 +0000 | [diff] [blame] | 70 | FunctionPass *createX86CodePrinterPass(std::ostream &o,TargetMachine &tm); |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 71 | |
Brian Gaeke | 9826bdb | 2003-08-13 18:15:29 +0000 | [diff] [blame] | 72 | /// createX86EmitCodeToMemory - Returns a pass that converts a register |
| 73 | /// allocated function into raw machine code in a dynamically |
| 74 | /// allocated chunk of memory. |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 75 | /// |
Brian Gaeke | 9826bdb | 2003-08-13 18:15:29 +0000 | [diff] [blame] | 76 | FunctionPass *createEmitX86CodeToMemory(); |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 77 | |
Chris Lattner | 95cdb36 | 2005-01-07 07:48:33 +0000 | [diff] [blame] | 78 | } // End llvm namespace |
| 79 | |
Chris Lattner | 8320035 | 2003-08-03 15:48:55 +0000 | [diff] [blame] | 80 | // Defines symbolic names for X86 registers. This defines a mapping from |
| 81 | // register name to register number. |
| 82 | // |
| 83 | #include "X86GenRegisterNames.inc" |
| 84 | |
Chris Lattner | 8d44ba8 | 2003-08-03 21:57:05 +0000 | [diff] [blame] | 85 | // Defines symbolic names for the X86 instructions. |
| 86 | // |
| 87 | #include "X86GenInstrNames.inc" |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 88 | |
| 89 | #endif |