2011-07-06 22:01:53 +00:00
|
|
|
//===-- X86MCTargetDesc.h - X86 Target Descriptions -------------*- C++ -*-===//
|
2011-06-24 01:44:41 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file provides X86 specific target descriptions.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2011-07-06 22:01:53 +00:00
|
|
|
#ifndef X86MCTARGETDESC_H
|
|
|
|
#define X86MCTARGETDESC_H
|
2011-06-24 23:59:54 +00:00
|
|
|
|
2011-07-25 20:13:36 +00:00
|
|
|
#include "llvm/Support/DataTypes.h"
|
2011-07-07 21:06:52 +00:00
|
|
|
#include <string>
|
|
|
|
|
2011-06-24 20:42:09 +00:00
|
|
|
namespace llvm {
|
2011-07-25 23:24:55 +00:00
|
|
|
class MCAsmBackend;
|
2011-07-25 18:43:53 +00:00
|
|
|
class MCCodeEmitter;
|
|
|
|
class MCContext;
|
|
|
|
class MCInstrInfo;
|
2011-07-25 19:33:48 +00:00
|
|
|
class MCObjectWriter;
|
2011-07-18 20:57:22 +00:00
|
|
|
class MCRegisterInfo;
|
2011-07-08 01:53:10 +00:00
|
|
|
class MCSubtargetInfo;
|
2011-06-24 20:42:09 +00:00
|
|
|
class Target;
|
2011-07-07 21:06:52 +00:00
|
|
|
class StringRef;
|
2011-07-25 19:33:48 +00:00
|
|
|
class raw_ostream;
|
2011-06-24 20:42:09 +00:00
|
|
|
|
|
|
|
extern Target TheX86_32Target, TheX86_64Target;
|
2011-07-07 21:06:52 +00:00
|
|
|
|
2011-07-18 20:57:22 +00:00
|
|
|
/// DWARFFlavour - Flavour of dwarf regnumbers
|
|
|
|
///
|
|
|
|
namespace DWARFFlavour {
|
|
|
|
enum {
|
|
|
|
X86_64 = 0, X86_32_DarwinEH = 1, X86_32_Generic = 2
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/// N86 namespace - Native X86 register numbers
|
|
|
|
///
|
|
|
|
namespace N86 {
|
|
|
|
enum {
|
|
|
|
EAX = 0, ECX = 1, EDX = 2, EBX = 3, ESP = 4, EBP = 5, ESI = 6, EDI = 7
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2011-07-07 21:06:52 +00:00
|
|
|
namespace X86_MC {
|
|
|
|
std::string ParseX86Triple(StringRef TT);
|
|
|
|
|
|
|
|
/// GetCpuIDAndInfo - Execute the specified cpuid and return the 4 values in
|
|
|
|
/// the specified arguments. If we can't run cpuid on the host, return true.
|
|
|
|
bool GetCpuIDAndInfo(unsigned value, unsigned *rEAX,
|
|
|
|
unsigned *rEBX, unsigned *rECX, unsigned *rEDX);
|
2011-10-16 00:21:51 +00:00
|
|
|
/// GetCpuIDAndInfoEx - Execute the specified cpuid with subleaf and return
|
|
|
|
/// the 4 values in the specified arguments. If we can't run cpuid on the
|
|
|
|
/// host, return true.
|
|
|
|
bool GetCpuIDAndInfoEx(unsigned value, unsigned subleaf, unsigned *rEAX,
|
|
|
|
unsigned *rEBX, unsigned *rECX, unsigned *rEDX);
|
2011-07-07 21:06:52 +00:00
|
|
|
|
|
|
|
void DetectFamilyModel(unsigned EAX, unsigned &Family, unsigned &Model);
|
2011-07-08 01:53:10 +00:00
|
|
|
|
2011-07-18 20:57:22 +00:00
|
|
|
unsigned getDwarfRegFlavour(StringRef TT, bool isEH);
|
|
|
|
|
|
|
|
unsigned getX86RegNum(unsigned RegNo);
|
|
|
|
|
|
|
|
void InitLLVM2SEHRegisterMapping(MCRegisterInfo *MRI);
|
|
|
|
|
|
|
|
/// createX86MCSubtargetInfo - Create a X86 MCSubtargetInfo instance.
|
2011-07-08 01:53:10 +00:00
|
|
|
/// This is exposed so Asm parser, etc. do not need to go through
|
|
|
|
/// TargetRegistry.
|
|
|
|
MCSubtargetInfo *createX86MCSubtargetInfo(StringRef TT, StringRef CPU,
|
|
|
|
StringRef FS);
|
2011-07-07 21:06:52 +00:00
|
|
|
}
|
2011-07-08 01:53:10 +00:00
|
|
|
|
2011-07-25 18:43:53 +00:00
|
|
|
MCCodeEmitter *createX86MCCodeEmitter(const MCInstrInfo &MCII,
|
|
|
|
const MCSubtargetInfo &STI,
|
|
|
|
MCContext &Ctx);
|
|
|
|
|
2011-07-25 23:24:55 +00:00
|
|
|
MCAsmBackend *createX86_32AsmBackend(const Target &T, StringRef TT);
|
|
|
|
MCAsmBackend *createX86_64AsmBackend(const Target &T, StringRef TT);
|
2011-07-25 19:33:48 +00:00
|
|
|
|
|
|
|
/// createX86MachObjectWriter - Construct an X86 Mach-O object writer.
|
|
|
|
MCObjectWriter *createX86MachObjectWriter(raw_ostream &OS,
|
|
|
|
bool Is64Bit,
|
|
|
|
uint32_t CPUType,
|
|
|
|
uint32_t CPUSubtype);
|
2011-07-25 18:43:53 +00:00
|
|
|
|
2011-06-24 20:42:09 +00:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2011-07-08 01:53:10 +00:00
|
|
|
|
2011-06-24 01:44:41 +00:00
|
|
|
// Defines symbolic names for X86 registers. This defines a mapping from
|
|
|
|
// register name to register number.
|
|
|
|
//
|
2011-06-27 18:32:37 +00:00
|
|
|
#define GET_REGINFO_ENUM
|
|
|
|
#include "X86GenRegisterInfo.inc"
|
2011-06-24 23:59:54 +00:00
|
|
|
|
2011-06-28 20:07:07 +00:00
|
|
|
// Defines symbolic names for the X86 instructions.
|
|
|
|
//
|
|
|
|
#define GET_INSTRINFO_ENUM
|
|
|
|
#include "X86GenInstrInfo.inc"
|
|
|
|
|
2011-07-14 20:59:42 +00:00
|
|
|
#define GET_SUBTARGETINFO_ENUM
|
|
|
|
#include "X86GenSubtargetInfo.inc"
|
|
|
|
|
2011-06-24 23:59:54 +00:00
|
|
|
#endif
|