1 //=- AArch64.td - Describe the AArch64 Target Machine --------*- tablegen -*-=//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
13 //===----------------------------------------------------------------------===//
14 // Target-independent interfaces which we are implementing.
15 //===----------------------------------------------------------------------===//
17 include "llvm/Target/Target.td"
19 //===----------------------------------------------------------------------===//
20 // AArch64 Subtarget features.
23 def FeatureFPARMv8 : SubtargetFeature<"fp-armv8", "HasFPARMv8", "true",
26 def FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true",
27 "Enable Advanced SIMD instructions", [FeatureFPARMv8]>;
29 def FeatureCrypto : SubtargetFeature<"crypto", "HasCrypto", "true",
30 "Enable cryptographic instructions">;
32 def FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true",
33 "Enable ARMv8 CRC-32 checksum instructions">;
35 def FeatureRAS : SubtargetFeature<"ras", "HasRAS", "true",
36 "Enable ARMv8 Reliability, Availability and Serviceability Extensions">;
38 def FeatureLSE : SubtargetFeature<"lse", "HasLSE", "true",
39 "Enable ARMv8.1 Large System Extension (LSE) atomic instructions">;
41 def FeaturePerfMon : SubtargetFeature<"perfmon", "HasPerfMon", "true",
42 "Enable ARMv8 PMUv3 Performance Monitors extension">;
44 def FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true",
45 "Full FP16", [FeatureFPARMv8]>;
47 def FeatureSPE : SubtargetFeature<"spe", "HasSPE", "true",
48 "Enable Statistical Profiling extension">;
50 /// Cyclone has register move instructions which are "free".
51 def FeatureZCRegMove : SubtargetFeature<"zcm", "HasZeroCycleRegMove", "true",
52 "Has zero-cycle register moves">;
54 /// Cyclone has instructions which zero registers for "free".
55 def FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true",
56 "Has zero-cycle zeroing instructions">;
58 def FeatureStrictAlign : SubtargetFeature<"strict-align",
59 "StrictAlign", "true",
60 "Disallow all unaligned memory "
63 def FeatureReserveX18 : SubtargetFeature<"reserve-x18", "ReserveX18", "true",
64 "Reserve X18, making it unavailable "
67 def FeatureUseAA : SubtargetFeature<"use-aa", "UseAA", "true",
68 "Use alias analysis during codegen">;
70 def FeatureBalanceFPOps : SubtargetFeature<"balance-fp-ops", "BalanceFPOps",
72 "balance mix of odd and even D-registers for fp multiply(-accumulate) ops">;
74 def FeaturePredictableSelectIsExpensive : SubtargetFeature<
75 "predictable-select-expensive", "PredictableSelectIsExpensive", "true",
76 "Prefer likely predicted branches over selects">;
78 def FeatureCustomCheapAsMoveHandling : SubtargetFeature<"custom-cheap-as-move",
79 "CustomAsCheapAsMove", "true",
80 "Use custom code for TargetInstrInfo::isAsCheapAsAMove()">;
82 def FeaturePostRAScheduler : SubtargetFeature<"use-postra-scheduler",
83 "UsePostRAScheduler", "true", "Schedule again after register allocation">;
85 def FeatureSlowMisaligned128Store : SubtargetFeature<"slow-misaligned-128store",
86 "Misaligned128StoreIsSlow", "true", "Misaligned 128 bit stores are slow">;
88 def FeatureSlowPaired128 : SubtargetFeature<"slow-paired-128",
89 "Paired128IsSlow", "true", "Paired 128 bit loads and stores are slow">;
91 def FeatureAlternateSExtLoadCVTF32Pattern : SubtargetFeature<
92 "alternate-sextload-cvt-f32-pattern", "UseAlternateSExtLoadCVTF32Pattern",
93 "true", "Use alternative pattern for sextload convert to f32">;
95 def FeatureArithmeticBccFusion : SubtargetFeature<
96 "arith-bcc-fusion", "HasArithmeticBccFusion", "true",
97 "CPU fuses arithmetic+bcc operations">;
99 def FeatureArithmeticCbzFusion : SubtargetFeature<
100 "arith-cbz-fusion", "HasArithmeticCbzFusion", "true",
101 "CPU fuses arithmetic + cbz/cbnz operations">;
103 def FeatureDisableLatencySchedHeuristic : SubtargetFeature<
104 "disable-latency-sched-heuristic", "DisableLatencySchedHeuristic", "true",
105 "Disable latency scheduling heuristic">;
107 def FeatureUseRSqrt : SubtargetFeature<
108 "use-reciprocal-square-root", "UseRSqrt", "true",
109 "Use the reciprocal square root approximation">;
111 //===----------------------------------------------------------------------===//
115 def HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
116 "Support ARM v8.1a instructions", [FeatureCRC, FeatureLSE]>;
118 def HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
119 "Support ARM v8.2a instructions", [HasV8_1aOps, FeatureRAS]>;
121 //===----------------------------------------------------------------------===//
122 // Register File Description
123 //===----------------------------------------------------------------------===//
125 include "AArch64RegisterInfo.td"
126 include "AArch64CallingConvention.td"
128 //===----------------------------------------------------------------------===//
129 // Instruction Descriptions
130 //===----------------------------------------------------------------------===//
132 include "AArch64Schedule.td"
133 include "AArch64InstrInfo.td"
135 def AArch64InstrInfo : InstrInfo;
137 //===----------------------------------------------------------------------===//
138 // Named operands for MRS/MSR/TLBI/...
139 //===----------------------------------------------------------------------===//
141 include "AArch64SystemOperands.td"
143 //===----------------------------------------------------------------------===//
144 // AArch64 Processors supported.
146 include "AArch64SchedA53.td"
147 include "AArch64SchedA57.td"
148 include "AArch64SchedCyclone.td"
149 include "AArch64SchedFalkor.td"
150 include "AArch64SchedKryo.td"
151 include "AArch64SchedM1.td"
152 include "AArch64SchedVulcan.td"
154 def ProcA35 : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
155 "Cortex-A35 ARM processors", [
163 def ProcA53 : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
164 "Cortex-A53 ARM processors", [
168 FeatureCustomCheapAsMoveHandling,
172 FeaturePostRAScheduler,
176 def ProcA57 : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
177 "Cortex-A57 ARM processors", [
181 FeatureCustomCheapAsMoveHandling,
185 FeaturePostRAScheduler,
186 FeaturePredictableSelectIsExpensive
189 def ProcA72 : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
190 "Cortex-A72 ARM processors", [
198 def ProcA73 : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
199 "Cortex-A73 ARM processors", [
207 def ProcCyclone : SubtargetFeature<"cyclone", "ARMProcFamily", "Cyclone",
209 FeatureAlternateSExtLoadCVTF32Pattern,
211 FeatureDisableLatencySchedHeuristic,
213 FeatureArithmeticBccFusion,
214 FeatureArithmeticCbzFusion,
217 FeatureSlowMisaligned128Store,
222 def ProcExynosM1 : SubtargetFeature<"exynosm1", "ARMProcFamily", "ExynosM1",
223 "Samsung Exynos-M1 processors",
224 [FeatureSlowPaired128,
227 FeatureCustomCheapAsMoveHandling,
231 FeaturePostRAScheduler,
232 FeatureSlowMisaligned128Store,
236 def ProcExynosM2 : SubtargetFeature<"exynosm2", "ARMProcFamily", "ExynosM1",
237 "Samsung Exynos-M2/M3 processors",
238 [FeatureSlowPaired128,
241 FeatureCustomCheapAsMoveHandling,
245 FeaturePostRAScheduler,
246 FeatureSlowMisaligned128Store,
249 def ProcKryo : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
250 "Qualcomm Kryo processors", [
253 FeatureCustomCheapAsMoveHandling,
257 FeaturePostRAScheduler,
258 FeaturePredictableSelectIsExpensive,
262 def ProcFalkor : SubtargetFeature<"falkor", "ARMProcFamily", "Falkor",
263 "Qualcomm Falkor processors", [
266 FeatureCustomCheapAsMoveHandling,
270 FeaturePostRAScheduler,
271 FeaturePredictableSelectIsExpensive,
275 def ProcVulcan : SubtargetFeature<"vulcan", "ARMProcFamily", "Vulcan",
276 "Broadcom Vulcan processors", [
280 FeatureArithmeticBccFusion,
282 FeaturePostRAScheduler,
283 FeaturePredictableSelectIsExpensive,
286 def : ProcessorModel<"generic", NoSchedModel, [
291 FeaturePostRAScheduler
294 // FIXME: Cortex-A35 is currently modelled as a Cortex-A53
295 def : ProcessorModel<"cortex-a35", CortexA53Model, [ProcA35]>;
296 def : ProcessorModel<"cortex-a53", CortexA53Model, [ProcA53]>;
297 def : ProcessorModel<"cortex-a57", CortexA57Model, [ProcA57]>;
298 // FIXME: Cortex-A72 and Cortex-A73 are currently modelled as an Cortex-A57.
299 def : ProcessorModel<"cortex-a72", CortexA57Model, [ProcA72]>;
300 def : ProcessorModel<"cortex-a73", CortexA57Model, [ProcA73]>;
301 def : ProcessorModel<"cyclone", CycloneModel, [ProcCyclone]>;
302 def : ProcessorModel<"exynos-m1", ExynosM1Model, [ProcExynosM1]>;
303 def : ProcessorModel<"exynos-m2", ExynosM1Model, [ProcExynosM2]>;
304 def : ProcessorModel<"exynos-m3", ExynosM1Model, [ProcExynosM2]>;
305 def : ProcessorModel<"falkor", FalkorModel, [ProcFalkor]>;
306 def : ProcessorModel<"kryo", KryoModel, [ProcKryo]>;
307 def : ProcessorModel<"vulcan", VulcanModel, [ProcVulcan]>;
309 //===----------------------------------------------------------------------===//
311 //===----------------------------------------------------------------------===//
313 def GenericAsmParserVariant : AsmParserVariant {
315 string Name = "generic";
316 string BreakCharacters = ".";
319 def AppleAsmParserVariant : AsmParserVariant {
321 string Name = "apple-neon";
322 string BreakCharacters = ".";
325 //===----------------------------------------------------------------------===//
327 //===----------------------------------------------------------------------===//
328 // AArch64 Uses the MC printer for asm output, so make sure the TableGen
329 // AsmWriter bits get associated with the correct class.
330 def GenericAsmWriter : AsmWriter {
331 string AsmWriterClassName = "InstPrinter";
332 int PassSubtarget = 1;
334 bit isMCAsmWriter = 1;
337 def AppleAsmWriter : AsmWriter {
338 let AsmWriterClassName = "AppleInstPrinter";
339 int PassSubtarget = 1;
341 int isMCAsmWriter = 1;
344 //===----------------------------------------------------------------------===//
345 // Target Declaration
346 //===----------------------------------------------------------------------===//
348 def AArch64 : Target {
349 let InstructionSet = AArch64InstrInfo;
350 let AssemblyParserVariants = [GenericAsmParserVariant, AppleAsmParserVariant];
351 let AssemblyWriters = [GenericAsmWriter, AppleAsmWriter];