2002-10-25 22:55:53 +00:00
|
|
|
//===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// This file contains the entry points for global functions defined in the x86
|
|
|
|
// target library, as used by the LLVM JIT.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef TARGET_X86_H
|
|
|
|
#define TARGET_X86_H
|
|
|
|
|
|
|
|
#include <iosfwd>
|
2002-10-29 17:43:38 +00:00
|
|
|
class TargetMachine;
|
2002-10-29 22:37:54 +00:00
|
|
|
class Pass;
|
2002-10-25 22:55:53 +00:00
|
|
|
|
2002-10-29 22:37:54 +00:00
|
|
|
/// createSimpleX86InstructionSelector - This pass converts an LLVM function
|
|
|
|
/// into a machine code representation is a very simple peep-hole fashion. The
|
2002-10-25 22:55:53 +00:00
|
|
|
/// generated code sucks but the implementation is nice and simple.
|
|
|
|
///
|
2002-10-29 22:37:54 +00:00
|
|
|
Pass *createSimpleX86InstructionSelector(TargetMachine &TM);
|
2002-10-25 22:55:53 +00:00
|
|
|
|
2003-01-13 00:45:29 +00:00
|
|
|
/// createX86PeepholeOptimizer - Create a pass to perform X86 specific peephole
|
|
|
|
/// optimizations.
|
2002-10-25 22:55:53 +00:00
|
|
|
///
|
2003-01-13 00:45:29 +00:00
|
|
|
Pass *createX86PeepholeOptimizerPass();
|
2002-12-28 20:26:16 +00:00
|
|
|
|
2003-01-13 00:45:29 +00:00
|
|
|
/// createX86FloatingPointStackifierPass - This function returns a pass which
|
|
|
|
/// converts floating point register references and pseudo instructions into
|
|
|
|
/// floating point stack references and physical instructions.
|
2002-12-28 20:26:16 +00:00
|
|
|
///
|
2003-01-13 00:45:29 +00:00
|
|
|
Pass *createX86FloatingPointStackifierPass();
|
2002-10-29 22:37:54 +00:00
|
|
|
|
2003-07-23 20:25:08 +00:00
|
|
|
/// createX86CodePrinterPass - Returns a pass that prints the X86
|
|
|
|
/// assembly code for a MachineFunction to the given output stream,
|
|
|
|
/// using the given target machine description. This should work
|
|
|
|
/// regardless of whether the function is in SSA form.
|
2002-10-29 22:37:54 +00:00
|
|
|
///
|
2003-07-23 20:25:08 +00:00
|
|
|
Pass *createX86CodePrinterPass(std::ostream &o, TargetMachine &tm);
|
2002-10-25 22:55:53 +00:00
|
|
|
|
|
|
|
/// X86EmitCodeToMemory - This function converts a register allocated function
|
|
|
|
/// into raw machine code in a dynamically allocated chunk of memory. A pointer
|
|
|
|
/// to the start of the function is returned.
|
|
|
|
///
|
2002-12-28 20:26:16 +00:00
|
|
|
Pass *createEmitX86CodeToMemory();
|
2002-10-25 22:55:53 +00:00
|
|
|
|
2003-06-03 15:31:23 +00:00
|
|
|
/// X86 namespace - This namespace contains all of the register and opcode enums
|
|
|
|
/// used by the X86 backend.
|
|
|
|
///
|
2002-10-25 22:55:53 +00:00
|
|
|
namespace X86 {
|
|
|
|
// Defines a large number of symbolic names for X86 registers. This defines a
|
|
|
|
// mapping from register name to register number.
|
|
|
|
//
|
|
|
|
enum Register {
|
2002-12-16 16:14:51 +00:00
|
|
|
#define R(ENUM, NAME, FLAGS, TSFLAGS, ALIAS_SET) ENUM,
|
2002-10-25 22:55:53 +00:00
|
|
|
#include "X86RegisterInfo.def"
|
|
|
|
};
|
|
|
|
|
|
|
|
// This defines a large number of symbolic names for X86 instruction opcodes.
|
|
|
|
enum Opcode {
|
2002-12-03 05:42:53 +00:00
|
|
|
#define I(ENUM, NAME, BASEOPCODE, FLAGS, TSFLAGS, IMPDEFS, IMPUSES) ENUM,
|
2002-10-29 21:05:24 +00:00
|
|
|
#include "X86InstrInfo.def"
|
2002-10-25 22:55:53 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|