blob: 2647d687091deafe72f591937aecfac4b7b83dd3 [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
Bill Wendling026e5d72009-04-29 23:29:43 +000018#include "llvm/Target/TargetMachine.h"
19
Brian Gaeke960707c2003-11-11 22:41:34 +000020namespace llvm {
21
Evan Cheng2dd2c652006-03-13 23:20:37 +000022class X86TargetMachine;
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000023class FunctionPass;
Chris Lattnerd8312092005-07-11 05:17:48 +000024class MachineCodeEmitter;
Bruno Cardoso Lopesa194c3a2009-05-30 20:51:52 +000025class JITCodeEmitter;
David Greenea31f96c2009-07-14 20:18:05 +000026class formatted_raw_ostream;
Chris Lattnerd92fb002002-10-25 22:55:53 +000027
Chris Lattner76ac0682005-11-15 00:40:23 +000028/// createX86ISelDag - This pass converts a legalized DAG into a
29/// X86-specific DAG, ready for instruction scheduling.
30///
Bruno Cardoso Lopes9fd794b2009-06-01 19:57:37 +000031FunctionPass *createX86ISelDag(X86TargetMachine &TM,
32 CodeGenOpt::Level OptLevel);
Chris Lattnerff9e21c2005-01-07 07:48:33 +000033
Chris Lattner61e11952003-01-13 00:45:29 +000034/// createX86FloatingPointStackifierPass - This function returns a pass which
35/// converts floating point register references and pseudo instructions into
36/// floating point stack references and physical instructions.
Chris Lattner49376432002-12-28 20:26:16 +000037///
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000038FunctionPass *createX86FloatingPointStackifierPass();
Chris Lattner02a3d832002-10-29 22:37:54 +000039
Dan Gohman88ba5f02008-11-12 22:55:05 +000040/// createX87FPRegKillInserterPass - This function returns a pass which
41/// inserts FP_REG_KILL instructions where needed.
42///
43FunctionPass *createX87FPRegKillInserterPass();
44
Chris Lattnerd8312092005-07-11 05:17:48 +000045/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
46/// to the specified MCE object.
Bruno Cardoso Lopesa194c3a2009-05-30 20:51:52 +000047
Bruno Cardoso Lopes9fd794b2009-06-01 19:57:37 +000048FunctionPass *createX86CodeEmitterPass(X86TargetMachine &TM,
49 MachineCodeEmitter &MCE);
50FunctionPass *createX86JITCodeEmitterPass(X86TargetMachine &TM,
51 JITCodeEmitter &JCE);
Bruno Cardoso Lopes5661ea62009-07-06 05:09:34 +000052FunctionPass *createX86ObjectCodeEmitterPass(X86TargetMachine &TM,
53 ObjectCodeEmitter &OCE);
Chris Lattnerd8312092005-07-11 05:17:48 +000054
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000055/// createX86EmitCodeToMemory - Returns a pass that converts a register
56/// allocated function into raw machine code in a dynamically
57/// allocated chunk of memory.
Chris Lattnerd92fb002002-10-25 22:55:53 +000058///
Brian Gaeke1a6f2b82003-08-13 18:15:29 +000059FunctionPass *createEmitX86CodeToMemory();
Chris Lattnerd92fb002002-10-25 22:55:53 +000060
Bruno Cardoso Lopes9fd794b2009-06-01 19:57:37 +000061/// createX86MaxStackAlignmentCalculatorPass - This function returns a pass
62/// which calculates maximal stack alignment required for function
Anton Korobeynikov26590112008-04-23 18:23:05 +000063///
64FunctionPass *createX86MaxStackAlignmentCalculatorPass();
65
Daniel Dunbar67038c12009-07-18 23:03:22 +000066extern Target TheX86_32Target, TheX86_64Target;
67
Chris Lattnerff9e21c2005-01-07 07:48:33 +000068} // End llvm namespace
69
Chris Lattner8b316882003-08-03 15:48:55 +000070// Defines symbolic names for X86 registers. This defines a mapping from
71// register name to register number.
72//
73#include "X86GenRegisterNames.inc"
74
Chris Lattnerbb8bdc02003-08-03 21:57:05 +000075// Defines symbolic names for the X86 instructions.
76//
77#include "X86GenInstrNames.inc"
Chris Lattnerd92fb002002-10-25 22:55:53 +000078
79#endif