Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 1 | //===- ARM.td - Describe the ARM Target Machine -----------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 4ee451d | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | // Target-independent interfaces which we are implementing |
| 15 | //===----------------------------------------------------------------------===// |
| 16 | |
Evan Cheng | 027fdbe | 2008-11-24 07:34:46 +0000 | [diff] [blame] | 17 | include "llvm/Target/Target.td" |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 18 | |
| 19 | //===----------------------------------------------------------------------===// |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 20 | // ARM Subtarget features. |
| 21 | // |
| 22 | |
| 23 | def ArchV4T : SubtargetFeature<"v4t", "ARMArchVersion", "V4T", |
| 24 | "ARM v4T">; |
| 25 | def ArchV5T : SubtargetFeature<"v5t", "ARMArchVersion", "V5T", |
| 26 | "ARM v5T">; |
| 27 | def ArchV5TE : SubtargetFeature<"v5te", "ARMArchVersion", "V5TE", |
| 28 | "ARM v5TE, v5TEj, v5TExp">; |
| 29 | def ArchV6 : SubtargetFeature<"v6", "ARMArchVersion", "V6", |
| 30 | "ARM v6">; |
Anton Korobeynikov | fbbf1ee | 2009-06-08 21:20:36 +0000 | [diff] [blame] | 31 | def ArchV6T2 : SubtargetFeature<"v6t2", "ARMArchVersion", "V6T2", |
| 32 | "ARM v6t2">; |
Anton Korobeynikov | 6d7d2aa | 2009-05-23 19:51:43 +0000 | [diff] [blame] | 33 | def ArchV7A : SubtargetFeature<"v7a", "ARMArchVersion", "V7A", |
| 34 | "ARM v7A">; |
Jim Grosbach | b1dc393 | 2010-05-05 20:44:35 +0000 | [diff] [blame] | 35 | def ArchV7M : SubtargetFeature<"v7m", "ARMArchVersion", "V7M", |
| 36 | "ARM v7M">; |
Anton Korobeynikov | 6d7d2aa | 2009-05-23 19:51:43 +0000 | [diff] [blame] | 37 | def FeatureVFP2 : SubtargetFeature<"vfp2", "ARMFPUType", "VFPv2", |
Anton Korobeynikov | d4022c3 | 2009-05-29 23:41:08 +0000 | [diff] [blame] | 38 | "Enable VFP2 instructions">; |
Anton Korobeynikov | 6d7d2aa | 2009-05-23 19:51:43 +0000 | [diff] [blame] | 39 | def FeatureVFP3 : SubtargetFeature<"vfp3", "ARMFPUType", "VFPv3", |
Anton Korobeynikov | d4022c3 | 2009-05-29 23:41:08 +0000 | [diff] [blame] | 40 | "Enable VFP3 instructions">; |
Anton Korobeynikov | 6d7d2aa | 2009-05-23 19:51:43 +0000 | [diff] [blame] | 41 | def FeatureNEON : SubtargetFeature<"neon", "ARMFPUType", "NEON", |
Anton Korobeynikov | d4022c3 | 2009-05-29 23:41:08 +0000 | [diff] [blame] | 42 | "Enable NEON instructions">; |
| 43 | def FeatureThumb2 : SubtargetFeature<"thumb2", "ThumbMode", "Thumb2", |
| 44 | "Enable Thumb2 instructions">; |
Anton Korobeynikov | 631379e | 2010-03-14 18:42:38 +0000 | [diff] [blame] | 45 | def FeatureFP16 : SubtargetFeature<"fp16", "HasFP16", "true", |
| 46 | "Enable half-precision floating point">; |
Jim Grosbach | 2940213 | 2010-05-05 23:44:43 +0000 | [diff] [blame^] | 47 | def FeatureHWDiv : SubtargetFeature<"hwdiv", "HasHardwareDivide", "true", |
| 48 | "Enable divide instructions">; |
| 49 | def FeatureT2ExtractPack: SubtargetFeature<"t2xtpk", "HasT2ExtractPack", "true", |
| 50 | "Enable Thumb2 extract and pack instructions">; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 51 | |
Jim Grosbach | 6b2e8dc | 2010-03-25 23:11:16 +0000 | [diff] [blame] | 52 | // Some processors have multiply-accumulate instructions that don't |
| 53 | // play nicely with other VFP instructions, and it's generally better |
| 54 | // to just not use them. |
| 55 | // FIXME: Currently, this is only flagged for Cortex-A8. It may be true for |
| 56 | // others as well. We should do more benchmarking and confirm one way or |
| 57 | // the other. |
Jim Grosbach | 7ec7a0e | 2010-03-25 23:47:34 +0000 | [diff] [blame] | 58 | def FeatureHasSlowVMLx : SubtargetFeature<"vmlx", "SlowVMLx", "true", |
| 59 | "Disable VFP MAC instructions">; |
| 60 | // Some processors benefit from using NEON instructions for scalar |
| 61 | // single-precision FP operations. |
| 62 | def FeatureNEONForFP : SubtargetFeature<"neonfp", "UseNEONForSinglePrecisionFP", |
| 63 | "true", |
| 64 | "Use NEON for single precision FP">; |
| 65 | |
Jim Grosbach | 6b2e8dc | 2010-03-25 23:11:16 +0000 | [diff] [blame] | 66 | |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 67 | //===----------------------------------------------------------------------===// |
| 68 | // ARM Processors supported. |
| 69 | // |
| 70 | |
Evan Cheng | 8557c2b | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 71 | include "ARMSchedule.td" |
| 72 | |
| 73 | class ProcNoItin<string Name, list<SubtargetFeature> Features> |
| 74 | : Processor<Name, GenericItineraries, Features>; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 75 | |
| 76 | // V4 Processors. |
Evan Cheng | 8557c2b | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 77 | def : ProcNoItin<"generic", []>; |
| 78 | def : ProcNoItin<"arm8", []>; |
| 79 | def : ProcNoItin<"arm810", []>; |
| 80 | def : ProcNoItin<"strongarm", []>; |
| 81 | def : ProcNoItin<"strongarm110", []>; |
| 82 | def : ProcNoItin<"strongarm1100", []>; |
| 83 | def : ProcNoItin<"strongarm1110", []>; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 84 | |
| 85 | // V4T Processors. |
Evan Cheng | 8557c2b | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 86 | def : ProcNoItin<"arm7tdmi", [ArchV4T]>; |
| 87 | def : ProcNoItin<"arm7tdmi-s", [ArchV4T]>; |
| 88 | def : ProcNoItin<"arm710t", [ArchV4T]>; |
| 89 | def : ProcNoItin<"arm720t", [ArchV4T]>; |
| 90 | def : ProcNoItin<"arm9", [ArchV4T]>; |
| 91 | def : ProcNoItin<"arm9tdmi", [ArchV4T]>; |
| 92 | def : ProcNoItin<"arm920", [ArchV4T]>; |
| 93 | def : ProcNoItin<"arm920t", [ArchV4T]>; |
| 94 | def : ProcNoItin<"arm922t", [ArchV4T]>; |
| 95 | def : ProcNoItin<"arm940t", [ArchV4T]>; |
| 96 | def : ProcNoItin<"ep9312", [ArchV4T]>; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 97 | |
| 98 | // V5T Processors. |
Evan Cheng | 8557c2b | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 99 | def : ProcNoItin<"arm10tdmi", [ArchV5T]>; |
| 100 | def : ProcNoItin<"arm1020t", [ArchV5T]>; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 101 | |
| 102 | // V5TE Processors. |
Evan Cheng | 8557c2b | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 103 | def : ProcNoItin<"arm9e", [ArchV5TE]>; |
| 104 | def : ProcNoItin<"arm926ej-s", [ArchV5TE]>; |
| 105 | def : ProcNoItin<"arm946e-s", [ArchV5TE]>; |
| 106 | def : ProcNoItin<"arm966e-s", [ArchV5TE]>; |
| 107 | def : ProcNoItin<"arm968e-s", [ArchV5TE]>; |
| 108 | def : ProcNoItin<"arm10e", [ArchV5TE]>; |
| 109 | def : ProcNoItin<"arm1020e", [ArchV5TE]>; |
| 110 | def : ProcNoItin<"arm1022e", [ArchV5TE]>; |
| 111 | def : ProcNoItin<"xscale", [ArchV5TE]>; |
| 112 | def : ProcNoItin<"iwmmxt", [ArchV5TE]>; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 113 | |
| 114 | // V6 Processors. |
David Goodwin | ebb5cb9 | 2009-11-18 18:39:57 +0000 | [diff] [blame] | 115 | def : Processor<"arm1136j-s", ARMV6Itineraries, [ArchV6]>; |
Jim Grosbach | 1118b5e | 2010-04-01 00:13:43 +0000 | [diff] [blame] | 116 | def : Processor<"arm1136jf-s", ARMV6Itineraries, [ArchV6, FeatureVFP2, |
| 117 | FeatureHasSlowVMLx]>; |
David Goodwin | ebb5cb9 | 2009-11-18 18:39:57 +0000 | [diff] [blame] | 118 | def : Processor<"arm1176jz-s", ARMV6Itineraries, [ArchV6]>; |
| 119 | def : Processor<"arm1176jzf-s", ARMV6Itineraries, [ArchV6, FeatureVFP2]>; |
| 120 | def : Processor<"mpcorenovfp", ARMV6Itineraries, [ArchV6]>; |
| 121 | def : Processor<"mpcore", ARMV6Itineraries, [ArchV6, FeatureVFP2]>; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 122 | |
Anton Korobeynikov | fbbf1ee | 2009-06-08 21:20:36 +0000 | [diff] [blame] | 123 | // V6T2 Processors. |
David Goodwin | ebb5cb9 | 2009-11-18 18:39:57 +0000 | [diff] [blame] | 124 | def : Processor<"arm1156t2-s", ARMV6Itineraries, |
| 125 | [ArchV6T2, FeatureThumb2]>; |
| 126 | def : Processor<"arm1156t2f-s", ARMV6Itineraries, |
| 127 | [ArchV6T2, FeatureThumb2, FeatureVFP2]>; |
Anton Korobeynikov | d4022c3 | 2009-05-29 23:41:08 +0000 | [diff] [blame] | 128 | |
Anton Korobeynikov | fbbf1ee | 2009-06-08 21:20:36 +0000 | [diff] [blame] | 129 | // V7 Processors. |
Evan Cheng | 6762d91 | 2009-07-21 18:54:14 +0000 | [diff] [blame] | 130 | def : Processor<"cortex-a8", CortexA8Itineraries, |
Jim Grosbach | 7ec7a0e | 2010-03-25 23:47:34 +0000 | [diff] [blame] | 131 | [ArchV7A, FeatureThumb2, FeatureNEON, FeatureHasSlowVMLx, |
Jim Grosbach | 2940213 | 2010-05-05 23:44:43 +0000 | [diff] [blame^] | 132 | FeatureNEONForFP, FeatureT2ExtractPack]>; |
Anton Korobeynikov | 2eeeff8 | 2010-04-07 18:19:18 +0000 | [diff] [blame] | 133 | def : Processor<"cortex-a9", CortexA9Itineraries, |
Jim Grosbach | 2940213 | 2010-05-05 23:44:43 +0000 | [diff] [blame^] | 134 | [ArchV7A, FeatureThumb2, FeatureNEON, FeatureT2ExtractPack]>; |
| 135 | def : ProcNoItin<"cortex-m3", [ArchV7M, FeatureThumb2, FeatureHWDiv]>; |
| 136 | def : ProcNoItin<"cortex-m4", [ArchV7M, FeatureThumb2, FeatureHWDiv]>; |
Anton Korobeynikov | 6d7d2aa | 2009-05-23 19:51:43 +0000 | [diff] [blame] | 137 | |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 138 | //===----------------------------------------------------------------------===// |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 139 | // Register File Description |
| 140 | //===----------------------------------------------------------------------===// |
| 141 | |
| 142 | include "ARMRegisterInfo.td" |
| 143 | |
Bob Wilson | 1f595bb | 2009-04-17 19:07:39 +0000 | [diff] [blame] | 144 | include "ARMCallingConv.td" |
| 145 | |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 146 | //===----------------------------------------------------------------------===// |
| 147 | // Instruction Descriptions |
| 148 | //===----------------------------------------------------------------------===// |
| 149 | |
| 150 | include "ARMInstrInfo.td" |
| 151 | |
Jakob Stoklund Olesen | fddb766 | 2010-04-05 03:10:20 +0000 | [diff] [blame] | 152 | def ARMInstrInfo : InstrInfo; |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 153 | |
| 154 | //===----------------------------------------------------------------------===// |
| 155 | // Declare the target which we are implementing |
| 156 | //===----------------------------------------------------------------------===// |
| 157 | |
| 158 | def ARM : Target { |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 159 | // Pull in Instruction Info: |
| 160 | let InstructionSet = ARMInstrInfo; |
| 161 | } |