blob: dc79b80747a7f5b2040518dd2125387779ded5c4 [file] [log] [blame]
Chris Lattner72614082002-10-25 22:55:53 +00001//===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
Misha Brukman0e0a7a452005-04-21 23:38:14 +00002//
John Criswell856ba762003-10-21 15:17:13 +00003// The LLVM Compiler Infrastructure
4//
5// This file was developed by the LLVM research group and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
Misha Brukman0e0a7a452005-04-21 23:38:14 +00007//
John Criswell856ba762003-10-21 15:17:13 +00008//===----------------------------------------------------------------------===//
Chris Lattner72614082002-10-25 22:55:53 +00009//
10// This file contains the entry points for global functions defined in the x86
11// target library, as used by the LLVM JIT.
12//
Chris Lattner72614082002-10-25 22:55:53 +000013//===----------------------------------------------------------------------===//
14
15#ifndef TARGET_X86_H
16#define TARGET_X86_H
17
18#include <iosfwd>
Brian Gaeked0fde302003-11-11 22:41:34 +000019
20namespace llvm {
21
Chris Lattnera535fab2002-10-29 17:43:38 +000022class TargetMachine;
Chris Lattner81b6ed72005-07-11 05:17:48 +000023class PassManager;
Brian Gaeke9826bdb2003-08-13 18:15:29 +000024class FunctionPass;
Chris Lattner44827152003-12-28 09:47:19 +000025class IntrinsicLowering;
Chris Lattner81b6ed72005-07-11 05:17:48 +000026class MachineCodeEmitter;
Chris Lattner72614082002-10-25 22:55:53 +000027
Chris Lattner6f0161a2004-08-24 08:18:44 +000028enum X86VectorEnum {
29 NoSSE, SSE, SSE2, SSE3
30};
31
32extern X86VectorEnum X86Vector;
Nate Begemanf63be7d2005-07-06 18:59:04 +000033extern bool X86ScalarSSE;
Chris Lattner6f0161a2004-08-24 08:18:44 +000034
Chris Lattnerdbdbf0c2005-11-15 00:40:23 +000035/// createX86ISelPattern - This pass converts an LLVM function into a
36/// machine code representation using pattern matching and a machine
37/// description file.
Chris Lattner95cdb362005-01-07 07:48:33 +000038///
Chris Lattnerdbdbf0c2005-11-15 00:40:23 +000039FunctionPass *createX86ISelPattern(TargetMachine &TM);
40
41/// createX86ISelDag - This pass converts a legalized DAG into a
42/// X86-specific DAG, ready for instruction scheduling.
43///
44FunctionPass *createX86ISelDag(TargetMachine &TM);
Chris Lattner95cdb362005-01-07 07:48:33 +000045
Chris Lattner9b527702003-12-01 05:18:30 +000046/// createX86SSAPeepholeOptimizerPass - Create a pass to perform SSA-based X86
47/// specific peephole optimizations.
48///
49FunctionPass *createX86SSAPeepholeOptimizerPass();
50
Chris Lattner31ad5dd2003-01-13 00:45:29 +000051/// createX86PeepholeOptimizer - Create a pass to perform X86 specific peephole
52/// optimizations.
Chris Lattner72614082002-10-25 22:55:53 +000053///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000054FunctionPass *createX86PeepholeOptimizerPass();
Chris Lattnerf2ab4122002-12-28 20:26:16 +000055
Chris Lattner31ad5dd2003-01-13 00:45:29 +000056/// createX86FloatingPointStackifierPass - This function returns a pass which
57/// converts floating point register references and pseudo instructions into
58/// floating point stack references and physical instructions.
Chris Lattnerf2ab4122002-12-28 20:26:16 +000059///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000060FunctionPass *createX86FloatingPointStackifierPass();
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000061
Brian Gaekede420ae2003-07-23 20:25:08 +000062/// createX86CodePrinterPass - Returns a pass that prints the X86
63/// assembly code for a MachineFunction to the given output stream,
Chris Lattner81b6ed72005-07-11 05:17:48 +000064/// using the given target machine description.
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000065///
Chris Lattner81b6ed72005-07-11 05:17:48 +000066FunctionPass *createX86CodePrinterPass(std::ostream &o, TargetMachine &tm);
Chris Lattner72614082002-10-25 22:55:53 +000067
Chris Lattner81b6ed72005-07-11 05:17:48 +000068/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
69/// to the specified MCE object.
70FunctionPass *createX86CodeEmitterPass(MachineCodeEmitter &MCE);
71
72/// addX86ELFObjectWriterPass - Add passes to the FPM that output the generated
Chris Lattner07a91442005-06-27 06:30:12 +000073/// code as an ELF object file.
74///
Chris Lattner81b6ed72005-07-11 05:17:48 +000075void addX86ELFObjectWriterPass(PassManager &FPM,
76 std::ostream &o, TargetMachine &tm);
Chris Lattner07a91442005-06-27 06:30:12 +000077
Brian Gaeke9826bdb2003-08-13 18:15:29 +000078/// createX86EmitCodeToMemory - Returns a pass that converts a register
79/// allocated function into raw machine code in a dynamically
80/// allocated chunk of memory.
Chris Lattner72614082002-10-25 22:55:53 +000081///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000082FunctionPass *createEmitX86CodeToMemory();
Chris Lattner72614082002-10-25 22:55:53 +000083
Chris Lattner95cdb362005-01-07 07:48:33 +000084} // End llvm namespace
85
Chris Lattner83200352003-08-03 15:48:55 +000086// Defines symbolic names for X86 registers. This defines a mapping from
87// register name to register number.
88//
89#include "X86GenRegisterNames.inc"
90
Chris Lattner8d44ba82003-08-03 21:57:05 +000091// Defines symbolic names for the X86 instructions.
92//
93#include "X86GenInstrNames.inc"
Chris Lattner72614082002-10-25 22:55:53 +000094
95#endif