#ifndef MIPSSUBTARGET_H
#define MIPSSUBTARGET_H
-#include "MCTargetDesc/MipsReginfo.h"
#include "llvm/MC/MCInstrItineraries.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetSubtargetInfo.h"
-
#include <string>
#define GET_SUBTARGETINFO_HEADER
};
protected:
-
- enum MipsArchEnum {
- Mips32, Mips32r2, Mips64, Mips64r2
- };
+ enum MipsArchEnum { Mips32, Mips32r2, Mips4, Mips64, Mips64r2 };
// Mips architecture version
MipsArchEnum MipsArchVersion;
// HasVFPU - Processor has a vector floating point unit.
bool HasVFPU;
+ // CPU supports cnMIPS (Cavium Networks Octeon CPU).
+ bool HasCnMips;
+
// isLinux - Target system is Linux. Is false we consider ELFOS for now.
bool IsLinux;
InstrItineraryData InstrItins;
- // The instance to the register info section object
- MipsReginfo MRI;
-
// Relocation Model
Reloc::Model RM;
MipsTargetMachine *TM;
+ Triple TargetTriple;
public:
virtual bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
AntiDepBreakMode& Mode,
bool hasMips64() const { return MipsArchVersion >= Mips64; }
bool hasMips64r2() const { return MipsArchVersion == Mips64r2; }
+ bool hasCnMips() const { return HasCnMips; }
+
bool isLittle() const { return IsLittle; }
bool isFP64bit() const { return IsFP64bit; }
bool isNotFP64bit() const { return !IsFP64bit; }
bool os16() const { return Os16;};
+ bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
+ bool isNotTargetNaCl() const { return !TargetTriple.isOSNaCl(); }
+
// for now constant islands are on for the whole compilation unit but we only
// really use them if in addition we are in mips16 mode
//
unsigned stackAlignment() const { return hasMips64() ? 16 : 8; }
- // Grab MipsRegInfo object
- const MipsReginfo &getMReginfo() const { return MRI; }
-
// Grab relocation model
Reloc::Model getRelocationModel() const {return RM;}