blob: 8af27648f3e5a55fbf92a0cfd8192f2c92427140 [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
Evan Cheng8c3fee52011-07-25 18:43:53 +000018#include "MCTargetDesc/X86BaseInfo.h"
Evan Chenged5e3552011-07-06 22:01:53 +000019#include "MCTargetDesc/X86MCTargetDesc.h"
Daniel Dunbar67e0c212010-12-20 15:45:51 +000020#include "llvm/Support/DataTypes.h"
Bill Wendling98a366d2009-04-29 23:29:43 +000021#include "llvm/Target/TargetMachine.h"
22
Brian Gaeked0fde302003-11-11 22:41:34 +000023namespace llvm {
24
Brian Gaeke9826bdb2003-08-13 18:15:29 +000025class FunctionPass;
Daniel Dunbar12783d12010-02-21 21:54:14 +000026class JITCodeEmitter;
Evan Cheng59ee62d2011-07-11 03:57:24 +000027class MachineCodeEmitter;
Daniel Dunbar7168a7d2009-08-27 08:12:55 +000028class MCCodeEmitter;
Chris Lattner86020e42010-02-12 23:12:47 +000029class MCContext;
Evan Cheng59ee62d2011-07-11 03:57:24 +000030class MCInstrInfo;
Daniel Dunbar9b2f25e2010-12-20 15:07:39 +000031class MCObjectWriter;
Evan Cheng59ee62d2011-07-11 03:57:24 +000032class MCSubtargetInfo;
Daniel Dunbar7168a7d2009-08-27 08:12:55 +000033class Target;
Daniel Dunbar12783d12010-02-21 21:54:14 +000034class TargetAsmBackend;
35class X86TargetMachine;
David Greene71847812009-07-14 20:18:05 +000036class formatted_raw_ostream;
Daniel Dunbar9b2f25e2010-12-20 15:07:39 +000037class raw_ostream;
Chris Lattner72614082002-10-25 22:55:53 +000038
Chris Lattnerdbdbf0c2005-11-15 00:40:23 +000039/// createX86ISelDag - This pass converts a legalized DAG into a
40/// X86-specific DAG, ready for instruction scheduling.
41///
Bruno Cardoso Lopes434dd4f2009-06-01 19:57:37 +000042FunctionPass *createX86ISelDag(X86TargetMachine &TM,
43 CodeGenOpt::Level OptLevel);
Chris Lattner95cdb362005-01-07 07:48:33 +000044
Dan Gohman84023e02010-07-10 09:00:22 +000045/// createGlobalBaseRegPass - This pass initializes a global base
46/// register for PIC on x86-32.
47FunctionPass* createGlobalBaseRegPass();
48
Chris Lattner31ad5dd2003-01-13 00:45:29 +000049/// createX86FloatingPointStackifierPass - This function returns a pass which
50/// converts floating point register references and pseudo instructions into
51/// floating point stack references and physical instructions.
Chris Lattnerf2ab4122002-12-28 20:26:16 +000052///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000053FunctionPass *createX86FloatingPointStackifierPass();
Chris Lattnerb4f68ed2002-10-29 22:37:54 +000054
Jakob Stoklund Olesen352aa502010-03-25 17:25:00 +000055/// createSSEDomainFixPass - This pass twiddles SSE opcodes to prevent domain
56/// crossings.
57FunctionPass *createSSEDomainFixPass();
58
Chris Lattner81b6ed72005-07-11 05:17:48 +000059/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
60/// to the specified MCE object.
Bruno Cardoso Lopes434dd4f2009-06-01 19:57:37 +000061FunctionPass *createX86JITCodeEmitterPass(X86TargetMachine &TM,
62 JITCodeEmitter &JCE);
Chris Lattner81b6ed72005-07-11 05:17:48 +000063
Daniel Dunbar6c27f5e2010-03-11 01:34:16 +000064TargetAsmBackend *createX86_32AsmBackend(const Target &, const std::string &);
65TargetAsmBackend *createX86_64AsmBackend(const Target &, const std::string &);
Daniel Dunbar12783d12010-02-21 21:54:14 +000066
Brian Gaeke9826bdb2003-08-13 18:15:29 +000067/// createX86EmitCodeToMemory - Returns a pass that converts a register
68/// allocated function into raw machine code in a dynamically
69/// allocated chunk of memory.
Chris Lattner72614082002-10-25 22:55:53 +000070///
Brian Gaeke9826bdb2003-08-13 18:15:29 +000071FunctionPass *createEmitX86CodeToMemory();
Chris Lattner72614082002-10-25 22:55:53 +000072
Jim Grosbachfa85eb62010-04-06 20:26:37 +000073/// createX86MaxStackAlignmentHeuristicPass - This function returns a pass
74/// which determines whether the frame pointer register should be
75/// reserved in case dynamic stack alignment is later required.
76///
77FunctionPass *createX86MaxStackAlignmentHeuristicPass();
78
Daniel Dunbar9b2f25e2010-12-20 15:07:39 +000079
80/// createX86MachObjectWriter - Construct an X86 Mach-O object writer.
81MCObjectWriter *createX86MachObjectWriter(raw_ostream &OS,
82 bool Is64Bit,
83 uint32_t CPUType,
84 uint32_t CPUSubtype);
85
Chris Lattner95cdb362005-01-07 07:48:33 +000086} // End llvm namespace
87
Chris Lattner72614082002-10-25 22:55:53 +000088#endif