blob: 1ffee86f92db395f44dde82ff9ef50a37b505ca1 [file] [log] [blame]
Chris Lattnerd92fb002002-10-25 22:55:53 +00001//===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
Misha Brukmanc88330a2005-04-21 23:38:14 +00002//
John Criswell29265fe2003-10-21 15:17:13 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-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 Brukmanc88330a2005-04-21 23:38:14 +00007//
John Criswell29265fe2003-10-21 15:17:13 +00008//===----------------------------------------------------------------------===//
Chris Lattnerd92fb002002-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 Lattnerd92fb002002-10-25 22:55:53 +000013//===----------------------------------------------------------------------===//
14
15#ifndef TARGET_X86_H
16#define TARGET_X86_H
17
Evan Cheng3ddfbd32011-07-06 22:01:53 +000018#include "MCTargetDesc/X86MCTargetDesc.h"
Daniel Dunbarca2511d2010-12-20 15:45:51 +000019#include "llvm/Support/DataTypes.h"
Bill Wendling026e5d72009-04-29 23:29:43 +000020#include "llvm/Target/TargetMachine.h"
21
Brian Gaeke960707c2003-11-11 22:41:34 +000022namespace llvm {
23
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000024class FunctionPass;
Daniel Dunbar40eb7f02010-02-21 21:54:14 +000025class JITCodeEmitter;
Daniel Dunbar981a71c2009-08-27 08:12:55 +000026class MCCodeEmitter;
Chris Lattner741580a2010-02-12 23:12:47 +000027class MCContext;
Daniel Dunbar7da045e2010-12-20 15:07:39 +000028class MCObjectWriter;
Daniel Dunbar40eb7f02010-02-21 21:54:14 +000029class MachineCodeEmitter;
Daniel Dunbar981a71c2009-08-27 08:12:55 +000030class Target;
Daniel Dunbar40eb7f02010-02-21 21:54:14 +000031class TargetAsmBackend;
32class X86TargetMachine;
David Greenea31f96c2009-07-14 20:18:05 +000033class formatted_raw_ostream;
Daniel Dunbar7da045e2010-12-20 15:07:39 +000034class raw_ostream;
Chris Lattnerd92fb002002-10-25 22:55:53 +000035
Chris Lattner76ac0682005-11-15 00:40:23 +000036/// createX86ISelDag - This pass converts a legalized DAG into a
37/// X86-specific DAG, ready for instruction scheduling.
38///
Bruno Cardoso Lopes9fd794b2009-06-01 19:57:37 +000039FunctionPass *createX86ISelDag(X86TargetMachine &TM,
40 CodeGenOpt::Level OptLevel);
Chris Lattnerff9e21c2005-01-07 07:48:33 +000041
Dan Gohmand7b5ce32010-07-10 09:00:22 +000042/// createGlobalBaseRegPass - This pass initializes a global base
43/// register for PIC on x86-32.
44FunctionPass* createGlobalBaseRegPass();
45
Chris Lattner61e11952003-01-13 00:45:29 +000046/// createX86FloatingPointStackifierPass - This function returns a pass which
47/// converts floating point register references and pseudo instructions into
48/// floating point stack references and physical instructions.
Chris Lattner49376432002-12-28 20:26:16 +000049///
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000050FunctionPass *createX86FloatingPointStackifierPass();
Chris Lattner02a3d832002-10-29 22:37:54 +000051
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +000052/// createSSEDomainFixPass - This pass twiddles SSE opcodes to prevent domain
53/// crossings.
54FunctionPass *createSSEDomainFixPass();
55
Chris Lattnerd8312092005-07-11 05:17:48 +000056/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
57/// to the specified MCE object.
Bruno Cardoso Lopes9fd794b2009-06-01 19:57:37 +000058FunctionPass *createX86JITCodeEmitterPass(X86TargetMachine &TM,
59 JITCodeEmitter &JCE);
Chris Lattnerd8312092005-07-11 05:17:48 +000060
Chris Lattner741580a2010-02-12 23:12:47 +000061MCCodeEmitter *createX86_32MCCodeEmitter(const Target &, TargetMachine &TM,
62 MCContext &Ctx);
63MCCodeEmitter *createX86_64MCCodeEmitter(const Target &, TargetMachine &TM,
64 MCContext &Ctx);
Daniel Dunbar981a71c2009-08-27 08:12:55 +000065
Daniel Dunbar245f5b22010-03-11 01:34:16 +000066TargetAsmBackend *createX86_32AsmBackend(const Target &, const std::string &);
67TargetAsmBackend *createX86_64AsmBackend(const Target &, const std::string &);
Daniel Dunbar40eb7f02010-02-21 21:54:14 +000068
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000069/// createX86EmitCodeToMemory - Returns a pass that converts a register
70/// allocated function into raw machine code in a dynamically
71/// allocated chunk of memory.
Chris Lattnerd92fb002002-10-25 22:55:53 +000072///
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000073FunctionPass *createEmitX86CodeToMemory();
Chris Lattnerd92fb002002-10-25 22:55:53 +000074
Jim Grosbach4dac8902010-04-06 20:26:37 +000075/// createX86MaxStackAlignmentHeuristicPass - This function returns a pass
76/// which determines whether the frame pointer register should be
77/// reserved in case dynamic stack alignment is later required.
78///
79FunctionPass *createX86MaxStackAlignmentHeuristicPass();
80
Daniel Dunbar7da045e2010-12-20 15:07:39 +000081
82/// createX86MachObjectWriter - Construct an X86 Mach-O object writer.
83MCObjectWriter *createX86MachObjectWriter(raw_ostream &OS,
84 bool Is64Bit,
85 uint32_t CPUType,
86 uint32_t CPUSubtype);
87
Chris Lattnerff9e21c2005-01-07 07:48:33 +000088} // End llvm namespace
89
Chris Lattnerd92fb002002-10-25 22:55:53 +000090#endif