Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 1 | //===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===// |
| 2 | // |
| 3 | // This file contains the entry points for global functions defined in the x86 |
| 4 | // target library, as used by the LLVM JIT. |
| 5 | // |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 6 | //===----------------------------------------------------------------------===// |
| 7 | |
| 8 | #ifndef TARGET_X86_H |
| 9 | #define TARGET_X86_H |
| 10 | |
| 11 | #include <iosfwd> |
Chris Lattner | a535fab | 2002-10-29 17:43:38 +0000 | [diff] [blame] | 12 | class TargetMachine; |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 13 | class Pass; |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 14 | |
Chris Lattner | d281de2 | 2003-07-26 23:49:58 +0000 | [diff] [blame^] | 15 | /// createX86SimpleInstructionSelector - This pass converts an LLVM function |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 16 | /// into a machine code representation is a very simple peep-hole fashion. The |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 17 | /// generated code sucks but the implementation is nice and simple. |
| 18 | /// |
Chris Lattner | d281de2 | 2003-07-26 23:49:58 +0000 | [diff] [blame^] | 19 | Pass *createX86SimpleInstructionSelector(TargetMachine &TM); |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 20 | |
Chris Lattner | 31ad5dd | 2003-01-13 00:45:29 +0000 | [diff] [blame] | 21 | /// createX86PeepholeOptimizer - Create a pass to perform X86 specific peephole |
| 22 | /// optimizations. |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 23 | /// |
Chris Lattner | 31ad5dd | 2003-01-13 00:45:29 +0000 | [diff] [blame] | 24 | Pass *createX86PeepholeOptimizerPass(); |
Chris Lattner | f2ab412 | 2002-12-28 20:26:16 +0000 | [diff] [blame] | 25 | |
Chris Lattner | 31ad5dd | 2003-01-13 00:45:29 +0000 | [diff] [blame] | 26 | /// createX86FloatingPointStackifierPass - This function returns a pass which |
| 27 | /// converts floating point register references and pseudo instructions into |
| 28 | /// floating point stack references and physical instructions. |
Chris Lattner | f2ab412 | 2002-12-28 20:26:16 +0000 | [diff] [blame] | 29 | /// |
Chris Lattner | 31ad5dd | 2003-01-13 00:45:29 +0000 | [diff] [blame] | 30 | Pass *createX86FloatingPointStackifierPass(); |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 31 | |
Brian Gaeke | de420ae | 2003-07-23 20:25:08 +0000 | [diff] [blame] | 32 | /// createX86CodePrinterPass - Returns a pass that prints the X86 |
| 33 | /// assembly code for a MachineFunction to the given output stream, |
| 34 | /// using the given target machine description. This should work |
| 35 | /// regardless of whether the function is in SSA form. |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame] | 36 | /// |
Brian Gaeke | de420ae | 2003-07-23 20:25:08 +0000 | [diff] [blame] | 37 | Pass *createX86CodePrinterPass(std::ostream &o, TargetMachine &tm); |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 38 | |
| 39 | /// X86EmitCodeToMemory - This function converts a register allocated function |
| 40 | /// into raw machine code in a dynamically allocated chunk of memory. A pointer |
| 41 | /// to the start of the function is returned. |
| 42 | /// |
Chris Lattner | f2ab412 | 2002-12-28 20:26:16 +0000 | [diff] [blame] | 43 | Pass *createEmitX86CodeToMemory(); |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 44 | |
Chris Lattner | ff3261a | 2003-06-03 15:31:23 +0000 | [diff] [blame] | 45 | /// X86 namespace - This namespace contains all of the register and opcode enums |
| 46 | /// used by the X86 backend. |
| 47 | /// |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 48 | namespace X86 { |
| 49 | // Defines a large number of symbolic names for X86 registers. This defines a |
| 50 | // mapping from register name to register number. |
| 51 | // |
| 52 | enum Register { |
Chris Lattner | 92aec04 | 2002-12-16 16:14:51 +0000 | [diff] [blame] | 53 | #define R(ENUM, NAME, FLAGS, TSFLAGS, ALIAS_SET) ENUM, |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 54 | #include "X86RegisterInfo.def" |
| 55 | }; |
| 56 | |
| 57 | // This defines a large number of symbolic names for X86 instruction opcodes. |
| 58 | enum Opcode { |
Chris Lattner | 4ce42a7 | 2002-12-03 05:42:53 +0000 | [diff] [blame] | 59 | #define I(ENUM, NAME, BASEOPCODE, FLAGS, TSFLAGS, IMPDEFS, IMPUSES) ENUM, |
Chris Lattner | 055c965 | 2002-10-29 21:05:24 +0000 | [diff] [blame] | 60 | #include "X86InstrInfo.def" |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 61 | }; |
| 62 | } |
| 63 | |
| 64 | #endif |