blob: cd3e84d38fe2faa2e7be13306301b1953911b83b [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"
Tim Northover3b0846e2014-05-24 12:50:23 +000094
Christof Douma8b5dc2c2015-12-02 11:53:44 +000095def ProcA35 : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
96 "Cortex-A35 ARM processors",
97 [FeatureFPARMv8,
98 FeatureNEON,
99 FeatureCrypto,
100 FeatureCRC,
101 FeaturePerfMon]>;
102
Tim Northover3b0846e2014-05-24 12:50:23 +0000103def ProcA53 : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
104 "Cortex-A53 ARM processors",
105 [FeatureFPARMv8,
106 FeatureNEON,
107 FeatureCrypto,
Ahmed Bougachab0ff6432015-09-01 16:23:45 +0000108 FeatureCRC,
109 FeaturePerfMon]>;
Tim Northover3b0846e2014-05-24 12:50:23 +0000110
111def ProcA57 : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
112 "Cortex-A57 ARM processors",
113 [FeatureFPARMv8,
114 FeatureNEON,
115 FeatureCrypto,
Ahmed Bougachab0ff6432015-09-01 16:23:45 +0000116 FeatureCRC,
117 FeaturePerfMon]>;
Tim Northover3b0846e2014-05-24 12:50:23 +0000118
119def ProcCyclone : SubtargetFeature<"cyclone", "ARMProcFamily", "Cyclone",
120 "Cyclone",
121 [FeatureFPARMv8,
122 FeatureNEON,
123 FeatureCrypto,
124 FeatureCRC,
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
Tim Northover3b0846e2014-05-24 12:50:23 +0000136def : ProcessorModel<"generic", NoSchedModel, [FeatureFPARMv8,
137 FeatureNEON,
Ahmed Bougachab0ff6432015-09-01 16:23:45 +0000138 FeatureCRC,
139 FeaturePerfMon]>;
Tim Northover3b0846e2014-05-24 12:50:23 +0000140
Christof Douma8b5dc2c2015-12-02 11:53:44 +0000141// FIXME: Cortex-A35 is currently modelled as a Cortex-A53
142def : ProcessorModel<"cortex-a35", CortexA53Model, [ProcA35]>;
Tim Northover3b0846e2014-05-24 12:50:23 +0000143def : ProcessorModel<"cortex-a53", CortexA53Model, [ProcA53]>;
Chad Rosier2205d4e2014-06-11 21:06:56 +0000144def : ProcessorModel<"cortex-a57", CortexA57Model, [ProcA57]>;
Renato Golin60885042015-02-04 13:31:29 +0000145// FIXME: Cortex-A72 is currently modelled as an Cortex-A57.
146def : ProcessorModel<"cortex-a72", CortexA57Model, [ProcA57]>;
Tim Northover3b0846e2014-05-24 12:50:23 +0000147def : ProcessorModel<"cyclone", CycloneModel, [ProcCyclone]>;
Evandro Menezesd761ca22016-02-06 00:01:41 +0000148def : ProcessorModel<"exynos-m1", ExynosM1Model, [ProcExynosM1]>;
Tim Northover3b0846e2014-05-24 12:50:23 +0000149
150//===----------------------------------------------------------------------===//
151// Assembly parser
152//===----------------------------------------------------------------------===//
153
154def GenericAsmParserVariant : AsmParserVariant {
155 int Variant = 0;
156 string Name = "generic";
Colin LeMahieu8a0453e2015-11-09 00:31:07 +0000157 string BreakCharacters = ".";
Tim Northover3b0846e2014-05-24 12:50:23 +0000158}
159
160def AppleAsmParserVariant : AsmParserVariant {
161 int Variant = 1;
162 string Name = "apple-neon";
Colin LeMahieu8a0453e2015-11-09 00:31:07 +0000163 string BreakCharacters = ".";
Tim Northover3b0846e2014-05-24 12:50:23 +0000164}
165
166//===----------------------------------------------------------------------===//
167// Assembly printer
168//===----------------------------------------------------------------------===//
169// AArch64 Uses the MC printer for asm output, so make sure the TableGen
170// AsmWriter bits get associated with the correct class.
171def GenericAsmWriter : AsmWriter {
172 string AsmWriterClassName = "InstPrinter";
Akira Hatanakab46d0232015-03-27 20:36:02 +0000173 int PassSubtarget = 1;
Tim Northover3b0846e2014-05-24 12:50:23 +0000174 int Variant = 0;
175 bit isMCAsmWriter = 1;
176}
177
178def AppleAsmWriter : AsmWriter {
179 let AsmWriterClassName = "AppleInstPrinter";
Akira Hatanakab46d0232015-03-27 20:36:02 +0000180 int PassSubtarget = 1;
Tim Northover3b0846e2014-05-24 12:50:23 +0000181 int Variant = 1;
182 int isMCAsmWriter = 1;
183}
184
185//===----------------------------------------------------------------------===//
186// Target Declaration
187//===----------------------------------------------------------------------===//
188
189def AArch64 : Target {
190 let InstructionSet = AArch64InstrInfo;
191 let AssemblyParserVariants = [GenericAsmParserVariant, AppleAsmParserVariant];
192 let AssemblyWriters = [GenericAsmWriter, AppleAsmWriter];
193}