llvm.org GIT mirror llvm / f025ca3
[ARM] Add subtarget features for ARMv8.2-A This adds subtarget features for ARMv8.2-A, which builds on (and requires the features from) ARMv8.1-A. Most assembler-visible features of ARMv8.2-A are system instructions, and are all required parts of the architecture, so just depend on the HasV8_2aOps subtarget feature. There is also one large, optional feature, which adds 16-bit floating point versions of all existing floating-point instructions (VFP and SIMD), this is represented by the FeatureFullFP16 subtarget feature. Differential Revision: http://reviews.llvm.org/D15036 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254399 91177308-0d34-0410-b5e6-96231b3b80d8 Oliver Stannard 3 years ago
4 changed file(s) with 20 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
6161 def FeatureFPARMv8 : SubtargetFeature<"fp-armv8", "HasFPARMv8",
6262 "true", "Enable ARMv8 FP",
6363 [FeatureVFP4]>;
64 def FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true",
65 "Enable full half-precision floating point",
66 [FeatureFPARMv8]>;
6467 def FeatureD16 : SubtargetFeature<"d16", "HasD16", "true",
6568 "Restrict FP to 16 double registers">;
6669 def FeatureHWDiv : SubtargetFeature<"hwdiv", "HasHardwareDivide", "true",
211214 def HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
212215 "Support ARM v8.1a instructions",
213216 [HasV8Ops]>;
217 def HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
218 "Support ARM v8.2a instructions",
219 [HasV8_1aOps]>;
214220
215221
216222 //===----------------------------------------------------------------------===//
214214 AssemblerPredicate<"!HasV8Ops", "armv7 or earlier">;
215215 def HasV8_1a : Predicate<"Subtarget->hasV8_1aOps()">,
216216 AssemblerPredicate<"HasV8_1aOps", "armv8.1a">;
217 def HasV8_2a : Predicate<"Subtarget->hasV8_2aOps()">,
218 AssemblerPredicate<"HasV8_2aOps", "armv8.2a">;
217219 def NoVFP : Predicate<"!Subtarget->hasVFP2()">;
218220 def HasVFP2 : Predicate<"Subtarget->hasVFP2()">,
219221 AssemblerPredicate<"FeatureVFP2", "VFP2">;
233235 def HasCRC : Predicate<"Subtarget->hasCRC()">,
234236 AssemblerPredicate<"FeatureCRC", "crc">;
235237 def HasFP16 : Predicate<"Subtarget->hasFP16()">,
236 AssemblerPredicate<"FeatureFP16","half-float">;
238 AssemblerPredicate<"FeatureFP16","half-float conversions">;
239 def HasFullFP16 : Predicate<"Subtarget->hasFullFP16()">,
240 AssemblerPredicate<"FeatureFullFP16","full half-float">;
237241 def HasDivide : Predicate<"Subtarget->hasDivide()">,
238242 AssemblerPredicate<"FeatureHWDiv", "divide in THUMB">;
239243 def HasDivideInARM : Predicate<"Subtarget->hasDivideInARMMode()">,
111111 HasV7Ops = false;
112112 HasV8Ops = false;
113113 HasV8_1aOps = false;
114 HasV8_2aOps = false;
114115 HasVFPv2 = false;
115116 HasVFPv3 = false;
116117 HasVFPv4 = false;
129130 NoMovt = false;
130131 SupportsTailCall = false;
131132 HasFP16 = false;
133 HasFullFP16 = false;
132134 HasD16 = false;
133135 HasHardwareDivide = false;
134136 HasHardwareDivideInARM = false;
7676 bool HasV7Ops;
7777 bool HasV8Ops;
7878 bool HasV8_1aOps;
79 bool HasV8_2aOps;
7980
8081 /// HasVFPv2, HasVFPv3, HasVFPv4, HasFPARMv8, HasNEON - Specify what
8182 /// floating point ISAs are supported.
129130 /// Thumb.
130131 bool SupportsTailCall;
131132
132 /// HasFP16 - True if subtarget supports half-precision FP (We support VFP+HF
133 /// only so far)
133 /// HasFP16 - True if subtarget supports half-precision FP conversions
134134 bool HasFP16;
135
136 /// HasFullFP16 - True if subtarget supports half-precision FP operations
137 bool HasFullFP16;
135138
136139 /// HasD16 - True if subtarget is limited to 16 double precision
137140 /// FP registers for VFPv3.
308311 bool hasV7Ops() const { return HasV7Ops; }
309312 bool hasV8Ops() const { return HasV8Ops; }
310313 bool hasV8_1aOps() const { return HasV8_1aOps; }
314 bool hasV8_2aOps() const { return HasV8_2aOps; }
311315
312316 bool isCortexA5() const { return ARMProcFamily == CortexA5; }
313317 bool isCortexA7() const { return ARMProcFamily == CortexA7; }
361365
362366 bool hasFP16() const { return HasFP16; }
363367 bool hasD16() const { return HasD16; }
368 bool hasFullFP16() const { return HasFullFP16; }
364369
365370 const Triple &getTargetTriple() const { return TargetTriple; }
366371