| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 1 | //=- 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 | |
| 17 | include "llvm/Target/Target.td" |
| 18 | |
| 19 | //===----------------------------------------------------------------------===// |
| 20 | // AArch64 Subtarget features. |
| 21 | // |
| 22 | |
| 23 | def FeatureFPARMv8 : SubtargetFeature<"fp-armv8", "HasFPARMv8", "true", |
| 24 | "Enable ARMv8 FP">; |
| 25 | |
| 26 | def FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true", |
| 27 | "Enable Advanced SIMD instructions", [FeatureFPARMv8]>; |
| 28 | |
| 29 | def FeatureCrypto : SubtargetFeature<"crypto", "HasCrypto", "true", |
| 30 | "Enable cryptographic instructions">; |
| 31 | |
| 32 | def FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true", |
| 33 | "Enable ARMv8 CRC-32 checksum instructions">; |
| 34 | |
| Ahmed Bougacha | b0ff643 | 2015-09-01 16:23:45 +0000 | [diff] [blame] | 35 | def FeaturePerfMon : SubtargetFeature<"perfmon", "HasPerfMon", "true", |
| 36 | "Enable ARMv8 PMUv3 Performance Monitors extension">; |
| 37 | |
| Oliver Stannard | 7cc0c4e | 2015-11-26 15:23:32 +0000 | [diff] [blame] | 38 | def FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true", |
| 39 | "Full FP16", [FeatureFPARMv8]>; |
| 40 | |
| Oliver Stannard | a34e470 | 2015-12-01 10:48:51 +0000 | [diff] [blame] | 41 | def FeatureSPE : SubtargetFeature<"spe", "HasSPE", "true", |
| 42 | "Enable Statistical Profiling extension">; |
| 43 | |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 44 | /// Cyclone has register move instructions which are "free". |
| 45 | def FeatureZCRegMove : SubtargetFeature<"zcm", "HasZeroCycleRegMove", "true", |
| 46 | "Has zero-cycle register moves">; |
| 47 | |
| 48 | /// Cyclone has instructions which zero registers for "free". |
| 49 | def FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true", |
| 50 | "Has zero-cycle zeroing instructions">; |
| 51 | |
| Akira Hatanaka | f53b040 | 2015-07-29 14:17:26 +0000 | [diff] [blame] | 52 | def FeatureStrictAlign : SubtargetFeature<"strict-align", |
| 53 | "StrictAlign", "true", |
| 54 | "Disallow all unaligned memory " |
| 55 | "access">; |
| 56 | |
| Akira Hatanaka | 0d4c9ea | 2015-07-25 00:18:31 +0000 | [diff] [blame] | 57 | def FeatureReserveX18 : SubtargetFeature<"reserve-x18", "ReserveX18", "true", |
| 58 | "Reserve X18, making it unavailable " |
| 59 | "as a GPR">; |
| 60 | |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 61 | //===----------------------------------------------------------------------===// |
| Vladimir Sukharev | 439328e | 2015-04-01 14:49:29 +0000 | [diff] [blame] | 62 | // Architectures. |
| 63 | // |
| 64 | |
| 65 | def HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true", |
| 66 | "Support ARM v8.1a instructions", [FeatureCRC]>; |
| 67 | |
| Oliver Stannard | 7cc0c4e | 2015-11-26 15:23:32 +0000 | [diff] [blame] | 68 | def HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true", |
| 69 | "Support ARM v8.2a instructions", [HasV8_1aOps]>; |
| 70 | |
| Vladimir Sukharev | 439328e | 2015-04-01 14:49:29 +0000 | [diff] [blame] | 71 | //===----------------------------------------------------------------------===// |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 72 | // Register File Description |
| 73 | //===----------------------------------------------------------------------===// |
| 74 | |
| 75 | include "AArch64RegisterInfo.td" |
| 76 | include "AArch64CallingConvention.td" |
| 77 | |
| 78 | //===----------------------------------------------------------------------===// |
| 79 | // Instruction Descriptions |
| 80 | //===----------------------------------------------------------------------===// |
| 81 | |
| 82 | include "AArch64Schedule.td" |
| 83 | include "AArch64InstrInfo.td" |
| 84 | |
| 85 | def AArch64InstrInfo : InstrInfo; |
| 86 | |
| 87 | //===----------------------------------------------------------------------===// |
| 88 | // AArch64 Processors supported. |
| 89 | // |
| 90 | include "AArch64SchedA53.td" |
| Chad Rosier | 2205d4e | 2014-06-11 21:06:56 +0000 | [diff] [blame] | 91 | include "AArch64SchedA57.td" |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 92 | include "AArch64SchedCyclone.td" |
| Evandro Menezes | d761ca2 | 2016-02-06 00:01:41 +0000 | [diff] [blame] | 93 | include "AArch64SchedM1.td" |
| Chad Rosier | cd2be7f | 2016-02-12 15:51:51 +0000 | [diff] [blame] | 94 | include "AArch64SchedKryo.td" |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 95 | |
| Christof Douma | 8b5dc2c | 2015-12-02 11:53:44 +0000 | [diff] [blame] | 96 | def ProcA35 : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35", |
| 97 | "Cortex-A35 ARM processors", |
| 98 | [FeatureFPARMv8, |
| 99 | FeatureNEON, |
| 100 | FeatureCrypto, |
| 101 | FeatureCRC, |
| 102 | FeaturePerfMon]>; |
| 103 | |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 104 | def ProcA53 : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53", |
| 105 | "Cortex-A53 ARM processors", |
| 106 | [FeatureFPARMv8, |
| 107 | FeatureNEON, |
| 108 | FeatureCrypto, |
| Ahmed Bougacha | b0ff643 | 2015-09-01 16:23:45 +0000 | [diff] [blame] | 109 | FeatureCRC, |
| 110 | FeaturePerfMon]>; |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 111 | |
| 112 | def ProcA57 : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57", |
| 113 | "Cortex-A57 ARM processors", |
| 114 | [FeatureFPARMv8, |
| 115 | FeatureNEON, |
| 116 | FeatureCrypto, |
| Ahmed Bougacha | b0ff643 | 2015-09-01 16:23:45 +0000 | [diff] [blame] | 117 | FeatureCRC, |
| 118 | FeaturePerfMon]>; |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 119 | |
| 120 | def ProcCyclone : SubtargetFeature<"cyclone", "ARMProcFamily", "Cyclone", |
| 121 | "Cyclone", |
| 122 | [FeatureFPARMv8, |
| 123 | FeatureNEON, |
| 124 | FeatureCrypto, |
| Ahmed Bougacha | b0ff643 | 2015-09-01 16:23:45 +0000 | [diff] [blame] | 125 | FeaturePerfMon, |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 126 | FeatureZCRegMove, FeatureZCZeroing]>; |
| 127 | |
| MinSeong Kim | a7385eb | 2016-01-05 12:51:59 +0000 | [diff] [blame] | 128 | def ProcExynosM1 : SubtargetFeature<"exynosm1", "ARMProcFamily", "ExynosM1", |
| 129 | "Samsung Exynos-M1 processors", |
| 130 | [FeatureFPARMv8, |
| 131 | FeatureNEON, |
| 132 | FeatureCrypto, |
| 133 | FeatureCRC, |
| 134 | FeaturePerfMon]>; |
| 135 | |
| Chad Rosier | cd2be7f | 2016-02-12 15:51:51 +0000 | [diff] [blame] | 136 | def ProcKryo : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo", |
| 137 | "Qualcomm Kryo processors", |
| 138 | [FeatureFPARMv8, |
| 139 | FeatureNEON, |
| 140 | FeatureCrypto, |
| 141 | FeatureCRC, |
| 142 | FeaturePerfMon]>; |
| 143 | |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 144 | def : ProcessorModel<"generic", NoSchedModel, [FeatureFPARMv8, |
| 145 | FeatureNEON, |
| Ahmed Bougacha | b0ff643 | 2015-09-01 16:23:45 +0000 | [diff] [blame] | 146 | FeatureCRC, |
| 147 | FeaturePerfMon]>; |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 148 | |
| Christof Douma | 8b5dc2c | 2015-12-02 11:53:44 +0000 | [diff] [blame] | 149 | // FIXME: Cortex-A35 is currently modelled as a Cortex-A53 |
| 150 | def : ProcessorModel<"cortex-a35", CortexA53Model, [ProcA35]>; |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 151 | def : ProcessorModel<"cortex-a53", CortexA53Model, [ProcA53]>; |
| Chad Rosier | 2205d4e | 2014-06-11 21:06:56 +0000 | [diff] [blame] | 152 | def : ProcessorModel<"cortex-a57", CortexA57Model, [ProcA57]>; |
| Sjoerd Meijer | 0b7bb16 | 2016-06-02 10:48:52 +0000 | [diff] [blame^] | 153 | // FIXME: Cortex-A72 and Cortex-A73 are currently modelled as an Cortex-A57. |
| Renato Golin | 6088504 | 2015-02-04 13:31:29 +0000 | [diff] [blame] | 154 | def : ProcessorModel<"cortex-a72", CortexA57Model, [ProcA57]>; |
| Sjoerd Meijer | 0b7bb16 | 2016-06-02 10:48:52 +0000 | [diff] [blame^] | 155 | def : ProcessorModel<"cortex-a73", CortexA57Model, [ProcA57]>; |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 156 | def : ProcessorModel<"cyclone", CycloneModel, [ProcCyclone]>; |
| Evandro Menezes | d761ca2 | 2016-02-06 00:01:41 +0000 | [diff] [blame] | 157 | def : ProcessorModel<"exynos-m1", ExynosM1Model, [ProcExynosM1]>; |
| Chad Rosier | cd2be7f | 2016-02-12 15:51:51 +0000 | [diff] [blame] | 158 | def : ProcessorModel<"kryo", KryoModel, [ProcKryo]>; |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 159 | |
| 160 | //===----------------------------------------------------------------------===// |
| 161 | // Assembly parser |
| 162 | //===----------------------------------------------------------------------===// |
| 163 | |
| 164 | def GenericAsmParserVariant : AsmParserVariant { |
| 165 | int Variant = 0; |
| 166 | string Name = "generic"; |
| Colin LeMahieu | 8a0453e | 2015-11-09 00:31:07 +0000 | [diff] [blame] | 167 | string BreakCharacters = "."; |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | def AppleAsmParserVariant : AsmParserVariant { |
| 171 | int Variant = 1; |
| 172 | string Name = "apple-neon"; |
| Colin LeMahieu | 8a0453e | 2015-11-09 00:31:07 +0000 | [diff] [blame] | 173 | string BreakCharacters = "."; |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 174 | } |
| 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. |
| 181 | def GenericAsmWriter : AsmWriter { |
| 182 | string AsmWriterClassName = "InstPrinter"; |
| Akira Hatanaka | b46d023 | 2015-03-27 20:36:02 +0000 | [diff] [blame] | 183 | int PassSubtarget = 1; |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 184 | int Variant = 0; |
| 185 | bit isMCAsmWriter = 1; |
| 186 | } |
| 187 | |
| 188 | def AppleAsmWriter : AsmWriter { |
| 189 | let AsmWriterClassName = "AppleInstPrinter"; |
| Akira Hatanaka | b46d023 | 2015-03-27 20:36:02 +0000 | [diff] [blame] | 190 | int PassSubtarget = 1; |
| Tim Northover | 3b0846e | 2014-05-24 12:50:23 +0000 | [diff] [blame] | 191 | int Variant = 1; |
| 192 | int isMCAsmWriter = 1; |
| 193 | } |
| 194 | |
| 195 | //===----------------------------------------------------------------------===// |
| 196 | // Target Declaration |
| 197 | //===----------------------------------------------------------------------===// |
| 198 | |
| 199 | def AArch64 : Target { |
| 200 | let InstructionSet = AArch64InstrInfo; |
| 201 | let AssemblyParserVariants = [GenericAsmParserVariant, AppleAsmParserVariant]; |
| 202 | let AssemblyWriters = [GenericAsmWriter, AppleAsmWriter]; |
| 203 | } |