2012-02-28 15:46:26 +08:00
|
|
|
//===-- Mips.td - Describe the Mips Target Machine ---------*- tablegen -*-===//
|
2007-06-06 15:42:06 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2007-06-06 15:42:06 +08:00
|
|
|
//
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-08-18 10:18:07 +08:00
|
|
|
// This is the top level entry point for the Mips target.
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-08-18 10:18:07 +08:00
|
|
|
// Target-independent interfaces
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
|
2008-11-24 15:34:46 +08:00
|
|
|
include "llvm/Target/Target.td"
|
2007-06-06 15:42:06 +08:00
|
|
|
|
2014-05-07 18:27:09 +08:00
|
|
|
// The overall idea of the PredicateControl class is to chop the Predicates list
|
|
|
|
// into subsets that are usually overridden independently. This allows
|
|
|
|
// subclasses to partially override the predicates of their superclasses without
|
|
|
|
// having to re-add all the existing predicates.
|
|
|
|
class PredicateControl {
|
|
|
|
// Predicates for the encoding scheme in use such as HasStdEnc
|
|
|
|
list<Predicate> EncodingPredicates = [];
|
2014-05-07 20:48:37 +08:00
|
|
|
// Predicates for the GPR size such as IsGP64bit
|
|
|
|
list<Predicate> GPRPredicates = [];
|
2016-06-14 19:29:28 +08:00
|
|
|
// Predicates for the PTR size such as IsPTR64bit
|
|
|
|
list<Predicate> PTRPredicates = [];
|
[mips] Fix 64-bit address loading in case of applying 32-bit mask to the result
If result of 64-bit address loading combines with 32-bit mask, LLVM
tries to optimize the code and remove "redundant" loading of upper
32-bits of the address. It leads to incorrect code on MIPS64 targets.
MIPS backend creates the following chain of commands to load 64-bit
address in the `MipsTargetLowering::getAddrNonPICSym64` method:
```
(add (shl (add (shl (add %highest(sym), %higher(sym)),
16),
%hi(sym)),
16),
%lo(%sym))
```
If the mask presents, LLVM decides to optimize the chain of commands. It
really does not make sense to load upper 32-bits because the 0x0fffffff
mask anyway clears them. After removing redundant commands we get this
chain:
```
(add (shl (%hi(sym), 16), %lo(%sym))
```
There is no patterns matched `(MipsHi (i64 symbol))`. Due a bug in `SYM_32`
predicate definition, backend incorrectly selects a pattern for a 32-bit
symbols and uses the `lui` instruction for loading `%hi(sym)`.
As a result we get incorrect set of instructions with unnecessary 16-bit
left shifting:
```
lui at,0x0
R_MIPS_HI16 foo
dsll at,at,0x10
daddiu at,at,0
R_MIPS_LO16 foo
```
This patch resolves two problems:
- Fix `SYM_32/SYM_64` predicates to prevent selection of patterns dedicated
to 32-bit symbols in case of using N64 ABI.
- Add missed patterns for 64-bit symbols for `%hi/%lo`.
Fix PR42736.
Differential Revision: https://reviews.llvm.org/D66228
llvm-svn: 370268
2019-08-29 06:32:10 +08:00
|
|
|
// Predicates for a symbol's size such as hasSym32.
|
|
|
|
list<Predicate> SYMPredicates = [];
|
2014-05-07 20:48:37 +08:00
|
|
|
// Predicates for the FGR size and layout such as IsFP64bit
|
|
|
|
list<Predicate> FGRPredicates = [];
|
2018-03-12 21:16:12 +08:00
|
|
|
// Predicates for the instruction group membership such as ISA's.
|
2014-05-07 21:57:22 +08:00
|
|
|
list<Predicate> InsnPredicates = [];
|
2018-03-12 21:16:12 +08:00
|
|
|
// Predicate for the ASE that an instruction belongs to.
|
|
|
|
list<Predicate> ASEPredicate = [];
|
2015-05-07 18:29:52 +08:00
|
|
|
// Predicate for marking the instruction as usable in hard-float mode only.
|
|
|
|
list<Predicate> HardFloatPredicate = [];
|
2014-05-07 18:27:09 +08:00
|
|
|
// Predicates for anything else
|
|
|
|
list<Predicate> AdditionalPredicates = [];
|
|
|
|
list<Predicate> Predicates = !listconcat(EncodingPredicates,
|
2014-05-07 20:48:37 +08:00
|
|
|
GPRPredicates,
|
2016-06-14 19:29:28 +08:00
|
|
|
PTRPredicates,
|
[mips] Fix 64-bit address loading in case of applying 32-bit mask to the result
If result of 64-bit address loading combines with 32-bit mask, LLVM
tries to optimize the code and remove "redundant" loading of upper
32-bits of the address. It leads to incorrect code on MIPS64 targets.
MIPS backend creates the following chain of commands to load 64-bit
address in the `MipsTargetLowering::getAddrNonPICSym64` method:
```
(add (shl (add (shl (add %highest(sym), %higher(sym)),
16),
%hi(sym)),
16),
%lo(%sym))
```
If the mask presents, LLVM decides to optimize the chain of commands. It
really does not make sense to load upper 32-bits because the 0x0fffffff
mask anyway clears them. After removing redundant commands we get this
chain:
```
(add (shl (%hi(sym), 16), %lo(%sym))
```
There is no patterns matched `(MipsHi (i64 symbol))`. Due a bug in `SYM_32`
predicate definition, backend incorrectly selects a pattern for a 32-bit
symbols and uses the `lui` instruction for loading `%hi(sym)`.
As a result we get incorrect set of instructions with unnecessary 16-bit
left shifting:
```
lui at,0x0
R_MIPS_HI16 foo
dsll at,at,0x10
daddiu at,at,0
R_MIPS_LO16 foo
```
This patch resolves two problems:
- Fix `SYM_32/SYM_64` predicates to prevent selection of patterns dedicated
to 32-bit symbols in case of using N64 ABI.
- Add missed patterns for 64-bit symbols for `%hi/%lo`.
Fix PR42736.
Differential Revision: https://reviews.llvm.org/D66228
llvm-svn: 370268
2019-08-29 06:32:10 +08:00
|
|
|
SYMPredicates,
|
2014-05-07 20:48:37 +08:00
|
|
|
FGRPredicates,
|
2014-05-07 21:57:22 +08:00
|
|
|
InsnPredicates,
|
2015-05-07 18:29:52 +08:00
|
|
|
HardFloatPredicate,
|
2018-03-12 21:16:12 +08:00
|
|
|
ASEPredicate,
|
2014-05-07 18:27:09 +08:00
|
|
|
AdditionalPredicates);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Like Requires<> but for the AdditionalPredicates list
|
|
|
|
class AdditionalRequires<list<Predicate> preds> {
|
|
|
|
list<Predicate> AdditionalPredicates = preds;
|
|
|
|
}
|
|
|
|
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
Several changes to Mips backend, experimental fp support being the most
important.
- Cleanup in the Subtarget info with addition of new features, not all support
yet, but they allow the future inclusion of features easier. Among new features,
we have : Arch family info (mips1, mips2, ...), ABI info (o32, eabi), 64-bit
integer
and float registers, allegrex vector FPU (VFPU), single float only support.
- TargetMachine now detects allegrex core.
- Added allegrex (Mips32r2) sext_inreg instructions.
- *Added Float Point Instructions*, handling single float only, and
aliased accesses for 32-bit FPUs.
- Some cleanup in FP instruction formats and FP register classes.
- Calling conventions improved to support mips 32-bit EABI.
- Added Asm Printer support for fp cond codes.
- Added support for sret copy to a return register.
- EABI support added into LowerCALL and FORMAL_ARGS.
- MipsFunctionInfo now keeps a virtual register per function to track the
sret on function entry until function ret.
- MipsInstrInfo FP support into methods (isMoveInstr, isLoadFromStackSlot, ...),
FP cond codes mapping and initial FP Branch Analysis.
- Two new Mips SDNode to handle fp branch and compare instructions : FPBrcond,
FPCmp
- MipsTargetLowering : handling different FP classes, Allegrex support, sret
return copy, no homing location within EABI, non 32-bit stack objects
arguments, and asm constraint for float.
llvm-svn: 53146
2008-07-06 03:05:21 +08:00
|
|
|
// Register File, Calling Conv, Instruction Descriptions
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
|
|
|
|
include "MipsRegisterInfo.td"
|
2007-08-18 10:18:07 +08:00
|
|
|
include "MipsSchedule.td"
|
2007-06-06 15:42:06 +08:00
|
|
|
include "MipsInstrInfo.td"
|
2007-08-18 10:18:07 +08:00
|
|
|
include "MipsCallingConv.td"
|
2018-04-11 23:12:32 +08:00
|
|
|
include "MipsRegisterBanks.td"
|
2007-06-06 15:42:06 +08:00
|
|
|
|
2016-08-02 18:32:00 +08:00
|
|
|
// Avoid forward declaration issues.
|
|
|
|
include "MipsScheduleP5600.td"
|
2016-09-01 22:53:53 +08:00
|
|
|
include "MipsScheduleGeneric.td"
|
2016-08-02 18:32:00 +08:00
|
|
|
|
2010-04-05 11:10:20 +08:00
|
|
|
def MipsInstrInfo : InstrInfo;
|
2007-08-18 10:18:07 +08:00
|
|
|
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Mips Subtarget features //
|
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
|
2014-08-08 23:47:17 +08:00
|
|
|
def FeatureNoABICalls : SubtargetFeature<"noabicalls", "NoABICalls", "true",
|
2015-02-27 18:44:02 +08:00
|
|
|
"Disable SVR4-style position-independent code">;
|
2016-06-14 19:29:28 +08:00
|
|
|
def FeaturePTR64Bit : SubtargetFeature<"ptr64", "IsPTR64bit", "true",
|
|
|
|
"Pointers are 64-bit wide">;
|
2008-07-09 13:32:22 +08:00
|
|
|
def FeatureGP64Bit : SubtargetFeature<"gp64", "IsGP64bit", "true",
|
2015-02-27 18:44:02 +08:00
|
|
|
"General Purpose Registers are 64-bit wide">;
|
2008-07-09 13:32:22 +08:00
|
|
|
def FeatureFP64Bit : SubtargetFeature<"fp64", "IsFP64bit", "true",
|
2015-02-27 18:44:02 +08:00
|
|
|
"Support 64-bit FP registers">;
|
2014-07-10 23:36:12 +08:00
|
|
|
def FeatureFPXX : SubtargetFeature<"fpxx", "IsFPXX", "true",
|
2015-02-27 18:44:02 +08:00
|
|
|
"Support for FPXX">;
|
2014-04-16 23:48:55 +08:00
|
|
|
def FeatureNaN2008 : SubtargetFeature<"nan2008", "IsNaN2008bit", "true",
|
2015-02-27 18:44:02 +08:00
|
|
|
"IEEE 754-2008 NaN encoding">;
|
2019-01-28 22:59:30 +08:00
|
|
|
def FeatureAbs2008 : SubtargetFeature<"abs2008", "Abs2008", "true",
|
|
|
|
"Disable IEEE 754-2008 abs.fmt mode">;
|
2008-07-09 13:32:22 +08:00
|
|
|
def FeatureSingleFloat : SubtargetFeature<"single-float", "IsSingleFloat",
|
2011-04-16 05:51:11 +08:00
|
|
|
"true", "Only supports single precision float">;
|
2015-05-07 18:29:52 +08:00
|
|
|
def FeatureSoftFloat : SubtargetFeature<"soft-float", "IsSoftFloat", "true",
|
|
|
|
"Does not support floating point instructions">;
|
2014-07-10 21:38:23 +08:00
|
|
|
def FeatureNoOddSPReg : SubtargetFeature<"nooddspreg", "UseOddSPReg", "false",
|
|
|
|
"Disable odd numbered single-precision "
|
|
|
|
"registers">;
|
2010-11-09 05:42:32 +08:00
|
|
|
def FeatureVFPU : SubtargetFeature<"vfpu", "HasVFPU",
|
2015-02-27 18:44:02 +08:00
|
|
|
"true", "Enable vector FPU instructions">;
|
2014-05-08 00:25:22 +08:00
|
|
|
def FeatureMips1 : SubtargetFeature<"mips1", "MipsArchVersion", "Mips1",
|
|
|
|
"Mips I ISA Support [highly experimental]">;
|
|
|
|
def FeatureMips2 : SubtargetFeature<"mips2", "MipsArchVersion", "Mips2",
|
|
|
|
"Mips II ISA Support [highly experimental]",
|
|
|
|
[FeatureMips1]>;
|
2014-05-09 21:02:27 +08:00
|
|
|
def FeatureMips3_32 : SubtargetFeature<"mips3_32", "HasMips3_32", "true",
|
|
|
|
"Subset of MIPS-III that is also in MIPS32 "
|
|
|
|
"[highly experimental]">;
|
2014-05-13 19:45:36 +08:00
|
|
|
def FeatureMips3_32r2 : SubtargetFeature<"mips3_32r2", "HasMips3_32r2", "true",
|
|
|
|
"Subset of MIPS-III that is also in MIPS32r2 "
|
|
|
|
"[highly experimental]">;
|
2014-05-09 21:02:27 +08:00
|
|
|
def FeatureMips3 : SubtargetFeature<"mips3", "MipsArchVersion", "Mips3",
|
|
|
|
"MIPS III ISA Support [highly experimental]",
|
|
|
|
[FeatureMips2, FeatureMips3_32,
|
2014-05-13 19:45:36 +08:00
|
|
|
FeatureMips3_32r2, FeatureGP64Bit,
|
|
|
|
FeatureFP64Bit]>;
|
2014-05-09 22:06:17 +08:00
|
|
|
def FeatureMips4_32 : SubtargetFeature<"mips4_32", "HasMips4_32", "true",
|
|
|
|
"Subset of MIPS-IV that is also in MIPS32 "
|
|
|
|
"[highly experimental]">;
|
2014-05-12 19:56:16 +08:00
|
|
|
def FeatureMips4_32r2 : SubtargetFeature<"mips4_32r2", "HasMips4_32r2", "true",
|
|
|
|
"Subset of MIPS-IV that is also in MIPS32r2 "
|
|
|
|
"[highly experimental]">;
|
2014-05-09 21:02:27 +08:00
|
|
|
def FeatureMips4 : SubtargetFeature<"mips4", "MipsArchVersion",
|
|
|
|
"Mips4", "MIPS IV ISA Support",
|
2014-05-09 22:06:17 +08:00
|
|
|
[FeatureMips3, FeatureMips4_32,
|
2014-05-12 19:56:16 +08:00
|
|
|
FeatureMips4_32r2]>;
|
2014-05-12 20:52:44 +08:00
|
|
|
def FeatureMips5_32r2 : SubtargetFeature<"mips5_32r2", "HasMips5_32r2", "true",
|
|
|
|
"Subset of MIPS-V that is also in MIPS32r2 "
|
|
|
|
"[highly experimental]">;
|
2014-05-09 21:02:27 +08:00
|
|
|
def FeatureMips5 : SubtargetFeature<"mips5", "MipsArchVersion", "Mips5",
|
|
|
|
"MIPS V ISA Support [highly experimental]",
|
2014-05-12 20:52:44 +08:00
|
|
|
[FeatureMips4, FeatureMips5_32r2]>;
|
2011-04-16 05:51:11 +08:00
|
|
|
def FeatureMips32 : SubtargetFeature<"mips32", "MipsArchVersion", "Mips32",
|
|
|
|
"Mips32 ISA Support",
|
2014-05-09 21:02:27 +08:00
|
|
|
[FeatureMips2, FeatureMips3_32,
|
2014-05-12 20:41:59 +08:00
|
|
|
FeatureMips4_32]>;
|
2010-11-09 05:42:32 +08:00
|
|
|
def FeatureMips32r2 : SubtargetFeature<"mips32r2", "MipsArchVersion",
|
|
|
|
"Mips32r2", "Mips32r2 ISA Support",
|
2014-05-13 19:45:36 +08:00
|
|
|
[FeatureMips3_32r2, FeatureMips4_32r2,
|
|
|
|
FeatureMips5_32r2, FeatureMips32]>;
|
2015-02-19 00:24:50 +08:00
|
|
|
def FeatureMips32r3 : SubtargetFeature<"mips32r3", "MipsArchVersion",
|
|
|
|
"Mips32r3", "Mips32r3 ISA Support",
|
|
|
|
[FeatureMips32r2]>;
|
|
|
|
def FeatureMips32r5 : SubtargetFeature<"mips32r5", "MipsArchVersion",
|
|
|
|
"Mips32r5", "Mips32r5 ISA Support",
|
|
|
|
[FeatureMips32r3]>;
|
2014-05-09 17:46:21 +08:00
|
|
|
def FeatureMips32r6 : SubtargetFeature<"mips32r6", "MipsArchVersion",
|
|
|
|
"Mips32r6",
|
|
|
|
"Mips32r6 ISA Support [experimental]",
|
2015-02-19 00:24:50 +08:00
|
|
|
[FeatureMips32r5, FeatureFP64Bit,
|
2019-01-28 22:59:30 +08:00
|
|
|
FeatureNaN2008, FeatureAbs2008]>;
|
2011-09-21 04:28:08 +08:00
|
|
|
def FeatureMips64 : SubtargetFeature<"mips64", "MipsArchVersion",
|
|
|
|
"Mips64", "Mips64 ISA Support",
|
2014-05-12 19:56:16 +08:00
|
|
|
[FeatureMips5, FeatureMips32]>;
|
2011-09-21 04:28:08 +08:00
|
|
|
def FeatureMips64r2 : SubtargetFeature<"mips64r2", "MipsArchVersion",
|
|
|
|
"Mips64r2", "Mips64r2 ISA Support",
|
|
|
|
[FeatureMips64, FeatureMips32r2]>;
|
2015-02-19 00:24:50 +08:00
|
|
|
def FeatureMips64r3 : SubtargetFeature<"mips64r3", "MipsArchVersion",
|
|
|
|
"Mips64r3", "Mips64r3 ISA Support",
|
|
|
|
[FeatureMips64r2, FeatureMips32r3]>;
|
|
|
|
def FeatureMips64r5 : SubtargetFeature<"mips64r5", "MipsArchVersion",
|
|
|
|
"Mips64r5", "Mips64r5 ISA Support",
|
|
|
|
[FeatureMips64r3, FeatureMips32r5]>;
|
2014-05-09 17:46:21 +08:00
|
|
|
def FeatureMips64r6 : SubtargetFeature<"mips64r6", "MipsArchVersion",
|
|
|
|
"Mips64r6",
|
|
|
|
"Mips64r6 ISA Support [experimental]",
|
2015-02-19 00:24:50 +08:00
|
|
|
[FeatureMips32r6, FeatureMips64r5,
|
2019-01-28 22:59:30 +08:00
|
|
|
FeatureNaN2008, FeatureAbs2008]>;
|
2017-01-27 19:36:52 +08:00
|
|
|
def FeatureSym32 : SubtargetFeature<"sym32", "HasSym32", "true",
|
|
|
|
"Symbols are 32 bit on Mips64">;
|
2007-06-06 15:42:06 +08:00
|
|
|
|
2012-05-17 06:19:56 +08:00
|
|
|
def FeatureMips16 : SubtargetFeature<"mips16", "InMips16Mode", "true",
|
|
|
|
"Mips16 mode">;
|
|
|
|
|
2012-09-22 07:41:49 +08:00
|
|
|
def FeatureDSP : SubtargetFeature<"dsp", "HasDSP", "true", "Mips DSP ASE">;
|
|
|
|
def FeatureDSPR2 : SubtargetFeature<"dspr2", "HasDSPR2", "true",
|
|
|
|
"Mips DSP-R2 ASE", [FeatureDSP]>;
|
2015-10-13 00:07:25 +08:00
|
|
|
def FeatureDSPR3
|
|
|
|
: SubtargetFeature<"dspr3", "HasDSPR3", "true", "Mips DSP-R3 ASE",
|
|
|
|
[ FeatureDSP, FeatureDSPR2 ]>;
|
2012-09-22 07:41:49 +08:00
|
|
|
|
2013-08-14 04:54:07 +08:00
|
|
|
def FeatureMSA : SubtargetFeature<"msa", "HasMSA", "true", "Mips MSA ASE">;
|
|
|
|
|
[mips] Added support for various EVA ASE instructions.
Summary:
Added support for the following instructions:
CACHEE, LBE, LBUE, LHE, LHUE, LWE, LLE, LWLE, LWRE, PREFE,
SBE, SHE, SWE, SCE, SWLE, SWRE, TLBINV, TLBINVF
This required adding some infrastructure for the EVA ASE.
Patch by Scott Egerton.
Reviewers: vkalintiris, dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11139
llvm-svn: 247669
2015-09-15 18:02:16 +08:00
|
|
|
def FeatureEVA : SubtargetFeature<"eva", "HasEVA", "true", "Mips EVA ASE">;
|
|
|
|
|
[mips] Add support for CRC ASE
This includes
Instructions: crc32b, crc32h, crc32w, crc32d,
crc32cb, crc32ch, crc32cw, crc32cd
Assembler directives: .set crc, .set nocrc, .module crc, .module nocrc
Attribute: crc
.MIPS.abiflags: CRC (0x8000)
Patch by Vladimir Stefanovic.
Differential Revision: https://reviews.llvm.org/D44176
llvm-svn: 327511
2018-03-14 22:13:31 +08:00
|
|
|
def FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true", "Mips R6 CRC ASE">;
|
|
|
|
|
[mips] Add support for Virtualization ASE
This includes
Instructions: tlbginv, tlbginvf, tlbgp, tlbgr, tlbgwi, tlbgwr, hypcall
mfgc0, mtgc0, mfhgc0, mthgc0, dmfgc0, dmtgc0,
Assembler directives: .set virt, .set novirt, .module virt, .module novirt
Attribute: virt
.MIPS.abiflags: VZ (0x100)
Patch by Vladimir Stefanovic.
Differential Revision: https://reviews.llvm.org/D44905
llvm-svn: 331024
2018-04-27 17:12:08 +08:00
|
|
|
def FeatureVirt : SubtargetFeature<"virt", "HasVirt", "true",
|
|
|
|
"Mips Virtualization ASE">;
|
|
|
|
|
2018-05-18 00:30:32 +08:00
|
|
|
def FeatureGINV : SubtargetFeature<"ginv", "HasGINV", "true",
|
|
|
|
"Mips Global Invalidate ASE">;
|
|
|
|
|
2013-02-05 17:30:03 +08:00
|
|
|
def FeatureMicroMips : SubtargetFeature<"micromips", "InMicroMipsMode", "true",
|
|
|
|
"microMips mode">;
|
|
|
|
|
2014-03-20 19:51:58 +08:00
|
|
|
def FeatureCnMips : SubtargetFeature<"cnmips", "HasCnMips",
|
|
|
|
"true", "Octeon cnMIPS Support",
|
|
|
|
[FeatureMips64r2]>;
|
|
|
|
|
2015-09-03 20:31:22 +08:00
|
|
|
def FeatureUseTCCInDIV : SubtargetFeature<
|
|
|
|
"use-tcc-in-div",
|
|
|
|
"UseTCCInDIV", "false",
|
|
|
|
"Force the assembler to use trapping">;
|
|
|
|
|
2017-06-06 23:33:01 +08:00
|
|
|
def FeatureMadd4 : SubtargetFeature<"nomadd4", "DisableMadd4", "true",
|
|
|
|
"Disable 4-operand madd.fmt and related instructions">;
|
|
|
|
|
2017-07-12 02:03:20 +08:00
|
|
|
def FeatureMT : SubtargetFeature<"mt", "HasMT", "true", "Mips MT ASE">;
|
|
|
|
|
2017-07-15 15:14:25 +08:00
|
|
|
def FeatureLongCalls : SubtargetFeature<"long-calls", "UseLongCalls", "true",
|
|
|
|
"Disable use of the jal instruction">;
|
|
|
|
|
2019-09-18 20:24:57 +08:00
|
|
|
def FeatureXGOT
|
|
|
|
: SubtargetFeature<"xgot", "UseXGOT", "true", "Assume 32-bit GOT">;
|
|
|
|
|
2018-02-21 08:06:53 +08:00
|
|
|
def FeatureUseIndirectJumpsHazard : SubtargetFeature<"use-indirect-jump-hazard",
|
|
|
|
"UseIndirectJumpsHazard",
|
|
|
|
"true", "Use indirect jump"
|
|
|
|
" guards to prevent certain speculation based attacks">;
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
// Mips processors supported.
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
|
2015-09-29 02:24:08 +08:00
|
|
|
def ImplP5600 : SubtargetFeature<"p5600", "ProcImpl",
|
|
|
|
"MipsSubtarget::CPU::P5600",
|
|
|
|
"The P5600 Processor", [FeatureMips32r5]>;
|
|
|
|
|
Several changes to Mips backend, experimental fp support being the most
important.
- Cleanup in the Subtarget info with addition of new features, not all support
yet, but they allow the future inclusion of features easier. Among new features,
we have : Arch family info (mips1, mips2, ...), ABI info (o32, eabi), 64-bit
integer
and float registers, allegrex vector FPU (VFPU), single float only support.
- TargetMachine now detects allegrex core.
- Added allegrex (Mips32r2) sext_inreg instructions.
- *Added Float Point Instructions*, handling single float only, and
aliased accesses for 32-bit FPUs.
- Some cleanup in FP instruction formats and FP register classes.
- Calling conventions improved to support mips 32-bit EABI.
- Added Asm Printer support for fp cond codes.
- Added support for sret copy to a return register.
- EABI support added into LowerCALL and FORMAL_ARGS.
- MipsFunctionInfo now keeps a virtual register per function to track the
sret on function entry until function ret.
- MipsInstrInfo FP support into methods (isMoveInstr, isLoadFromStackSlot, ...),
FP cond codes mapping and initial FP Branch Analysis.
- Two new Mips SDNode to handle fp branch and compare instructions : FPBrcond,
FPCmp
- MipsTargetLowering : handling different FP classes, Allegrex support, sret
return copy, no homing location within EABI, non 32-bit stack objects
arguments, and asm constraint for float.
llvm-svn: 53146
2008-07-06 03:05:21 +08:00
|
|
|
class Proc<string Name, list<SubtargetFeature> Features>
|
2016-09-01 22:53:53 +08:00
|
|
|
: ProcessorModel<Name, MipsGenericModel, Features>;
|
Several changes to Mips backend, experimental fp support being the most
important.
- Cleanup in the Subtarget info with addition of new features, not all support
yet, but they allow the future inclusion of features easier. Among new features,
we have : Arch family info (mips1, mips2, ...), ABI info (o32, eabi), 64-bit
integer
and float registers, allegrex vector FPU (VFPU), single float only support.
- TargetMachine now detects allegrex core.
- Added allegrex (Mips32r2) sext_inreg instructions.
- *Added Float Point Instructions*, handling single float only, and
aliased accesses for 32-bit FPUs.
- Some cleanup in FP instruction formats and FP register classes.
- Calling conventions improved to support mips 32-bit EABI.
- Added Asm Printer support for fp cond codes.
- Added support for sret copy to a return register.
- EABI support added into LowerCALL and FORMAL_ARGS.
- MipsFunctionInfo now keeps a virtual register per function to track the
sret on function entry until function ret.
- MipsInstrInfo FP support into methods (isMoveInstr, isLoadFromStackSlot, ...),
FP cond codes mapping and initial FP Branch Analysis.
- Two new Mips SDNode to handle fp branch and compare instructions : FPBrcond,
FPCmp
- MipsTargetLowering : handling different FP classes, Allegrex support, sret
return copy, no homing location within EABI, non 32-bit stack objects
arguments, and asm constraint for float.
llvm-svn: 53146
2008-07-06 03:05:21 +08:00
|
|
|
|
2015-01-27 01:33:46 +08:00
|
|
|
def : Proc<"mips1", [FeatureMips1]>;
|
|
|
|
def : Proc<"mips2", [FeatureMips2]>;
|
|
|
|
def : Proc<"mips32", [FeatureMips32]>;
|
|
|
|
def : Proc<"mips32r2", [FeatureMips32r2]>;
|
2015-02-19 00:24:50 +08:00
|
|
|
def : Proc<"mips32r3", [FeatureMips32r3]>;
|
|
|
|
def : Proc<"mips32r5", [FeatureMips32r5]>;
|
2015-01-27 01:33:46 +08:00
|
|
|
def : Proc<"mips32r6", [FeatureMips32r6]>;
|
|
|
|
|
|
|
|
def : Proc<"mips3", [FeatureMips3]>;
|
|
|
|
def : Proc<"mips4", [FeatureMips4]>;
|
|
|
|
def : Proc<"mips5", [FeatureMips5]>;
|
|
|
|
def : Proc<"mips64", [FeatureMips64]>;
|
|
|
|
def : Proc<"mips64r2", [FeatureMips64r2]>;
|
2015-02-19 00:24:50 +08:00
|
|
|
def : Proc<"mips64r3", [FeatureMips64r3]>;
|
|
|
|
def : Proc<"mips64r5", [FeatureMips64r5]>;
|
2015-01-27 01:33:46 +08:00
|
|
|
def : Proc<"mips64r6", [FeatureMips64r6]>;
|
|
|
|
def : Proc<"octeon", [FeatureMips64r2, FeatureCnMips]>;
|
2015-09-29 02:24:08 +08:00
|
|
|
def : ProcessorModel<"p5600", MipsP5600Model, [ImplP5600]>;
|
2010-11-09 05:42:32 +08:00
|
|
|
|
2012-08-18 04:16:42 +08:00
|
|
|
def MipsAsmParser : AsmParser {
|
|
|
|
let ShouldEmitMatchRegisterName = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
def MipsAsmParserVariant : AsmParserVariant {
|
|
|
|
int Variant = 0;
|
|
|
|
|
|
|
|
// Recognize hard coded registers.
|
|
|
|
string RegisterPrefix = "$";
|
|
|
|
}
|
|
|
|
|
2007-06-06 15:42:06 +08:00
|
|
|
def Mips : Target {
|
|
|
|
let InstructionSet = MipsInstrInfo;
|
2012-08-18 04:16:42 +08:00
|
|
|
let AssemblyParsers = [MipsAsmParser];
|
|
|
|
let AssemblyParserVariants = [MipsAsmParserVariant];
|
[MachineOperand][Target] MachineOperand::isRenamable semantics changes
Summary:
Add a target option AllowRegisterRenaming that is used to opt in to
post-register-allocation renaming of registers. This is set to 0 by
default, which causes the hasExtraSrcRegAllocReq/hasExtraDstRegAllocReq
fields of all opcodes to be set to 1, causing
MachineOperand::isRenamable to always return false.
Set the AllowRegisterRenaming flag to 1 for all in-tree targets that
have lit tests that were effected by enabling COPY forwarding in
MachineCopyPropagation (AArch64, AMDGPU, ARM, Hexagon, Mips, PowerPC,
RISCV, Sparc, SystemZ and X86).
Add some more comments describing the semantics of the
MachineOperand::isRenamable function and how it is set and maintained.
Change isRenamable to check the operand's opcode
hasExtraSrcRegAllocReq/hasExtraDstRegAllocReq bit directly instead of
relying on it being consistently reflected in the IsRenamable bit
setting.
Clear the IsRenamable bit when changing an operand's register value.
Remove target code that was clearing the IsRenamable bit when changing
registers/opcodes now that this is done conservatively by default.
Change setting of hasExtraSrcRegAllocReq in AMDGPU target to be done in
one place covering all opcodes that have constant pipe read limit
restrictions.
Reviewers: qcolombet, MatzeB
Subscribers: aemerson, arsenm, jyknight, mcrosier, sdardis, nhaehnle, javed.absar, tpr, arichardson, kristof.beyls, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, jordy.potman.lists, apazos, sabuasal, niosHD, escha, nemanjai, llvm-commits
Differential Revision: https://reviews.llvm.org/D43042
llvm-svn: 325931
2018-02-24 02:25:08 +08:00
|
|
|
let AllowRegisterRenaming = 1;
|
2007-06-06 15:42:06 +08:00
|
|
|
}
|