blob: c753cf2a530f98c0c3e91fc01301b7986375777f [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file contains the entry points for global functions defined in the x86
11// target library, as used by the LLVM JIT.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef TARGET_X86_H
16#define TARGET_X86_H
17
Bill Wendling5ed22ac2009-04-29 23:29:43 +000018#include "llvm/Target/TargetMachine.h"
19
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020namespace llvm {
21
Dan Gohmanf17a25c2007-07-18 16:29:46 +000022class FunctionPass;
Daniel Dunbarc8ce0aa2010-02-21 21:54:14 +000023class JITCodeEmitter;
Daniel Dunbar2f379632009-08-27 08:12:55 +000024class MCCodeEmitter;
Chris Lattner00321752010-02-12 23:12:47 +000025class MCContext;
Daniel Dunbarc8ce0aa2010-02-21 21:54:14 +000026class MachineCodeEmitter;
Daniel Dunbar2f379632009-08-27 08:12:55 +000027class Target;
Daniel Dunbarc8ce0aa2010-02-21 21:54:14 +000028class TargetAsmBackend;
29class X86TargetMachine;
David Greene302008d2009-07-14 20:18:05 +000030class formatted_raw_ostream;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000031
32/// createX86ISelDag - This pass converts a legalized DAG into a
33/// X86-specific DAG, ready for instruction scheduling.
34///
Bruno Cardoso Lopes8e2537b2009-06-01 19:57:37 +000035FunctionPass *createX86ISelDag(X86TargetMachine &TM,
36 CodeGenOpt::Level OptLevel);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000037
38/// createX86FloatingPointStackifierPass - This function returns a pass which
39/// converts floating point register references and pseudo instructions into
40/// floating point stack references and physical instructions.
41///
42FunctionPass *createX86FloatingPointStackifierPass();
43
Dan Gohmanfd6722c2008-11-12 22:55:05 +000044/// createX87FPRegKillInserterPass - This function returns a pass which
45/// inserts FP_REG_KILL instructions where needed.
46///
47FunctionPass *createX87FPRegKillInserterPass();
48
Dan Gohmanf17a25c2007-07-18 16:29:46 +000049/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
50/// to the specified MCE object.
Bruno Cardoso Lopes8e2537b2009-06-01 19:57:37 +000051FunctionPass *createX86JITCodeEmitterPass(X86TargetMachine &TM,
52 JITCodeEmitter &JCE);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000053
Chris Lattner00321752010-02-12 23:12:47 +000054MCCodeEmitter *createX86_32MCCodeEmitter(const Target &, TargetMachine &TM,
55 MCContext &Ctx);
56MCCodeEmitter *createX86_64MCCodeEmitter(const Target &, TargetMachine &TM,
57 MCContext &Ctx);
Daniel Dunbar2f379632009-08-27 08:12:55 +000058
Daniel Dunbar4e7ef512010-03-11 01:34:16 +000059TargetAsmBackend *createX86_32AsmBackend(const Target &, const std::string &);
60TargetAsmBackend *createX86_64AsmBackend(const Target &, const std::string &);
Daniel Dunbarc8ce0aa2010-02-21 21:54:14 +000061
Dan Gohmanf17a25c2007-07-18 16:29:46 +000062/// createX86EmitCodeToMemory - Returns a pass that converts a register
63/// allocated function into raw machine code in a dynamically
64/// allocated chunk of memory.
65///
66FunctionPass *createEmitX86CodeToMemory();
67
Daniel Dunbar0b0441e2009-07-18 23:03:22 +000068extern Target TheX86_32Target, TheX86_64Target;
69
Dan Gohmanf17a25c2007-07-18 16:29:46 +000070} // End llvm namespace
71
72// Defines symbolic names for X86 registers. This defines a mapping from
73// register name to register number.
74//
75#include "X86GenRegisterNames.inc"
76
77// Defines symbolic names for the X86 instructions.
78//
79#include "X86GenInstrNames.inc"
80
81#endif