13#ifndef LLVM_LIB_TARGET_MIPS_MIPSSUBTARGET_H
14#define LLVM_LIB_TARGET_MIPS_MIPSSUBTARGET_H
30#define GET_SUBTARGETINFO_HEADER
31#include "MipsGenSubtargetInfo.inc"
47#define OPTIONS_STRUCT_DECL
48#include "MipsOptions.inc"
51class MipsTargetMachine;
54 const MipsOptions &CLOpts;
55 const MipsMCOptions &MCCLOpts;
57 virtual void anchor();
80 enum class CPU { Others, P5600, I6400, I6500 };
83 static bool DspWarningPrinted;
86 static bool MSAWarningPrinted;
89 static bool CRCWarningPrinted;
92 static bool GINVWarningPrinted;
95 static bool VirtWarningPrinted;
98 MipsArchEnum MipsArchVersion;
101 CPU ProcImpl = CPU::Others;
137 std::bitset<32> UserReservedGPR;
158 bool UseSmallSection;
181 bool InMips16HardFloat;
184 bool InMicroMipsMode;
187 bool HasDSP, HasDSPR2, HasDSPR3;
222 bool UseIndirectJumpsHazard;
225 bool UseLongCalls =
false;
228 bool UseXGOT =
false;
234 bool UseCompactBranches =
true;
238 Align stackAlignment;
247 std::unique_ptr<const SelectionDAGTargetInfo> TSInfo;
248 std::unique_ptr<const MipsInstrInfo> InstrInfo;
249 std::unique_ptr<const MipsFrameLowering> FrameLowering;
250 std::unique_ptr<const MipsTargetLowering> TLInfo;
268 assert(GPR < UserReservedGPR.size() &&
"GPR number out of range");
269 return UserReservedGPR[GPR];
286 bool hasMips1()
const {
return MipsArchVersion >= Mips1; }
287 bool hasMips2()
const {
return MipsArchVersion >= Mips2; }
288 bool hasMips3()
const {
return MipsArchVersion >= Mips3; }
289 bool hasMips4()
const {
return MipsArchVersion >= Mips4; }
290 bool hasMips5()
const {
return MipsArchVersion >= Mips5; }
294 return (MipsArchVersion >= Mips32 && MipsArchVersion < Mips32Max) ||
298 return (MipsArchVersion >= Mips32r2 && MipsArchVersion < Mips32Max) ||
302 return (MipsArchVersion >= Mips32r3 && MipsArchVersion < Mips32Max) ||
306 return (MipsArchVersion >= Mips32r5 && MipsArchVersion < Mips32Max) ||
310 return (MipsArchVersion >= Mips32r6 && MipsArchVersion < Mips32Max) ||
313 bool hasMips64()
const {
return MipsArchVersion >= Mips64; }
342 bool isTargetCOFF()
const {
return getTargetTriple().isOSBinFormatCOFF(); }
343 bool isTargetELF()
const {
return getTargetTriple().isOSBinFormatELF(); }
360 bool has3D()
const {
return Has3D; }
364 bool hasMT()
const {
return HasMT; }
378 return !InMips16Mode && !InMicroMipsMode && !
hasNanoMips();
422 return FrameLowering.get();
425 return &InstrInfo->getRegisterInfo();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
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...
Tracks which library functions to use for a particular subtarget or function.
void initLibcallLoweringInfo(LibcallLoweringInfo &Info) const override
bool isXRaySupported() const override
const LegalizerInfo * getLegalizerInfo() const override
bool enablePostRAScheduler() const override
This overrides the PostRAScheduler bit in the SchedModel for each CPU.
bool inMicroMipsMode() const
MipsSubtarget(const Triple &TT, StringRef CPU, StringRef FS, StringRef ABIName, bool little, const MipsTargetMachine &TM, MaybeAlign StackAlignOverride)
This constructor initializes the data members to match that of the specified triple.
std::unique_ptr< InstructionSelector > InstSelector
bool useSoftFloat() const
const MipsInstrInfo * getInstrInfo() const override
void mirFileLoaded(MachineFunction &MF) 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 inMips16Mode() const
~MipsSubtarget() override
bool useCompactBranches() const
bool inAbs2008Mode() const
const MipsOptions & getCLOpts() const
std::unique_ptr< CallLowering > CallLoweringInfo
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 inMicroMips32r6Mode() const
bool isTargetCOFF() const
bool hasMips4_32r2() const
Align getStackAlignment() const
bool isTargetWindows() const
InstructionSelector * getInstructionSelector() const override
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
bool isSingleFloat() const
std::unique_ptr< LegalizerInfo > Legalizer
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
const MipsABIInfo & getABI() const
bool useConstantIslands() const
Reloc::Model getRelocationModel() const
const MipsMCOptions & getMCCLOpts() const
bool isGPRReservedByUser(unsigned GPR) const
CodeGenOptLevel getOptLevelToEnablePostRAScheduler() const override
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...
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.
@ Never
Never set the bit.
CodeGenOptLevel
Code generation optimization level.
@ Optimal
Optimal is the default and will produce compact branches when appropriate.
@ Always
Always emit .debug_str_offsets talbes as DWARF64 for testing.
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.