blob: ca382a89692c66993362c4c90ac472dd7e3a3ffc [file] [log] [blame]
Tim Northover3b0846e2014-05-24 12:50:23 +00001//=- AArch64.td - Describe the AArch64 Target Machine --------*- tablegen -*-=//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10//
11//===----------------------------------------------------------------------===//
12
13//===----------------------------------------------------------------------===//
14// Target-independent interfaces which we are implementing
15//===----------------------------------------------------------------------===//
16
17include "llvm/Target/Target.td"
18
19//===----------------------------------------------------------------------===//
20// AArch64 Subtarget features.
21//
22
23def FeatureFPARMv8 : SubtargetFeature<"fp-armv8", "HasFPARMv8", "true",
24 "Enable ARMv8 FP">;
25
26def FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true",
27 "Enable Advanced SIMD instructions", [FeatureFPARMv8]>;
28
29def FeatureCrypto : SubtargetFeature<"crypto", "HasCrypto", "true",
30 "Enable cryptographic instructions">;
31
32def FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true",
33 "Enable ARMv8 CRC-32 checksum instructions">;
34
Ahmed Bougachab0ff6432015-09-01 16:23:45 +000035def FeaturePerfMon : SubtargetFeature<"perfmon", "HasPerfMon", "true",
36 "Enable ARMv8 PMUv3 Performance Monitors extension">;
37
Oliver Stannard7cc0c4e2015-11-26 15:23:32 +000038def FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true",
39 "Full FP16", [FeatureFPARMv8]>;
40
Oliver Stannarda34e4702015-12-01 10:48:51 +000041def FeatureSPE : SubtargetFeature<"spe", "HasSPE", "true",
42 "Enable Statistical Profiling extension">;
43
Tim Northover3b0846e2014-05-24 12:50:23 +000044/// Cyclone has register move instructions which are "free".
45def FeatureZCRegMove : SubtargetFeature<"zcm", "HasZeroCycleRegMove", "true",
46 "Has zero-cycle register moves">;
47
48/// Cyclone has instructions which zero registers for "free".
49def FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true",
50 "Has zero-cycle zeroing instructions">;
51
Akira Hatanakaf53b0402015-07-29 14:17:26 +000052def FeatureStrictAlign : SubtargetFeature<"strict-align",
53 "StrictAlign", "true",
54 "Disallow all unaligned memory "
55 "access">;
56
Akira Hatanaka0d4c9ea2015-07-25 00:18:31 +000057def FeatureReserveX18 : SubtargetFeature<"reserve-x18", "ReserveX18", "true",
58 "Reserve X18, making it unavailable "
59 "as a GPR">;
60
Tim Northover3b0846e2014-05-24 12:50:23 +000061//===----------------------------------------------------------------------===//
Vladimir Sukharev439328e2015-04-01 14:49:29 +000062// Architectures.
63//
64
65def HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
66 "Support ARM v8.1a instructions", [FeatureCRC]>;
67
Oliver Stannard7cc0c4e2015-11-26 15:23:32 +000068def HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
69 "Support ARM v8.2a instructions", [HasV8_1aOps]>;
70
Vladimir Sukharev439328e2015-04-01 14:49:29 +000071//===----------------------------------------------------------------------===//
Tim Northover3b0846e2014-05-24 12:50:23 +000072// Register File Description
73//===----------------------------------------------------------------------===//
74
75include "AArch64RegisterInfo.td"
76include "AArch64CallingConvention.td"
77
78//===----------------------------------------------------------------------===//
79// Instruction Descriptions
80//===----------------------------------------------------------------------===//
81
82include "AArch64Schedule.td"
83include "AArch64InstrInfo.td"
84
85def AArch64InstrInfo : InstrInfo;
86
87//===----------------------------------------------------------------------===//
88// AArch64 Processors supported.
89//
90include "AArch64SchedA53.td"
Chad Rosier2205d4e2014-06-11 21:06:56 +000091include "AArch64SchedA57.td"
Tim Northover3b0846e2014-05-24 12:50:23 +000092include "AArch64SchedCyclone.td"
Evandro Menezesd761ca22016-02-06 00:01:41 +000093include "AArch64SchedM1.td"
Chad Rosiercd2be7f2016-02-12 15:51:51 +000094include "AArch64SchedKryo.td"
Tim Northover3b0846e2014-05-24 12:50:23 +000095
Christof Douma8b5dc2c2015-12-02 11:53:44 +000096def ProcA35 : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
97 "Cortex-A35 ARM processors",
98 [FeatureFPARMv8,
99 FeatureNEON,
100 FeatureCrypto,
101 FeatureCRC,
102 FeaturePerfMon]>;
103
Tim Northover3b0846e2014-05-24 12:50:23 +0000104def ProcA53 : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
105 "Cortex-A53 ARM processors",
106 [FeatureFPARMv8,
107 FeatureNEON,
108 FeatureCrypto,
Ahmed Bougachab0ff6432015-09-01 16:23:45 +0000109 FeatureCRC,
110 FeaturePerfMon]>;
Tim Northover3b0846e2014-05-24 12:50:23 +0000111
112def ProcA57 : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
113 "Cortex-A57 ARM processors",
114 [FeatureFPARMv8,
115 FeatureNEON,
116 FeatureCrypto,
Ahmed Bougachab0ff6432015-09-01 16:23:45 +0000117 FeatureCRC,
118 FeaturePerfMon]>;
Tim Northover3b0846e2014-05-24 12:50:23 +0000119
120def ProcCyclone : SubtargetFeature<"cyclone", "ARMProcFamily", "Cyclone",
121 "Cyclone",
122 [FeatureFPARMv8,
123 FeatureNEON,
124 FeatureCrypto,
Ahmed Bougachab0ff6432015-09-01 16:23:45 +0000125 FeaturePerfMon,
Tim Northover3b0846e2014-05-24 12:50:23 +0000126 FeatureZCRegMove, FeatureZCZeroing]>;
127
MinSeong Kima7385eb2016-01-05 12:51:59 +0000128def ProcExynosM1 : SubtargetFeature<"exynosm1", "ARMProcFamily", "ExynosM1",
129 "Samsung Exynos-M1 processors",
130 [FeatureFPARMv8,
131 FeatureNEON,
132 FeatureCrypto,
133 FeatureCRC,
134 FeaturePerfMon]>;
135
Chad Rosiercd2be7f2016-02-12 15:51:51 +0000136def ProcKryo : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
137 "Qualcomm Kryo processors",
138 [FeatureFPARMv8,
139 FeatureNEON,
140 FeatureCrypto,
141 FeatureCRC,
142 FeaturePerfMon]>;
143
Tim Northover3b0846e2014-05-24 12:50:23 +0000144def : ProcessorModel<"generic", NoSchedModel, [FeatureFPARMv8,
145 FeatureNEON,
Ahmed Bougachab0ff6432015-09-01 16:23:45 +0000146 FeatureCRC,
147 FeaturePerfMon]>;
Tim Northover3b0846e2014-05-24 12:50:23 +0000148
Christof Douma8b5dc2c2015-12-02 11:53:44 +0000149// FIXME: Cortex-A35 is currently modelled as a Cortex-A53
150def : ProcessorModel<"cortex-a35", CortexA53Model, [ProcA35]>;
Tim Northover3b0846e2014-05-24 12:50:23 +0000151def : ProcessorModel<"cortex-a53", CortexA53Model, [ProcA53]>;
Chad Rosier2205d4e2014-06-11 21:06:56 +0000152def : ProcessorModel<"cortex-a57", CortexA57Model, [ProcA57]>;
Sjoerd Meijer0b7bb162016-06-02 10:48:52 +0000153// FIXME: Cortex-A72 and Cortex-A73 are currently modelled as an Cortex-A57.
Renato Golin60885042015-02-04 13:31:29 +0000154def : ProcessorModel<"cortex-a72", CortexA57Model, [ProcA57]>;
Sjoerd Meijer0b7bb162016-06-02 10:48:52 +0000155def : ProcessorModel<"cortex-a73", CortexA57Model, [ProcA57]>;
Tim Northover3b0846e2014-05-24 12:50:23 +0000156def : ProcessorModel<"cyclone", CycloneModel, [ProcCyclone]>;
Evandro Menezesd761ca22016-02-06 00:01:41 +0000157def : ProcessorModel<"exynos-m1", ExynosM1Model, [ProcExynosM1]>;
Chad Rosiercd2be7f2016-02-12 15:51:51 +0000158def : ProcessorModel<"kryo", KryoModel, [ProcKryo]>;
Tim Northover3b0846e2014-05-24 12:50:23 +0000159
160//===----------------------------------------------------------------------===//
161// Assembly parser
162//===----------------------------------------------------------------------===//
163
164def GenericAsmParserVariant : AsmParserVariant {
165 int Variant = 0;
166 string Name = "generic";
Colin LeMahieu8a0453e2015-11-09 00:31:07 +0000167 string BreakCharacters = ".";
Tim Northover3b0846e2014-05-24 12:50:23 +0000168}
169
170def AppleAsmParserVariant : AsmParserVariant {
171 int Variant = 1;
172 string Name = "apple-neon";
Colin LeMahieu8a0453e2015-11-09 00:31:07 +0000173 string BreakCharacters = ".";
Tim Northover3b0846e2014-05-24 12:50:23 +0000174}
175
176//===----------------------------------------------------------------------===//
177// Assembly printer
178//===----------------------------------------------------------------------===//
179// AArch64 Uses the MC printer for asm output, so make sure the TableGen
180// AsmWriter bits get associated with the correct class.
181def GenericAsmWriter : AsmWriter {
182 string AsmWriterClassName = "InstPrinter";
Akira Hatanakab46d0232015-03-27 20:36:02 +0000183 int PassSubtarget = 1;
Tim Northover3b0846e2014-05-24 12:50:23 +0000184 int Variant = 0;
185 bit isMCAsmWriter = 1;
186}
187
188def AppleAsmWriter : AsmWriter {
189 let AsmWriterClassName = "AppleInstPrinter";
Akira Hatanakab46d0232015-03-27 20:36:02 +0000190 int PassSubtarget = 1;
Tim Northover3b0846e2014-05-24 12:50:23 +0000191 int Variant = 1;
192 int isMCAsmWriter = 1;
193}
194
195//===----------------------------------------------------------------------===//
196// Target Declaration
197//===----------------------------------------------------------------------===//
198
199def AArch64 : Target {
200 let InstructionSet = AArch64InstrInfo;
201 let AssemblyParserVariants = [GenericAsmParserVariant, AppleAsmParserVariant];
202 let AssemblyWriters = [GenericAsmWriter, AppleAsmWriter];
203}