13#ifndef LLVM_LIB_TARGET_MIPS_MIPSSUBTARGET_H
14#define LLVM_LIB_TARGET_MIPS_MIPSSUBTARGET_H
29#define GET_SUBTARGETINFO_HEADER
30#include "MipsGenSubtargetInfo.inc"
45class MipsTargetMachine;
48 virtual void anchor();
52 Mips1, Mips2, Mips32, Mips32r2, Mips32r3, Mips32r5, Mips32r6, Mips32Max,
53 Mips3, Mips4, Mips5, Mips64, Mips64r2, Mips64r3, Mips64r5, Mips64r6
56 enum class CPU { Others, P5600, I6400, I6500 };
59 static bool DspWarningPrinted;
62 static bool MSAWarningPrinted;
65 static bool CRCWarningPrinted;
68 static bool GINVWarningPrinted;
71 static bool MIPS1WarningPrinted;
74 static bool VirtWarningPrinted;
77 MipsArchEnum MipsArchVersion;
80 CPU ProcImpl = CPU::Others;
131 bool UseSmallSection;
154 bool InMips16HardFloat;
157 bool InMicroMipsMode;
160 bool HasDSP, HasDSPR2, HasDSPR3;
166 bool AllowMixed16_32;
203 bool UseIndirectJumpsHazard;
206 bool UseLongCalls =
false;
209 bool UseXGOT =
false;
215 bool UseCompactBranches =
true;
219 Align stackAlignment;
228 enum {NoOverride, Mips16Override, NoMips16Override} OverrideMode;
234 std::unique_ptr<const SelectionDAGTargetInfo> TSInfo;
235 std::unique_ptr<const MipsInstrInfo> InstrInfo;
236 std::unique_ptr<const MipsFrameLowering> FrameLowering;
237 std::unique_ptr<const MipsTargetLowering> TLInfo;
265 bool hasMips1()
const {
return MipsArchVersion >= Mips1; }
266 bool hasMips2()
const {
return MipsArchVersion >= Mips2; }
267 bool hasMips3()
const {
return MipsArchVersion >= Mips3; }
268 bool hasMips4()
const {
return MipsArchVersion >= Mips4; }
269 bool hasMips5()
const {
return MipsArchVersion >= Mips5; }
273 return (MipsArchVersion >= Mips32 && MipsArchVersion < Mips32Max) ||
277 return (MipsArchVersion >= Mips32r2 && MipsArchVersion < Mips32Max) ||
281 return (MipsArchVersion >= Mips32r3 && MipsArchVersion < Mips32Max) ||
285 return (MipsArchVersion >= Mips32r5 && MipsArchVersion < Mips32Max) ||
289 return (MipsArchVersion >= Mips32r6 && MipsArchVersion < Mips32Max) ||
292 bool hasMips64()
const {
return MipsArchVersion >= Mips64; }
319 bool isTargetELF()
const {
return TargetTriple.isOSBinFormatELF(); }
339 bool has3D()
const {
return Has3D; }
343 bool hasMT()
const {
return HasMT; }
375 bool os16()
const {
return Os16; }
410 return FrameLowering.get();
413 return &InstrInfo->getRegisterInfo();
Analysis containing CSE Info
This file describes how to lower LLVM calls to machine code calls.
Interface for Targets to specify which operations they can successfully select and how the others sho...
Itinerary data supplied by a subtarget to be used by a target.
Tracks which library functions to use for a particular subtarget.
void initLibcallLoweringInfo(LibcallLoweringInfo &Info) const override
bool isXRaySupported() const override
const LegalizerInfo * getLegalizerInfo() const override
static bool useConstantIslands()
bool enablePostRAScheduler() const override
This overrides the PostRAScheduler bit in the SchedModel for each CPU.
bool inMicroMipsMode() const
std::unique_ptr< InstructionSelector > InstSelector
bool useSoftFloat() const
const MipsInstrInfo * getInstrInfo() const override
bool useIndirectJumpsHazard() const
MipsSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS, const TargetMachine &TM)
const CallLowering * getCallLowering() const override
std::unique_ptr< RegisterBankInfo > RegBankInfo
bool allowMixed16_32() const
bool inMips16Mode() const
~MipsSubtarget() override
bool useCompactBranches() const
bool inAbs2008Mode() const
std::unique_ptr< CallLowering > CallLoweringInfo
void setHelperClassesMips16()
const MipsRegisterInfo * getRegisterInfo() const override
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
bool disableMadd4() const
const RegisterBankInfo * getRegBankInfo() const override
static const RTLIB::LibcallImpl HardFloatLibCalls[34]
bool systemSupportsUnalignedAccess() const
Does the system support unaligned memory access.
bool isPositionIndependent() const
bool hasExtractInsert() const
Features related to the presence of specific instructions.
bool enableLongBranchPass() const
void setHelperClassesMipsSE()
bool inMicroMips32r6Mode() const
bool isTargetCOFF() const
bool hasMips4_32r2() const
Align getStackAlignment() const
bool isTargetWindows() const
const InstrItineraryData * getInstrItineraryData() const override
InstructionSelector * getInstructionSelector() const override
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
bool isSingleFloat() const
std::unique_ptr< LegalizerInfo > Legalizer
bool inMips16ModeDefault() const
bool useLongCalls() const
unsigned getGPRSizeInBytes() const
bool useSmallSection() const
const MipsTargetLowering * getTargetLowering() const override
bool inMips16HardFloat() const
bool hasStandardEncoding() const
void getCriticalPathRCs(RegClassVector &CriticalPathRCs) const override
MipsSubtarget(const Triple &TT, StringRef CPU, StringRef FS, bool little, const MipsTargetMachine &TM, MaybeAlign StackAlignOverride)
This constructor initializes the data members to match that of the specified triple.
Reloc::Model getRelocationModel() const
CodeGenOptLevel getOptLevelToEnablePostRAScheduler() const override
const MipsABIInfo & getABI() const
const TargetFrameLowering * getFrameLowering() const override
Holds all the information related to register banks.
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
StringRef - Represent a constant reference to a string, i.e.
Information about stack frame layout on the target.
Primary interface to the complete machine description for the target machine.
Triple - Helper class for working with autoconf configuration names.
This is an optimization pass for GlobalISel generic memory operations.
CodeGenOptLevel
Code generation optimization level.
@ CB_Never
The policy 'never' may in some circumstances or for some ISAs not be absolutely adhered to.
@ CB_Always
'always' may in some circumstances may not be absolutely adhered to, there may not be a corresponding...
@ CB_Optimal
Optimal is the default and will produce compact branches when appropriate.
This struct is a compact representation of a valid (non-zero power of two) alignment.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.