2002-10-26 00:55:53 +02: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 18:43:38 +01:00
|
|
|
class TargetMachine;
|
2002-10-29 23:37:54 +01:00
|
|
|
class Pass;
|
2002-10-26 00:55:53 +02:00
|
|
|
|
2003-07-27 01:49:58 +02:00
|
|
|
/// createX86SimpleInstructionSelector - This pass converts an LLVM function
|
2002-10-29 23:37:54 +01:00
|
|
|
/// into a machine code representation is a very simple peep-hole fashion. The
|
2002-10-26 00:55:53 +02:00
|
|
|
/// generated code sucks but the implementation is nice and simple.
|
|
|
|
///
|
2003-07-27 01:49:58 +02:00
|
|
|
Pass *createX86SimpleInstructionSelector(TargetMachine &TM);
|
2002-10-26 00:55:53 +02:00
|
|
|
|
2003-01-13 01:45:29 +01:00
|
|
|
/// createX86PeepholeOptimizer - Create a pass to perform X86 specific peephole
|
|
|
|
/// optimizations.
|
2002-10-26 00:55:53 +02:00
|
|
|
///
|
2003-01-13 01:45:29 +01:00
|
|
|
Pass *createX86PeepholeOptimizerPass();
|
2002-12-28 21:26:16 +01:00
|
|
|
|
2003-01-13 01:45:29 +01: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 21:26:16 +01:00
|
|
|
///
|
2003-01-13 01:45:29 +01:00
|
|
|
Pass *createX86FloatingPointStackifierPass();
|
2002-10-29 23:37:54 +01:00
|
|
|
|
2003-07-23 22:25:08 +02: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 23:37:54 +01:00
|
|
|
///
|
2003-07-23 22:25:08 +02:00
|
|
|
Pass *createX86CodePrinterPass(std::ostream &o, TargetMachine &tm);
|
2002-10-26 00:55:53 +02: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 21:26:16 +01:00
|
|
|
Pass *createEmitX86CodeToMemory();
|
2002-10-26 00:55:53 +02:00
|
|
|
|
2003-06-03 17:31:23 +02:00
|
|
|
/// X86 namespace - This namespace contains all of the register and opcode enums
|
|
|
|
/// used by the X86 backend.
|
|
|
|
///
|
2002-10-26 00:55:53 +02: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 17:14:51 +01:00
|
|
|
#define R(ENUM, NAME, FLAGS, TSFLAGS, ALIAS_SET) ENUM,
|
2002-10-26 00:55:53 +02:00
|
|
|
#include "X86RegisterInfo.def"
|
|
|
|
};
|
|
|
|
|
|
|
|
// This defines a large number of symbolic names for X86 instruction opcodes.
|
|
|
|
enum Opcode {
|
2002-12-03 06:42:53 +01:00
|
|
|
#define I(ENUM, NAME, BASEOPCODE, FLAGS, TSFLAGS, IMPDEFS, IMPUSES) ENUM,
|
2002-10-29 22:05:24 +01:00
|
|
|
#include "X86InstrInfo.def"
|
2002-10-26 00:55:53 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|