blob: 14e6c2d98c05c9c99f024e65be9be202af790b48 [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//
Chris Lattner72614082002-10-25 22:55:53 +00006//===----------------------------------------------------------------------===//
7
8#ifndef TARGET_X86_H
9#define TARGET_X86_H
10
11#include <iosfwd>
Chris Lattnera535fab2002-10-29 17:43:38 +000012class TargetMachine;
Brian Gaeke9826bdb2003-08-13 18:15:29 +000013class FunctionPass;
Chris Lattner72614082002-10-25 22:55:53 +000014
Chris Lattnerd281de22003-07-26 23:49:58 +000015/// createX86SimpleInstructionSelector - This pass converts an LLVM function
Chris Lattner83200352003-08-03 15:48:55 +000016/// into a machine code representation in a very simple peep-hole fashion. The
Chris Lattner72614082002-10-25 22:55:53 +000017/// generated code sucks but the implementation is nice and simple.
18///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000019FunctionPass *createX86SimpleInstructionSelector(TargetMachine &TM);
Chris Lattner72614082002-10-25 22:55:53 +000020
Chris Lattnerac0c8682003-08-11 14:59:22 +000021/// createX86PatternInstructionSelector - This pass converts an LLVM function
22/// into a machine code representation using pattern matching and a machine
23/// description file.
24///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000025FunctionPass *createX86PatternInstructionSelector(TargetMachine &TM);
Chris Lattnerac0c8682003-08-11 14:59:22 +000026
Chris Lattner31ad5dd2003-01-13 00:45:29 +000027/// createX86PeepholeOptimizer - Create a pass to perform X86 specific peephole
28/// optimizations.
Chris Lattner72614082002-10-25 22:55:53 +000029///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000030FunctionPass *createX86PeepholeOptimizerPass();
Chris Lattnerf2ab4122002-12-28 20:26:16 +000031
Chris Lattner31ad5dd2003-01-13 00:45:29 +000032/// createX86FloatingPointStackifierPass - This function returns a pass which
33/// converts floating point register references and pseudo instructions into
34/// floating point stack references and physical instructions.
Chris Lattnerf2ab4122002-12-28 20:26:16 +000035///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000036FunctionPass *createX86FloatingPointStackifierPass();
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000037
Brian Gaekede420ae2003-07-23 20:25:08 +000038/// createX86CodePrinterPass - Returns a pass that prints the X86
39/// assembly code for a MachineFunction to the given output stream,
40/// using the given target machine description. This should work
41/// regardless of whether the function is in SSA form.
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000042///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000043FunctionPass *createX86CodePrinterPass(std::ostream &o,TargetMachine &tm);
Chris Lattner72614082002-10-25 22:55:53 +000044
Brian Gaeke9826bdb2003-08-13 18:15:29 +000045/// createX86EmitCodeToMemory - Returns a pass that converts a register
46/// allocated function into raw machine code in a dynamically
47/// allocated chunk of memory.
Chris Lattner72614082002-10-25 22:55:53 +000048///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000049FunctionPass *createEmitX86CodeToMemory();
Chris Lattner72614082002-10-25 22:55:53 +000050
Chris Lattner83200352003-08-03 15:48:55 +000051// Defines symbolic names for X86 registers. This defines a mapping from
52// register name to register number.
53//
54#include "X86GenRegisterNames.inc"
55
Chris Lattner8d44ba82003-08-03 21:57:05 +000056// Defines symbolic names for the X86 instructions.
57//
58#include "X86GenInstrNames.inc"
Chris Lattner72614082002-10-25 22:55:53 +000059
60#endif