blob: ba0ee6cedd7142c41e4e39488d0f6bda0f46eb13 [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//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// 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
Bill Wendling98a366d2009-04-29 23:29:43 +000018#include "llvm/Target/TargetMachine.h"
19
Brian Gaeked0fde302003-11-11 22:41:34 +000020namespace llvm {
21
Brian Gaeke9826bdb2003-08-13 18:15:29 +000022class FunctionPass;
Daniel Dunbar12783d12010-02-21 21:54:14 +000023class JITCodeEmitter;
24class MCAssembler;
Daniel Dunbar7168a7d2009-08-27 08:12:55 +000025class MCCodeEmitter;
Chris Lattner86020e42010-02-12 23:12:47 +000026class MCContext;
Daniel Dunbar12783d12010-02-21 21:54:14 +000027class MachineCodeEmitter;
Daniel Dunbar7168a7d2009-08-27 08:12:55 +000028class Target;
Daniel Dunbar12783d12010-02-21 21:54:14 +000029class TargetAsmBackend;
30class X86TargetMachine;
David Greene71847812009-07-14 20:18:05 +000031class formatted_raw_ostream;
Chris Lattner72614082002-10-25 22:55:53 +000032
Chris Lattnerdbdbf0c2005-11-15 00:40:23 +000033/// createX86ISelDag - This pass converts a legalized DAG into a
34/// X86-specific DAG, ready for instruction scheduling.
35///
Bruno Cardoso Lopes434dd4f2009-06-01 19:57:37 +000036FunctionPass *createX86ISelDag(X86TargetMachine &TM,
37 CodeGenOpt::Level OptLevel);
Chris Lattner95cdb362005-01-07 07:48:33 +000038
Chris Lattner31ad5dd2003-01-13 00:45:29 +000039/// createX86FloatingPointStackifierPass - This function returns a pass which
40/// converts floating point register references and pseudo instructions into
41/// floating point stack references and physical instructions.
Chris Lattnerf2ab4122002-12-28 20:26:16 +000042///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000043FunctionPass *createX86FloatingPointStackifierPass();
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000044
Dan Gohmanbc5cbb82008-11-12 22:55:05 +000045/// createX87FPRegKillInserterPass - This function returns a pass which
46/// inserts FP_REG_KILL instructions where needed.
47///
48FunctionPass *createX87FPRegKillInserterPass();
49
Chris Lattner81b6ed72005-07-11 05:17:48 +000050/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
51/// to the specified MCE object.
Bruno Cardoso Lopes434dd4f2009-06-01 19:57:37 +000052FunctionPass *createX86JITCodeEmitterPass(X86TargetMachine &TM,
53 JITCodeEmitter &JCE);
Chris Lattner81b6ed72005-07-11 05:17:48 +000054
Chris Lattner86020e42010-02-12 23:12:47 +000055MCCodeEmitter *createX86_32MCCodeEmitter(const Target &, TargetMachine &TM,
56 MCContext &Ctx);
57MCCodeEmitter *createX86_64MCCodeEmitter(const Target &, TargetMachine &TM,
58 MCContext &Ctx);
Daniel Dunbar7168a7d2009-08-27 08:12:55 +000059
Daniel Dunbar12783d12010-02-21 21:54:14 +000060TargetAsmBackend *createX86_32AsmBackend(const Target &, MCAssembler &);
61TargetAsmBackend *createX86_64AsmBackend(const Target &, MCAssembler &);
62
Brian Gaeke9826bdb2003-08-13 18:15:29 +000063/// createX86EmitCodeToMemory - Returns a pass that converts a register
64/// allocated function into raw machine code in a dynamically
65/// allocated chunk of memory.
Chris Lattner72614082002-10-25 22:55:53 +000066///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000067FunctionPass *createEmitX86CodeToMemory();
Chris Lattner72614082002-10-25 22:55:53 +000068
Daniel Dunbar4cb1e132009-07-18 23:03:22 +000069extern Target TheX86_32Target, TheX86_64Target;
70
Chris Lattner95cdb362005-01-07 07:48:33 +000071} // End llvm namespace
72
Chris Lattner83200352003-08-03 15:48:55 +000073// Defines symbolic names for X86 registers. This defines a mapping from
74// register name to register number.
75//
76#include "X86GenRegisterNames.inc"
77
Chris Lattner8d44ba82003-08-03 21:57:05 +000078// Defines symbolic names for the X86 instructions.
79//
80#include "X86GenInstrNames.inc"
Chris Lattner72614082002-10-25 22:55:53 +000081
82#endif