blob: 8b10b0596e0ebd745b4d27e73194b9583fd6d61e [file] [log] [blame]
Jia Liuf54f60f2012-02-28 07:46:26 +00001//===-- MipsSubtarget.h - Define Subtarget for the Mips ---------*- C++ -*-===//
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +00002//
3// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +00007//
Akira Hatanakae2489122011-04-15 21:51:11 +00008//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +00009//
Evan Cheng0d639a22011-07-01 21:01:15 +000010// This file declares the Mips specific subclass of TargetSubtargetInfo.
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +000011//
Akira Hatanakae2489122011-04-15 21:51:11 +000012//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +000013
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_MIPS_MIPSSUBTARGET_H
15#define LLVM_LIB_TARGET_MIPS_MIPSSUBTARGET_H
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +000016
Chandler Carruthd9903882015-01-14 11:23:27 +000017#include "MCTargetDesc/MipsABIInfo.h"
Eric Christopherdaa9dbb2014-07-03 00:10:24 +000018#include "MipsFrameLowering.h"
19#include "MipsISelLowering.h"
20#include "MipsInstrInfo.h"
Benjamin Kramerf9172fd42016-01-27 16:32:26 +000021#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
David Blaikieb3bde2e2017-11-17 01:07:10 +000022#include "llvm/CodeGen/TargetSubtargetInfo.h"
Eric Christopher5f9fd212014-07-02 21:29:23 +000023#include "llvm/IR/DataLayout.h"
Evan Cheng8264e272011-06-29 01:14:12 +000024#include "llvm/MC/MCInstrItineraries.h"
Reed Kotler1595f362013-04-09 19:46:01 +000025#include "llvm/Support/ErrorHandling.h"
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +000026#include <string>
27
Evan Cheng54b68e32011-07-01 20:45:01 +000028#define GET_SUBTARGETINFO_HEADER
Evan Chengc9c090d2011-07-01 22:36:09 +000029#include "MipsGenSubtargetInfo.inc"
Evan Cheng54b68e32011-07-01 20:45:01 +000030
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +000031namespace llvm {
Evan Cheng1a72add62011-07-07 07:07:08 +000032class StringRef;
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +000033
Reed Kotler1595f362013-04-09 19:46:01 +000034class MipsTargetMachine;
35
Evan Cheng54b68e32011-07-01 20:45:01 +000036class MipsSubtarget : public MipsGenSubtargetInfo {
David Blaikiea379b1812011-12-20 02:50:00 +000037 virtual void anchor();
Bruno Cardoso Lopes87beec92007-08-18 01:52:27 +000038
Daniel Sandersb7f1c6f2014-05-09 09:46:21 +000039 enum MipsArchEnum {
Vasileios Kalintirisb2dd15f2014-11-11 11:43:55 +000040 MipsDefault,
Daniel Sanders17793142015-02-18 16:24:50 +000041 Mips1, Mips2, Mips32, Mips32r2, Mips32r3, Mips32r5, Mips32r6, Mips32Max,
42 Mips3, Mips4, Mips5, Mips64, Mips64r2, Mips64r3, Mips64r5, Mips64r6
Daniel Sandersb7f1c6f2014-05-09 09:46:21 +000043 };
Bruno Cardoso Lopesc9c3f492008-07-05 19:05:21 +000044
Daniel Sanders7727e102015-09-28 18:24:08 +000045 enum class CPU { P5600 };
46
Bruno Cardoso Lopesed874ef2011-03-04 17:51:39 +000047 // Mips architecture version
Bruno Cardoso Lopesc9c3f492008-07-05 19:05:21 +000048 MipsArchEnum MipsArchVersion;
49
Daniel Sanders7727e102015-09-28 18:24:08 +000050 // Processor implementation (unused but required to exist by
51 // tablegen-erated code).
52 CPU ProcImpl;
53
Bruno Cardoso Lopesc9c3f492008-07-05 19:05:21 +000054 // IsLittle - The target is Little Endian
Bruno Cardoso Lopes326a0372008-06-04 01:45:25 +000055 bool IsLittle;
Bruno Cardoso Lopesc9c3f492008-07-05 19:05:21 +000056
Toma Tabacu506cfd02015-05-07 10:29:52 +000057 // IsSoftFloat - The target does not support any floating point instructions.
58 bool IsSoftFloat;
59
Bruno Cardoso Lopesc9c3f492008-07-05 19:05:21 +000060 // IsSingleFloat - The target only supports single precision float
61 // point operations. This enable the target to use all 32 32-bit
Bruno Cardoso Lopes7ceec572008-07-09 04:45:36 +000062 // floating point registers instead of only using even ones.
Bruno Cardoso Lopesc9c3f492008-07-05 19:05:21 +000063 bool IsSingleFloat;
64
Zoran Jovanovic255d00d2014-07-10 15:36:12 +000065 // IsFPXX - MIPS O32 modeless ABI.
66 bool IsFPXX;
67
Daniel Sandersfeb61302014-08-08 15:47:17 +000068 // NoABICalls - Disable SVR4-style position-independent code.
69 bool NoABICalls;
Daniel Sanders35837ac2014-08-08 10:01:29 +000070
Bruno Cardoso Lopes7ceec572008-07-09 04:45:36 +000071 // IsFP64bit - The target processor has 64-bit floating point registers.
Bruno Cardoso Lopesc9c3f492008-07-05 19:05:21 +000072 bool IsFP64bit;
73
Daniel Sanders7e527422014-07-10 13:38:23 +000074 /// Are odd single-precision registers permitted?
75 /// This corresponds to -modd-spreg and -mno-odd-spreg
76 bool UseOddSPReg;
77
Matheus Almeida0051f2d2014-04-16 15:48:55 +000078 // IsNan2008 - IEEE 754-2008 NaN encoding.
79 bool IsNaN2008bit;
80
Simon Dardis24ca9da2017-06-15 16:28:28 +000081 // IsGP64bit - General-purpose registers are 64 bits wide
Bruno Cardoso Lopesc9c3f492008-07-05 19:05:21 +000082 bool IsGP64bit;
83
Simon Dardis4fbf76f2016-06-14 11:29:28 +000084 // IsPTR64bit - Pointers are 64 bit wide
85 bool IsPTR64bit;
86
Bruno Cardoso Lopesbcc21392008-07-09 05:32:22 +000087 // HasVFPU - Processor has a vector floating point unit.
88 bool HasVFPU;
Bruno Cardoso Lopesc9c3f492008-07-05 19:05:21 +000089
Kai Nacke93fe5e82014-03-20 11:51:58 +000090 // CPU supports cnMIPS (Cavium Networks Octeon CPU).
91 bool HasCnMips;
92
Bruno Cardoso Lopes80ab8f92008-07-14 14:42:54 +000093 // isLinux - Target system is Linux. Is false we consider ELFOS for now.
94 bool IsLinux;
95
Akira Hatanakaad495022012-08-22 03:18:13 +000096 // UseSmallSection - Small section is used.
97 bool UseSmallSection;
98
Bruno Cardoso Lopesf714e252008-07-30 17:01:06 +000099 /// Features related to the presence of specific instructions.
Bruno Cardoso Lopesed874ef2011-03-04 17:51:39 +0000100
Daniel Sandersf2056be2014-05-09 13:02:27 +0000101 // HasMips3_32 - The subset of MIPS-III instructions added to MIPS32
102 bool HasMips3_32;
103
Daniel Sanders387fc152014-05-13 11:45:36 +0000104 // HasMips3_32r2 - The subset of MIPS-III instructions added to MIPS32r2
105 bool HasMips3_32r2;
106
Daniel Sanders94eda2e2014-05-12 11:56:16 +0000107 // HasMips4_32 - Has the subset of MIPS-IV present in MIPS32
Daniel Sanderse57d8662014-05-09 14:06:17 +0000108 bool HasMips4_32;
109
Daniel Sanders94eda2e2014-05-12 11:56:16 +0000110 // HasMips4_32r2 - Has the subset of MIPS-IV present in MIPS32r2
111 bool HasMips4_32r2;
112
Daniel Sanders07cdea22014-05-12 12:52:44 +0000113 // HasMips5_32r2 - Has the subset of MIPS-V present in MIPS32r2
114 bool HasMips5_32r2;
115
Akira Hatanaka0faaebf2012-05-16 22:19:56 +0000116 // InMips16 -- can process Mips16 instructions
117 bool InMips16Mode;
118
Reed Kotler783c7942013-05-10 22:25:39 +0000119 // Mips16 hard float
120 bool InMips16HardFloat;
121
Jack Carter428a06c2013-02-05 09:30:03 +0000122 // InMicroMips -- can process MicroMips instructions
123 bool InMicroMipsMode;
124
Zoran Jovanovic2e386d32015-10-12 16:07:25 +0000125 // HasDSP, HasDSPR2, HasDSPR3 -- supports DSP ASE.
126 bool HasDSP, HasDSPR2, HasDSPR3;
Akira Hatanaka65ce9312012-09-21 23:41:49 +0000127
Reed Kotler1595f362013-04-09 19:46:01 +0000128 // Allow mixed Mips16 and Mips32 in one source file
129 bool AllowMixed16_32;
130
Reed Kotlerfe94cc32013-04-10 16:58:04 +0000131 // Optimize for space by compiling all functions as Mips 16 unless
132 // it needs floating point. Functions needing floating point are
133 // compiled as Mips32
134 bool Os16;
135
Jack Carter3a2c2d42013-08-13 20:54:07 +0000136 // HasMSA -- supports MSA ASE.
137 bool HasMSA;
138
Daniel Sanders3ebcaf62015-09-03 12:31:22 +0000139 // UseTCCInDIV -- Enables the use of trapping in the assembler.
140 bool UseTCCInDIV;
141
Simon Dardisca74dd72017-01-27 11:36:52 +0000142 // Sym32 -- On Mips64 symbols are 32 bits.
143 bool HasSym32;
144
Daniel Sanderse4e83a72015-09-15 10:02:16 +0000145 // HasEVA -- supports EVA ASE.
146 bool HasEVA;
Stefan Maksimovicadd20f82017-06-09 07:57:05 +0000147
Petar Jovanovic64fb7a82017-06-06 15:33:01 +0000148 // nomadd4 - disables generation of 4-operand madd.s, madd.d and
149 // related instructions.
150 bool DisableMadd4;
Daniel Sanderse4e83a72015-09-15 10:02:16 +0000151
Simon Dardisae719c52017-07-11 18:03:20 +0000152 // HasMT -- support MT ASE.
153 bool HasMT;
154
Simon Atanasyanf217c7b2017-07-15 07:14:25 +0000155 // Disable use of the `jal` instruction.
156 bool UseLongCalls = false;
157
John Baldwin1255b162017-08-14 21:49:38 +0000158 /// The minimum alignment known to hold of the stack frame on
159 /// entry to the function and which must be maintained by every function.
160 unsigned stackAlignment;
161
162 /// The overridden stack alignment.
163 unsigned StackAlignOverride;
164
Bruno Cardoso Lopes87beec92007-08-18 01:52:27 +0000165 InstrItineraryData InstrItins;
166
Reed Kotler1595f362013-04-09 19:46:01 +0000167 // We can override the determination of whether we are in mips16 mode
168 // as from the command line
169 enum {NoOverride, Mips16Override, NoMips16Override} OverrideMode;
170
Eric Christopher90724282015-01-08 18:18:57 +0000171 const MipsTargetMachine &TM;
Reed Kotler1595f362013-04-09 19:46:01 +0000172
Petar Jovanovic97250162014-02-05 17:19:30 +0000173 Triple TargetTriple;
Eric Christopher1f51ddd2014-07-02 00:54:12 +0000174
Benjamin Kramerf9172fd42016-01-27 16:32:26 +0000175 const SelectionDAGTargetInfo TSInfo;
Eric Christopherdaa9dbb2014-07-03 00:10:24 +0000176 std::unique_ptr<const MipsInstrInfo> InstrInfo;
177 std::unique_ptr<const MipsFrameLowering> FrameLowering;
178 std::unique_ptr<const MipsTargetLowering> TLInfo;
Eric Christopher5f9fd212014-07-02 21:29:23 +0000179
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +0000180public:
Rafael Espindolab30e66b2016-06-28 14:33:28 +0000181 bool isPositionIndependent() const;
Sanjay Patela2f658d2014-07-15 22:39:58 +0000182 /// This overrides the PostRAScheduler bit in the SchedModel for each CPU.
Matthias Braun39a2afc2015-06-13 03:42:16 +0000183 bool enablePostRAScheduler() const override;
Sanjay Patela2f658d2014-07-15 22:39:58 +0000184 void getCriticalPathRCs(RegClassVector &CriticalPathRCs) const override;
185 CodeGenOpt::Level getOptLevelToEnablePostRAScheduler() const override;
Bruno Cardoso Lopesc9c3f492008-07-05 19:05:21 +0000186
Eric Christophera5762812015-01-26 17:33:46 +0000187 bool isABI_N64() const;
188 bool isABI_N32() const;
189 bool isABI_O32() const;
190 const MipsABIInfo &getABI() const;
Sasa Stankovicb976fee2014-07-14 09:40:29 +0000191 bool isABI_FPXX() const { return isABI_O32() && IsFPXX; }
Bruno Cardoso Lopesc9c3f492008-07-05 19:05:21 +0000192
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +0000193 /// This constructor initializes the data members to match that
Daniel Dunbar31b44e82009-08-02 22:11:08 +0000194 /// of the specified triple.
Simon Atanasyan039b02ec2017-05-23 15:00:26 +0000195 MipsSubtarget(const Triple &TT, StringRef CPU, StringRef FS, bool little,
John Baldwin1255b162017-08-14 21:49:38 +0000196 const MipsTargetMachine &TM, unsigned StackAlignOverride);
Bruno Cardoso Lopesed874ef2011-03-04 17:51:39 +0000197
198 /// ParseSubtargetFeatures - Parses features string setting specified
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +0000199 /// subtarget options. Definition of function is auto generated by tblgen.
Evan Cheng1a72add62011-07-07 07:07:08 +0000200 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +0000201
Vladimir Medicfb8a2a92014-07-08 08:59:22 +0000202 bool hasMips1() const { return MipsArchVersion >= Mips1; }
Daniel Sandersd39320c2014-05-08 12:40:48 +0000203 bool hasMips2() const { return MipsArchVersion >= Mips2; }
Daniel Sandersf2056be2014-05-09 13:02:27 +0000204 bool hasMips3() const { return MipsArchVersion >= Mips3; }
Vladimir Medicfb8a2a92014-07-08 08:59:22 +0000205 bool hasMips4() const { return MipsArchVersion >= Mips4; }
206 bool hasMips5() const { return MipsArchVersion >= Mips5; }
Daniel Sanderse57d8662014-05-09 14:06:17 +0000207 bool hasMips4_32() const { return HasMips4_32; }
Daniel Sanders94eda2e2014-05-12 11:56:16 +0000208 bool hasMips4_32r2() const { return HasMips4_32r2; }
Daniel Sanders00463112014-06-16 13:18:59 +0000209 bool hasMips32() const {
Daniel Sanderse67d27f2015-02-04 15:18:11 +0000210 return (MipsArchVersion >= Mips32 && MipsArchVersion < Mips32Max) ||
211 hasMips64();
Daniel Sanders00463112014-06-16 13:18:59 +0000212 }
Daniel Sanders1f6f0f42014-06-12 11:55:58 +0000213 bool hasMips32r2() const {
Daniel Sanderse67d27f2015-02-04 15:18:11 +0000214 return (MipsArchVersion >= Mips32r2 && MipsArchVersion < Mips32Max) ||
215 hasMips64r2();
Daniel Sanders1f6f0f42014-06-12 11:55:58 +0000216 }
Daniel Sanders17793142015-02-18 16:24:50 +0000217 bool hasMips32r3() const {
218 return (MipsArchVersion >= Mips32r3 && MipsArchVersion < Mips32Max) ||
219 hasMips64r2();
220 }
221 bool hasMips32r5() const {
222 return (MipsArchVersion >= Mips32r5 && MipsArchVersion < Mips32Max) ||
Vasileios Kalintiris974d4092015-07-20 12:28:56 +0000223 hasMips64r5();
Daniel Sanders17793142015-02-18 16:24:50 +0000224 }
Daniel Sanders1f6f0f42014-06-12 11:55:58 +0000225 bool hasMips32r6() const {
Daniel Sanderse67d27f2015-02-04 15:18:11 +0000226 return (MipsArchVersion >= Mips32r6 && MipsArchVersion < Mips32Max) ||
227 hasMips64r6();
Daniel Sanders1f6f0f42014-06-12 11:55:58 +0000228 }
Akira Hatanaka6e506eb2011-09-21 02:24:25 +0000229 bool hasMips64() const { return MipsArchVersion >= Mips64; }
Daniel Sanderse67d27f2015-02-04 15:18:11 +0000230 bool hasMips64r2() const { return MipsArchVersion >= Mips64r2; }
Daniel Sanders17793142015-02-18 16:24:50 +0000231 bool hasMips64r3() const { return MipsArchVersion >= Mips64r3; }
232 bool hasMips64r5() const { return MipsArchVersion >= Mips64r5; }
Daniel Sanderse67d27f2015-02-04 15:18:11 +0000233 bool hasMips64r6() const { return MipsArchVersion >= Mips64r6; }
Bruno Cardoso Lopes326a0372008-06-04 01:45:25 +0000234
Kai Nacke93fe5e82014-03-20 11:51:58 +0000235 bool hasCnMips() const { return HasCnMips; }
236
Bruno Cardoso Lopes326a0372008-06-04 01:45:25 +0000237 bool isLittle() const { return IsLittle; }
Daniel Sandersfeb61302014-08-08 15:47:17 +0000238 bool isABICalls() const { return !NoABICalls; }
Zoran Jovanovic255d00d2014-07-10 15:36:12 +0000239 bool isFPXX() const { return IsFPXX; }
Douglas Gregor740ab382009-12-19 07:05:23 +0000240 bool isFP64bit() const { return IsFP64bit; }
Daniel Sanders7e527422014-07-10 13:38:23 +0000241 bool useOddSPReg() const { return UseOddSPReg; }
Sasa Stankovicf4a9e3b2014-07-29 14:39:24 +0000242 bool noOddSPReg() const { return !UseOddSPReg; }
Matheus Almeida0051f2d2014-04-16 15:48:55 +0000243 bool isNaN2008() const { return IsNaN2008bit; }
Douglas Gregor740ab382009-12-19 07:05:23 +0000244 bool isGP64bit() const { return IsGP64bit; }
245 bool isGP32bit() const { return !IsGP64bit; }
Daniel Sanders2b746bc2014-09-09 12:11:16 +0000246 unsigned getGPRSizeInBytes() const { return isGP64bit() ? 8 : 4; }
Simon Dardis4fbf76f2016-06-14 11:29:28 +0000247 bool isPTR64bit() const { return IsPTR64bit; }
248 bool isPTR32bit() const { return !IsPTR64bit; }
Simon Dardisca74dd72017-01-27 11:36:52 +0000249 bool hasSym32() const {
250 return (HasSym32 && isABI_N64()) || isABI_N32() || isABI_O32();
251 }
Douglas Gregor740ab382009-12-19 07:05:23 +0000252 bool isSingleFloat() const { return IsSingleFloat; }
Sagar Thakurec657922017-02-15 10:48:11 +0000253 bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
Douglas Gregor740ab382009-12-19 07:05:23 +0000254 bool hasVFPU() const { return HasVFPU; }
Eric Christopher4e7d1e72014-07-18 23:41:32 +0000255 bool inMips16Mode() const { return InMips16Mode; }
Reed Kotler783c7942013-05-10 22:25:39 +0000256 bool inMips16ModeDefault() const {
Reed Kotler1595f362013-04-09 19:46:01 +0000257 return InMips16Mode;
258 }
Eric Christopher7394e232014-07-18 00:08:50 +0000259 // Hard float for mips16 means essentially to compile as soft float
260 // but to use a runtime library for soft float that is written with
261 // native mips32 floating point instructions (those runtime routines
262 // run in mips32 hard float mode).
Reed Kotler783c7942013-05-10 22:25:39 +0000263 bool inMips16HardFloat() const {
264 return inMips16Mode() && InMips16HardFloat;
265 }
Jack Carter428a06c2013-02-05 09:30:03 +0000266 bool inMicroMipsMode() const { return InMicroMipsMode; }
Jozef Kolekc22555d2015-04-20 12:23:06 +0000267 bool inMicroMips32r6Mode() const { return InMicroMipsMode && hasMips32r6(); }
Akira Hatanaka65ce9312012-09-21 23:41:49 +0000268 bool hasDSP() const { return HasDSP; }
269 bool hasDSPR2() const { return HasDSPR2; }
Zoran Jovanovic2e386d32015-10-12 16:07:25 +0000270 bool hasDSPR3() const { return HasDSPR3; }
Jack Carter3a2c2d42013-08-13 20:54:07 +0000271 bool hasMSA() const { return HasMSA; }
Petar Jovanovic64fb7a82017-06-06 15:33:01 +0000272 bool disableMadd4() const { return DisableMadd4; }
Daniel Sanderse4e83a72015-09-15 10:02:16 +0000273 bool hasEVA() const { return HasEVA; }
Simon Dardisae719c52017-07-11 18:03:20 +0000274 bool hasMT() const { return HasMT; }
Akira Hatanakaad495022012-08-22 03:18:13 +0000275 bool useSmallSection() const { return UseSmallSection; }
Bruno Cardoso Lopesc9c3f492008-07-05 19:05:21 +0000276
Akira Hatanakacdf4fd82012-05-22 03:10:09 +0000277 bool hasStandardEncoding() const { return !inMips16Mode(); }
278
Eric Christopher54966eb2015-05-07 23:10:23 +0000279 bool useSoftFloat() const { return IsSoftFloat; }
Reed Kotlerc03807a2013-08-30 19:40:56 +0000280
Simon Atanasyanf217c7b2017-07-15 07:14:25 +0000281 bool useLongCalls() const { return UseLongCalls; }
282
Akira Hatanakaa8a05be2013-10-07 19:06:57 +0000283 bool enableLongBranchPass() const {
284 return hasStandardEncoding() || allowMixed16_32();
285 }
286
Bruno Cardoso Lopesf714e252008-07-30 17:01:06 +0000287 /// Features related to the presence of specific instructions.
Akira Hatanaka4a3836b2013-10-09 23:36:17 +0000288 bool hasExtractInsert() const { return !inMips16Mode() && hasMips32r2(); }
Sasa Stankovicb976fee2014-07-14 09:40:29 +0000289 bool hasMTHC1() const { return hasMips32r2(); }
Jack Carterc1b17ed2013-01-18 21:20:38 +0000290
Reed Kotler783c7942013-05-10 22:25:39 +0000291 bool allowMixed16_32() const { return inMips16ModeDefault() |
Toma Tabacuf4762002015-01-16 10:45:15 +0000292 AllowMixed16_32; }
Reed Kotler1595f362013-04-09 19:46:01 +0000293
Toma Tabacuf4762002015-01-16 10:45:15 +0000294 bool os16() const { return Os16; }
Reed Kotlerfe94cc32013-04-10 16:58:04 +0000295
Petar Jovanovic97250162014-02-05 17:19:30 +0000296 bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
297
Sagar Thakurec657922017-02-15 10:48:11 +0000298 bool isXRaySupported() const override { return true; }
299
Daniel Sanders82cd99a2014-04-16 14:38:27 +0000300 // for now constant islands are on for the whole compilation unit but we only
301 // really use them if in addition we are in mips16 mode
302 static bool useConstantIslands();
Akira Hatanaka6b2d8412013-10-29 19:29:03 +0000303
John Baldwin1255b162017-08-14 21:49:38 +0000304 unsigned getStackAlignment() const { return stackAlignment; }
Akira Hatanaka6b2d8412013-10-29 19:29:03 +0000305
Jack Carter7f378102013-01-30 02:16:36 +0000306 // Grab relocation model
Eric Christopherf74faf42014-07-18 22:34:20 +0000307 Reloc::Model getRelocationModel() const;
Reed Kotler1595f362013-04-09 19:46:01 +0000308
Eric Christopherdaa9dbb2014-07-03 00:10:24 +0000309 MipsSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS,
Eric Christopher90724282015-01-08 18:18:57 +0000310 const TargetMachine &TM);
Eric Christopher5b336a22014-07-02 01:14:43 +0000311
Daniel Sandersac272632014-05-23 13:18:02 +0000312 /// Does the system support unaligned memory access.
313 ///
314 /// MIPS32r6/MIPS64r6 require full unaligned access support but does not
315 /// specify which component of the system provides it. Hardware, software, and
316 /// hybrid implementations are all valid.
317 bool systemSupportsUnalignedAccess() const { return hasMips32r6(); }
Eric Christopher1f51ddd2014-07-02 00:54:12 +0000318
Eric Christopherdaa9dbb2014-07-03 00:10:24 +0000319 // Set helper classes
320 void setHelperClassesMips16();
321 void setHelperClassesMipsSE();
322
Benjamin Kramerf9172fd42016-01-27 16:32:26 +0000323 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
Eric Christopherd9134482014-08-04 21:25:23 +0000324 return &TSInfo;
325 }
Eric Christopherd9134482014-08-04 21:25:23 +0000326 const MipsInstrInfo *getInstrInfo() const override { return InstrInfo.get(); }
327 const TargetFrameLowering *getFrameLowering() const override {
Eric Christopherdaa9dbb2014-07-03 00:10:24 +0000328 return FrameLowering.get();
329 }
Eric Christopherd9134482014-08-04 21:25:23 +0000330 const MipsRegisterInfo *getRegisterInfo() const override {
Eric Christopherdaa9dbb2014-07-03 00:10:24 +0000331 return &InstrInfo->getRegisterInfo();
332 }
Eric Christopherd9134482014-08-04 21:25:23 +0000333 const MipsTargetLowering *getTargetLowering() const override {
334 return TLInfo.get();
335 }
336 const InstrItineraryData *getInstrItineraryData() const override {
337 return &InstrItins;
338 }
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +0000339};
Alexander Kornienkof00654e2015-06-23 09:49:53 +0000340} // End llvm namespace
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +0000341
342#endif