14 #define DEBUG_TYPE "mips-subtarget"
28 #define GET_SUBTARGETINFO_TARGET_DESC
29 #define GET_SUBTARGETINFO_CTOR
30 #include "MipsGenSubtargetInfo.inc"
40 cl::desc(
"Allow for a mixture of Mips16 "
41 "and Mips32 code in a single source file"),
47 cl::desc(
"Compile all functions that don' use "
48 "floating point as Mips 16"),
53 cl::desc(
"MIPS: mips16 hard float enable."),
59 cl::desc(
"MIPS: mips16 constant islands enable. experimental feature"),
62 void MipsSubtarget::anchor() { }
68 MipsArchVersion(Mips32), MipsABI(UnknownABI), IsLittle(little),
75 RM(_RM), OverrideMode(NoOverride),
TM(_TM)
77 std::string CPUName = CPU;
96 "Invalid Arch & ABI pair.");
104 if (TT.find(
"linux") == std::string::npos)
117 RegClassVector &CriticalPathRCs)
const {
119 CriticalPathRCs.clear();
121 &Mips::GPR64RegClass : &Mips::GPR32RegClass);
130 bool ChangeToMips16 =
false, ChangeToNoMips16 =
false;
131 DEBUG(
dbgs() <<
"resetSubtargetFeatures" <<
"\n");
133 ChangeToMips16 = FnAttrs.
hasAttribute(AttributeSet::FunctionIndex,
135 ChangeToNoMips16 = FnAttrs.
hasAttribute(AttributeSet::FunctionIndex,
137 assert (!(ChangeToMips16 & ChangeToNoMips16) &&
138 "mips16 and nomips16 specified on the same function");
139 if (ChangeToMips16) {
146 }
else if (ChangeToNoMips16) {
157 DEBUG(
dbgs() <<
"back to default" <<
"\n");
static cl::opt< bool > Mips_Os16("mips-os16", cl::init(false), cl::desc("Compile all functions that don' use ""floating point as Mips 16"), cl::Hidden)
const Function * getFunction() const
bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return true if the attribute exists at the given index.
void resetSubtarget(MachineFunction *MF)
Reset the subtarget for the Mips target.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
InstrItineraryData InstrItins
This file contains the simple types necessary to represent the attributes associated with functions a...
bool PreviousInMips16Mode
initializer< Ty > init(const Ty &Val)
static cl::opt< bool > Mips16HardFloat("mips16-hard-float", cl::NotHidden, cl::desc("MIPS: mips16 hard float enable."), cl::init(false))
void setHelperClassesMips16()
static cl::opt< bool > Mips16ConstantIslands("mips16-constant-islands", cl::Hidden, cl::desc("MIPS: mips16 constant islands enable. experimental feature"), cl::init(false))
bool mipsSEUsesSoftFloat() const
bool inMips16Mode() const
MipsSubtarget(const std::string &TT, const std::string &CPU, const std::string &FS, bool little, Reloc::Model RM, MipsTargetMachine *TM)
void setHelperClassesMipsSE()
enum llvm::MipsSubtarget::@189 OverrideMode
static bool useConstantIslands()
virtual bool enablePostRAScheduler(CodeGenOpt::Level OptLevel, AntiDepBreakMode &Mode, RegClassVector &CriticalPathRCs) const
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.
AttributeSet getAttributes() const
Return the attribute list for this Function.
bool isABI_EABI() const
Only O32 and EABI supported right now.
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
static cl::opt< bool > Mixed16_32("mips-mixed-16-32", cl::init(false), cl::desc("Allow for a mixture of Mips16 ""and Mips32 code in a single source file"), cl::Hidden)