28 #define DEBUG_TYPE "mips-subtarget"
30 #define GET_SUBTARGETINFO_TARGET_DESC
31 #define GET_SUBTARGETINFO_CTOR
32 #include "MipsGenSubtargetInfo.inc"
38 cl::desc(
"Allow for a mixture of Mips16 "
39 "and Mips32 code in a single output file"),
43 cl::desc(
"Compile all functions that don't use "
44 "floating point as Mips 16"),
48 cl::desc(
"Enable mips16 hard float."),
53 cl::desc(
"Enable mips16 constant islands."),
58 cl::desc(
"Enable gp-relative addressing of mips small data items"));
60 void MipsSubtarget::anchor() { }
63 const std::string &FS,
bool little,
66 IsLittle(little), IsSoftFloat(
false), IsSingleFloat(
false), IsFPXX(
false),
74 TargetTriple(TT), TSInfo(),
76 MipsInstrInfo::create(initializeSubtargetDependencies(CPU, FS, TM))),
80 PreviousInMips16Mode = InMips16Mode;
82 if (MipsArchVersion == MipsDefault)
83 MipsArchVersion = Mips32;
87 if (MipsArchVersion == Mips1)
89 if (MipsArchVersion == Mips5)
95 "Invalid Arch & ABI pair.");
121 UseSmallSection =
GPOpt;
122 if (!NoABICalls &&
GPOpt) {
123 errs() <<
"warning: cannot use small-data accesses for '-mabicalls'"
125 UseSmallSection =
false;
137 CriticalPathRCs.clear();
139 &Mips::GPR64RegClass : &Mips::GPR32RegClass);
154 InstrItins = getInstrItineraryForCPU(CPUName);
156 if (InMips16Mode && !IsSoftFloat)
157 InMips16HardFloat =
true;
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
const MipsABIInfo & getABI() const
Reloc::Model getRelocationModel() const
Returns the code generation relocation model.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
void getCriticalPathRCs(RegClassVector &CriticalPathRCs) const override
bool isPositionIndependent() const
const Triple & getTargetTriple() const
const MipsABIInfo & getABI() const
This file contains the simple types necessary to represent the attributes associated with functions a...
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 output file"), cl::Hidden)
Function Alias Analysis false
initializer< Ty > init(const Ty &Val)
static cl::opt< bool > Mips16ConstantIslands("mips16-constant-islands", cl::NotHidden, cl::desc("Enable mips16 constant islands."), cl::init(true))
bool isPositionIndependent() const
StringRef selectMipsCPU(const Triple &TT, StringRef CPU)
Select the Mips CPU for the given triple and cpu name.
Triple - Helper class for working with autoconf configuration names.
static bool useConstantIslands()
static cl::opt< bool > Mips_Os16("mips-os16", cl::init(false), cl::desc("Compile all functions that don't use ""floating point as Mips 16"), cl::Hidden)
bool enablePostRAScheduler() const override
This overrides the PostRAScheduler bit in the SchedModel for each CPU.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
MipsSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, bool little, const MipsTargetMachine &TM)
This constructor initializes the data members to match that of the specified triple.
Reloc::Model getRelocationModel() const
static cl::opt< bool > GPOpt("mgpopt", cl::Hidden, cl::desc("Enable gp-relative addressing of mips small data items"))
CodeGenOpt::Level getOptLevelToEnablePostRAScheduler() const override
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
MipsSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS, const TargetMachine &TM)
Primary interface to the complete machine description for the target machine.
static cl::opt< bool > Mips16HardFloat("mips16-hard-float", cl::NotHidden, cl::desc("Enable mips16 hard float."), cl::init(false))
StringRef - Represent a constant reference to a string, i.e.