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">; |
| 35 | def FeatureVFP2 : SubtargetFeature<"vfp2", "ARMFPUType", "VFPv2", |
Anton Korobeynikov | d4022c3 | 2009-05-29 23:41:08 +0000 | [diff] [blame] | 36 | "Enable VFP2 instructions">; |
Anton Korobeynikov | 6d7d2aa | 2009-05-23 19:51:43 +0000 | [diff] [blame] | 37 | def FeatureVFP3 : SubtargetFeature<"vfp3", "ARMFPUType", "VFPv3", |
Anton Korobeynikov | d4022c3 | 2009-05-29 23:41:08 +0000 | [diff] [blame] | 38 | "Enable VFP3 instructions">; |
Anton Korobeynikov | 6d7d2aa | 2009-05-23 19:51:43 +0000 | [diff] [blame] | 39 | def FeatureNEON : SubtargetFeature<"neon", "ARMFPUType", "NEON", |
Anton Korobeynikov | d4022c3 | 2009-05-29 23:41:08 +0000 | [diff] [blame] | 40 | "Enable NEON instructions">; |
| 41 | def FeatureThumb2 : SubtargetFeature<"thumb2", "ThumbMode", "Thumb2", |
| 42 | "Enable Thumb2 instructions">; |
David Goodwin | 1f0e404 | 2009-08-05 16:01:19 +0000 | [diff] [blame] | 43 | def FeatureNEONFP : SubtargetFeature<"neonfp", "UseNEONForSinglePrecisionFP", |
| 44 | "true", |
| 45 | "Use NEON for single-precision FP">; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 46 | |
| 47 | //===----------------------------------------------------------------------===// |
| 48 | // ARM Processors supported. |
| 49 | // |
| 50 | |
Evan Cheng | 8557c2b | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 51 | include "ARMSchedule.td" |
| 52 | |
| 53 | class ProcNoItin<string Name, list<SubtargetFeature> Features> |
| 54 | : Processor<Name, GenericItineraries, Features>; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 55 | |
| 56 | // V4 Processors. |
Evan Cheng | 8557c2b | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 57 | def : ProcNoItin<"generic", []>; |
| 58 | def : ProcNoItin<"arm8", []>; |
| 59 | def : ProcNoItin<"arm810", []>; |
| 60 | def : ProcNoItin<"strongarm", []>; |
| 61 | def : ProcNoItin<"strongarm110", []>; |
| 62 | def : ProcNoItin<"strongarm1100", []>; |
| 63 | def : ProcNoItin<"strongarm1110", []>; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 64 | |
| 65 | // V4T Processors. |
Evan Cheng | 8557c2b | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 66 | def : ProcNoItin<"arm7tdmi", [ArchV4T]>; |
| 67 | def : ProcNoItin<"arm7tdmi-s", [ArchV4T]>; |
| 68 | def : ProcNoItin<"arm710t", [ArchV4T]>; |
| 69 | def : ProcNoItin<"arm720t", [ArchV4T]>; |
| 70 | def : ProcNoItin<"arm9", [ArchV4T]>; |
| 71 | def : ProcNoItin<"arm9tdmi", [ArchV4T]>; |
| 72 | def : ProcNoItin<"arm920", [ArchV4T]>; |
| 73 | def : ProcNoItin<"arm920t", [ArchV4T]>; |
| 74 | def : ProcNoItin<"arm922t", [ArchV4T]>; |
| 75 | def : ProcNoItin<"arm940t", [ArchV4T]>; |
| 76 | def : ProcNoItin<"ep9312", [ArchV4T]>; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 77 | |
| 78 | // V5T Processors. |
Evan Cheng | 8557c2b | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 79 | def : ProcNoItin<"arm10tdmi", [ArchV5T]>; |
| 80 | def : ProcNoItin<"arm1020t", [ArchV5T]>; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 81 | |
| 82 | // V5TE Processors. |
Evan Cheng | 8557c2b | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 83 | def : ProcNoItin<"arm9e", [ArchV5TE]>; |
| 84 | def : ProcNoItin<"arm926ej-s", [ArchV5TE]>; |
| 85 | def : ProcNoItin<"arm946e-s", [ArchV5TE]>; |
| 86 | def : ProcNoItin<"arm966e-s", [ArchV5TE]>; |
| 87 | def : ProcNoItin<"arm968e-s", [ArchV5TE]>; |
| 88 | def : ProcNoItin<"arm10e", [ArchV5TE]>; |
| 89 | def : ProcNoItin<"arm1020e", [ArchV5TE]>; |
| 90 | def : ProcNoItin<"arm1022e", [ArchV5TE]>; |
| 91 | def : ProcNoItin<"xscale", [ArchV5TE]>; |
| 92 | def : ProcNoItin<"iwmmxt", [ArchV5TE]>; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 93 | |
| 94 | // V6 Processors. |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame^] | 95 | def : ProcNoItin<"arm1136j-s", [ArchV6]>; |
| 96 | def : ProcNoItin<"arm1136jf-s", [ArchV6, FeatureVFP2]>; |
| 97 | def : ProcNoItin<"arm1176jz-s", [ArchV6]>; |
| 98 | def : ProcNoItin<"arm1176jzf-s", [ArchV6, FeatureVFP2]>; |
| 99 | def : ProcNoItin<"mpcorenovfp", [ArchV6]>; |
| 100 | def : ProcNoItin<"mpcore", [ArchV6, FeatureVFP2]>; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 101 | |
Anton Korobeynikov | fbbf1ee | 2009-06-08 21:20:36 +0000 | [diff] [blame] | 102 | // V6T2 Processors. |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame^] | 103 | def : ProcNoItin<"arm1156t2-s", [ArchV6T2, FeatureThumb2]>; |
| 104 | def : ProcNoItin<"arm1156t2f-s", [ArchV6T2, FeatureThumb2, FeatureVFP2]>; |
Anton Korobeynikov | d4022c3 | 2009-05-29 23:41:08 +0000 | [diff] [blame] | 105 | |
Anton Korobeynikov | fbbf1ee | 2009-06-08 21:20:36 +0000 | [diff] [blame] | 106 | // V7 Processors. |
Evan Cheng | 6762d91 | 2009-07-21 18:54:14 +0000 | [diff] [blame] | 107 | def : Processor<"cortex-a8", CortexA8Itineraries, |
David Goodwin | 767a952 | 2009-08-07 23:32:33 +0000 | [diff] [blame] | 108 | [ArchV7A, FeatureThumb2, FeatureNEON, FeatureNEONFP]>; |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame^] | 109 | def : ProcNoItin<"cortex-a9", [ArchV7A, FeatureThumb2, FeatureNEON]>; |
Anton Korobeynikov | 6d7d2aa | 2009-05-23 19:51:43 +0000 | [diff] [blame] | 110 | |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 111 | //===----------------------------------------------------------------------===// |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 112 | // Register File Description |
| 113 | //===----------------------------------------------------------------------===// |
| 114 | |
| 115 | include "ARMRegisterInfo.td" |
| 116 | |
Bob Wilson | 1f595bb | 2009-04-17 19:07:39 +0000 | [diff] [blame] | 117 | include "ARMCallingConv.td" |
| 118 | |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 119 | //===----------------------------------------------------------------------===// |
| 120 | // Instruction Descriptions |
| 121 | //===----------------------------------------------------------------------===// |
| 122 | |
| 123 | include "ARMInstrInfo.td" |
| 124 | |
| 125 | def ARMInstrInfo : InstrInfo { |
| 126 | // Define how we want to layout our target-specific information field. |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 127 | let TSFlagsFields = ["AddrModeBits", |
| 128 | "SizeFlag", |
| 129 | "IndexModeBits", |
Evan Cheng | 34a0fa3 | 2009-07-08 01:46:35 +0000 | [diff] [blame] | 130 | "Form", |
| 131 | "isUnaryDataProc"]; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 132 | let TSFlagsShifts = [0, |
| 133 | 4, |
| 134 | 7, |
Evan Cheng | 0ff94f7 | 2007-08-07 01:37:15 +0000 | [diff] [blame] | 135 | 9, |
Evan Cheng | 34a0fa3 | 2009-07-08 01:46:35 +0000 | [diff] [blame] | 136 | 15]; |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | //===----------------------------------------------------------------------===// |
| 140 | // Declare the target which we are implementing |
| 141 | //===----------------------------------------------------------------------===// |
| 142 | |
| 143 | def ARM : Target { |
Rafael Espindola | 7bc59bc | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 144 | // Pull in Instruction Info: |
| 145 | let InstructionSet = ARMInstrInfo; |
| 146 | } |