14 #ifndef LLVM_LIB_TARGET_MIPS_MIPSSUBTARGET_H 15 #define LLVM_LIB_TARGET_MIPS_MIPSSUBTARGET_H 32 #define GET_SUBTARGETINFO_HEADER 33 #include "MipsGenSubtargetInfo.inc" 38 class MipsTargetMachine;
41 virtual void anchor();
45 Mips1, Mips2, Mips32, Mips32r2, Mips32r3, Mips32r5, Mips32r6, Mips32Max,
46 Mips3, Mips4, Mips5, Mips64, Mips64r2, Mips64r3, Mips64r5, Mips64r6
49 enum class CPU { P5600 };
52 static bool DspWarningPrinted;
55 static bool MSAWarningPrinted;
58 static bool CRCWarningPrinted;
61 static bool GINVWarningPrinted;
64 static bool VirtWarningPrinted;
67 MipsArchEnum MipsArchVersion;
116 bool UseSmallSection;
139 bool InMips16HardFloat;
142 bool InMicroMipsMode;
145 bool HasDSP, HasDSPR2, HasDSPR3;
148 bool AllowMixed16_32;
185 bool UseIndirectJumpsHazard;
188 bool UseLongCalls =
false;
192 unsigned stackAlignment;
195 unsigned StackAlignOverride;
201 enum {NoOverride, Mips16Override, NoMips16Override} OverrideMode;
208 std::unique_ptr<const MipsInstrInfo> InstrInfo;
209 std::unique_ptr<const MipsFrameLowering> FrameLowering;
210 std::unique_ptr<const MipsTargetLowering> TLInfo;
234 bool hasMips1()
const {
return MipsArchVersion >= Mips1; }
235 bool hasMips2()
const {
return MipsArchVersion >= Mips2; }
236 bool hasMips3()
const {
return MipsArchVersion >= Mips3; }
237 bool hasMips4()
const {
return MipsArchVersion >= Mips4; }
238 bool hasMips5()
const {
return MipsArchVersion >= Mips5; }
242 return (MipsArchVersion >= Mips32 && MipsArchVersion < Mips32Max) ||
246 return (MipsArchVersion >= Mips32r2 && MipsArchVersion < Mips32Max) ||
250 return (MipsArchVersion >= Mips32r3 && MipsArchVersion < Mips32Max) ||
254 return (MipsArchVersion >= Mips32r5 && MipsArchVersion < Mips32Max) ||
258 return (MipsArchVersion >= Mips32r6 && MipsArchVersion < Mips32Max) ||
261 bool hasMips64()
const {
return MipsArchVersion >= Mips64; }
308 bool hasMT()
const {
return HasMT; }
334 bool os16()
const {
return Os16; }
368 return FrameLowering.get();
371 return &InstrInfo->getRegisterInfo();
const RegisterBankInfo * getRegBankInfo() const override
bool inMips16HardFloat() const
bool inMips16ModeDefault() const
std::unique_ptr< InstructionSelector > InstSelector
This class represents lattice values for constants.
bool inMips16Mode() const
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
MipsSubtarget(const Triple &TT, StringRef CPU, StringRef FS, bool little, const MipsTargetMachine &TM, unsigned StackAlignOverride)
This constructor initializes the data members to match that of the specified triple.
void setHelperClassesMips16()
void getCriticalPathRCs(RegClassVector &CriticalPathRCs) const override
bool isOSNaCl() const
Tests whether the OS is NaCl (Native Client)
const MipsInstrInfo * getInstrInfo() const override
const InstrItineraryData * getInstrItineraryData() const override
bool hasExtractInsert() const
Features related to the presence of specific instructions.
bool enableLongBranchPass() const
const InstructionSelector * getInstructionSelector() const override
Holds all the information related to register banks.
bool inMicroMipsMode() const
bool isXRaySupported() const override
bool hasStandardEncoding() const
bool useIndirectJumpsHazard() const
bool hasMips4_32r2() const
Itinerary data supplied by a subtarget to be used by a target.
bool useSmallSection() const
bool isTargetNaCl() const
const TargetFrameLowering * getFrameLowering() const override
unsigned getGPRSizeInBytes() const
unsigned getStackAlignment() const
const LegalizerInfo * getLegalizerInfo() const override
bool useLongCalls() const
std::unique_ptr< RegisterBankInfo > RegBankInfo
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
bool isSingleFloat() const
const MipsABIInfo & getABI() const
Triple - Helper class for working with autoconf configuration names.
std::unique_ptr< CallLowering > CallLoweringInfo
static bool useConstantIslands()
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
const MipsRegisterInfo * getRegisterInfo() const override
bool isPositionIndependent() const
bool enablePostRAScheduler() const override
This overrides the PostRAScheduler bit in the SchedModel for each CPU.
void setHelperClassesMipsSE()
Information about stack frame layout on the target.
const CallLowering * getCallLowering() const override
const MipsTargetLowering * getTargetLowering() const override
Provides the logic to select generic machine instructions.
bool allowMixed16_32() const
CodeGenOpt::Level getOptLevelToEnablePostRAScheduler() const override
Reloc::Model getRelocationModel() const
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
This file describes how to lower LLVM calls to machine code calls.
MipsSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS, const TargetMachine &TM)
bool useSoftFloat() const
Primary interface to the complete machine description for the target machine.
bool inMicroMips32r6Mode() const
StringRef - Represent a constant reference to a string, i.e.
bool systemSupportsUnalignedAccess() const
Does the system support unaligned memory access.
bool disableMadd4() const
std::unique_ptr< LegalizerInfo > Legalizer