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 | // |
| 6 | // FIXME: This file will be dramatically changed in the future |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef TARGET_X86_H |
| 11 | #define TARGET_X86_H |
| 12 | |
| 13 | #include <iosfwd> |
Chris Lattner | a535fab | 2002-10-29 17:43:38 +0000 | [diff] [blame] | 14 | class TargetMachine; |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame^] | 15 | class Pass; |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 16 | |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame^] | 17 | /// createSimpleX86InstructionSelector - This pass converts an LLVM function |
| 18 | /// 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] | 19 | /// generated code sucks but the implementation is nice and simple. |
| 20 | /// |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame^] | 21 | Pass *createSimpleX86InstructionSelector(TargetMachine &TM); |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 22 | |
| 23 | /// X86SimpleRegisterAllocation - This function converts the specified machine |
| 24 | /// code function from SSA form to use explicit registers by spilling every |
| 25 | /// register. Wow, great policy huh? |
| 26 | /// |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame^] | 27 | Pass *createSimpleX86RegisterAllocator(TargetMachine &TM); |
| 28 | |
| 29 | /// createX86CodePrinterPass - Print out the specified machine code function to |
| 30 | /// the specified stream. This function should work regardless of whether or |
| 31 | /// not the function is in SSA form or not. |
| 32 | /// |
| 33 | Pass *createX86CodePrinterPass(TargetMachine &TM, std::ostream &O); |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 34 | |
| 35 | /// X86EmitCodeToMemory - This function converts a register allocated function |
| 36 | /// into raw machine code in a dynamically allocated chunk of memory. A pointer |
| 37 | /// to the start of the function is returned. |
| 38 | /// |
Chris Lattner | b4f68ed | 2002-10-29 22:37:54 +0000 | [diff] [blame^] | 39 | Pass *createEmitX86CodeToMemory(TargetMachine &TM); |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 40 | |
| 41 | // Put symbolic names in a namespace to avoid causing these to clash with all |
| 42 | // kinds of other things... |
| 43 | // |
| 44 | namespace X86 { |
| 45 | // Defines a large number of symbolic names for X86 registers. This defines a |
| 46 | // mapping from register name to register number. |
| 47 | // |
| 48 | enum Register { |
| 49 | #define R(ENUM, NAME, FLAGS, TSFLAGS) ENUM, |
| 50 | #include "X86RegisterInfo.def" |
| 51 | }; |
| 52 | |
| 53 | // This defines a large number of symbolic names for X86 instruction opcodes. |
| 54 | enum Opcode { |
| 55 | #define I(ENUM, NAME, FLAGS, TSFLAGS) ENUM, |
Chris Lattner | 055c965 | 2002-10-29 21:05:24 +0000 | [diff] [blame] | 56 | #include "X86InstrInfo.def" |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 57 | }; |
| 58 | } |
| 59 | |
| 60 | #endif |