blob: d516bf1487c077c88396a90e79d48c367ed03bda [file] [log] [blame]
Chris Lattner72614082002-10-25 22:55:53 +00001//===-- 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 Lattner75276f12002-10-28 23:55:19 +000014class MachineFunction;
Chris Lattner72614082002-10-25 22:55:53 +000015class Function;
Chris Lattnera535fab2002-10-29 17:43:38 +000016class TargetMachine;
Chris Lattner72614082002-10-25 22:55:53 +000017
18/// X86PrintCode - Print out the specified machine code function to the
19/// specified stream. This function should work regardless of whether or not
20/// the function is in SSA form or not.
21///
Chris Lattner75276f12002-10-28 23:55:19 +000022void X86PrintCode(const MachineFunction *MF, std::ostream &O);
Chris Lattner72614082002-10-25 22:55:53 +000023
24/// X86SimpleInstructionSelection - This function converts an LLVM function into
25/// a machine code representation is a very simple peep-hole fashion. The
26/// generated code sucks but the implementation is nice and simple.
27///
Chris Lattnera535fab2002-10-29 17:43:38 +000028MachineFunction *X86SimpleInstructionSelection(Function &F, TargetMachine &TM);
Chris Lattner72614082002-10-25 22:55:53 +000029
30/// X86SimpleRegisterAllocation - This function converts the specified machine
31/// code function from SSA form to use explicit registers by spilling every
32/// register. Wow, great policy huh?
33///
Chris Lattner75276f12002-10-28 23:55:19 +000034inline void X86SimpleRegisterAllocation(MachineFunction *MF) {}
Chris Lattner72614082002-10-25 22:55:53 +000035
36/// X86EmitCodeToMemory - This function converts a register allocated function
37/// into raw machine code in a dynamically allocated chunk of memory. A pointer
38/// to the start of the function is returned.
39///
Chris Lattner75276f12002-10-28 23:55:19 +000040inline void *X86EmitCodeToMemory(MachineFunction *MF) { return 0; }
Chris Lattner72614082002-10-25 22:55:53 +000041
42
43// Put symbolic names in a namespace to avoid causing these to clash with all
44// kinds of other things...
45//
46namespace X86 {
47 // Defines a large number of symbolic names for X86 registers. This defines a
48 // mapping from register name to register number.
49 //
50 enum Register {
51#define R(ENUM, NAME, FLAGS, TSFLAGS) ENUM,
52#include "X86RegisterInfo.def"
53 };
54
55 // This defines a large number of symbolic names for X86 instruction opcodes.
56 enum Opcode {
57#define I(ENUM, NAME, FLAGS, TSFLAGS) ENUM,
58#include "X86InstructionInfo.def"
59 };
60}
61
62#endif