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 | 75276f1 | 2002-10-28 23:55:19 +0000 | [diff] [blame] | 14 | class MachineFunction; |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 15 | class Function; |
| 16 | |
| 17 | /// X86PrintCode - Print out the specified machine code function to the |
| 18 | /// specified stream. This function should work regardless of whether or not |
| 19 | /// the function is in SSA form or not. |
| 20 | /// |
Chris Lattner | 75276f1 | 2002-10-28 23:55:19 +0000 | [diff] [blame] | 21 | void X86PrintCode(const MachineFunction *MF, std::ostream &O); |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 22 | |
| 23 | /// X86SimpleInstructionSelection - This function converts an LLVM function into |
| 24 | /// a machine code representation is a very simple peep-hole fashion. The |
| 25 | /// generated code sucks but the implementation is nice and simple. |
| 26 | /// |
Chris Lattner | 75276f1 | 2002-10-28 23:55:19 +0000 | [diff] [blame] | 27 | MachineFunction *X86SimpleInstructionSelection(Function &F); |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 28 | |
| 29 | /// X86SimpleRegisterAllocation - This function converts the specified machine |
| 30 | /// code function from SSA form to use explicit registers by spilling every |
| 31 | /// register. Wow, great policy huh? |
| 32 | /// |
Chris Lattner | 75276f1 | 2002-10-28 23:55:19 +0000 | [diff] [blame] | 33 | inline void X86SimpleRegisterAllocation(MachineFunction *MF) {} |
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 | 75276f1 | 2002-10-28 23:55:19 +0000 | [diff] [blame] | 39 | inline void *X86EmitCodeToMemory(MachineFunction *MF) { return 0; } |
Chris Lattner | 7261408 | 2002-10-25 22:55:53 +0000 | [diff] [blame] | 40 | |
| 41 | |
| 42 | // Put symbolic names in a namespace to avoid causing these to clash with all |
| 43 | // kinds of other things... |
| 44 | // |
| 45 | namespace X86 { |
| 46 | // Defines a large number of symbolic names for X86 registers. This defines a |
| 47 | // mapping from register name to register number. |
| 48 | // |
| 49 | enum Register { |
| 50 | #define R(ENUM, NAME, FLAGS, TSFLAGS) ENUM, |
| 51 | #include "X86RegisterInfo.def" |
| 52 | }; |
| 53 | |
| 54 | // This defines a large number of symbolic names for X86 instruction opcodes. |
| 55 | enum Opcode { |
| 56 | #define I(ENUM, NAME, FLAGS, TSFLAGS) ENUM, |
| 57 | #include "X86InstructionInfo.def" |
| 58 | }; |
| 59 | } |
| 60 | |
| 61 | #endif |