blob: e76a47dff9dfebb0a0bf8584a46baf891c956f02 [file] [log] [blame]
Rafael Espindola7bc59bc2006-05-14 22:18:28 +00001//===- ARM.td - Describe the ARM Target Machine -----------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
Rafael Espindola7bc59bc2006-05-14 22:18:28 +00006// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10//
11//===----------------------------------------------------------------------===//
12
13//===----------------------------------------------------------------------===//
14// Target-independent interfaces which we are implementing
15//===----------------------------------------------------------------------===//
16
Evan Cheng027fdbe2008-11-24 07:34:46 +000017include "llvm/Target/Target.td"
Rafael Espindola7bc59bc2006-05-14 22:18:28 +000018
19//===----------------------------------------------------------------------===//
Evan Chenga8e29892007-01-19 07:51:42 +000020// ARM Subtarget features.
21//
22
23def ArchV4T : SubtargetFeature<"v4t", "ARMArchVersion", "V4T",
24 "ARM v4T">;
25def ArchV5T : SubtargetFeature<"v5t", "ARMArchVersion", "V5T",
26 "ARM v5T">;
27def ArchV5TE : SubtargetFeature<"v5te", "ARMArchVersion", "V5TE",
28 "ARM v5TE, v5TEj, v5TExp">;
29def ArchV6 : SubtargetFeature<"v6", "ARMArchVersion", "V6",
30 "ARM v6">;
Anton Korobeynikovfbbf1ee2009-06-08 21:20:36 +000031def ArchV6T2 : SubtargetFeature<"v6t2", "ARMArchVersion", "V6T2",
32 "ARM v6t2">;
Anton Korobeynikov6d7d2aa2009-05-23 19:51:43 +000033def ArchV7A : SubtargetFeature<"v7a", "ARMArchVersion", "V7A",
34 "ARM v7A">;
Jim Grosbachb1dc3932010-05-05 20:44:35 +000035def ArchV7M : SubtargetFeature<"v7m", "ARMArchVersion", "V7M",
36 "ARM v7M">;
Anton Korobeynikov6d7d2aa2009-05-23 19:51:43 +000037def FeatureVFP2 : SubtargetFeature<"vfp2", "ARMFPUType", "VFPv2",
Anton Korobeynikovd4022c32009-05-29 23:41:08 +000038 "Enable VFP2 instructions">;
Anton Korobeynikov6d7d2aa2009-05-23 19:51:43 +000039def FeatureVFP3 : SubtargetFeature<"vfp3", "ARMFPUType", "VFPv3",
Anton Korobeynikovd4022c32009-05-29 23:41:08 +000040 "Enable VFP3 instructions">;
Anton Korobeynikov6d7d2aa2009-05-23 19:51:43 +000041def FeatureNEON : SubtargetFeature<"neon", "ARMFPUType", "NEON",
Anton Korobeynikovd4022c32009-05-29 23:41:08 +000042 "Enable NEON instructions">;
43def FeatureThumb2 : SubtargetFeature<"thumb2", "ThumbMode", "Thumb2",
44 "Enable Thumb2 instructions">;
Anton Korobeynikov631379e2010-03-14 18:42:38 +000045def FeatureFP16 : SubtargetFeature<"fp16", "HasFP16", "true",
46 "Enable half-precision floating point">;
Jim Grosbach29402132010-05-05 23:44:43 +000047def FeatureHWDiv : SubtargetFeature<"hwdiv", "HasHardwareDivide", "true",
48 "Enable divide instructions">;
49def FeatureT2ExtractPack: SubtargetFeature<"t2xtpk", "HasT2ExtractPack", "true",
50 "Enable Thumb2 extract and pack instructions">;
Evan Cheng7a415992010-07-13 19:21:50 +000051def FeatureSlowFPBrcc : SubtargetFeature<"slow-fp-brcc", "SlowFPBrcc", "true",
52 "FP compare + branch is slow">;
Evan Chenga8e29892007-01-19 07:51:42 +000053
Jim Grosbach6b2e8dc2010-03-25 23:11:16 +000054// Some processors have multiply-accumulate instructions that don't
55// play nicely with other VFP instructions, and it's generally better
56// to just not use them.
57// FIXME: Currently, this is only flagged for Cortex-A8. It may be true for
58// others as well. We should do more benchmarking and confirm one way or
59// the other.
Jim Grosbach7ec7a0e2010-03-25 23:47:34 +000060def FeatureHasSlowVMLx : SubtargetFeature<"vmlx", "SlowVMLx", "true",
61 "Disable VFP MAC instructions">;
62// Some processors benefit from using NEON instructions for scalar
63// single-precision FP operations.
64def FeatureNEONForFP : SubtargetFeature<"neonfp", "UseNEONForSinglePrecisionFP",
65 "true",
66 "Use NEON for single precision FP">;
67
Evan Chenge44be632010-08-09 18:35:19 +000068// Disable 32-bit to 16-bit narrowing for experimentation.
69def FeaturePref32BitThumb : SubtargetFeature<"32bit", "Pref32BitThumb", "true",
70 "Prefer 32-bit Thumb instrs">;
Jim Grosbach6b2e8dc2010-03-25 23:11:16 +000071
Evan Chenga8e29892007-01-19 07:51:42 +000072//===----------------------------------------------------------------------===//
73// ARM Processors supported.
74//
75
Evan Cheng8557c2b2009-06-19 01:51:50 +000076include "ARMSchedule.td"
77
78class ProcNoItin<string Name, list<SubtargetFeature> Features>
79 : Processor<Name, GenericItineraries, Features>;
Evan Chenga8e29892007-01-19 07:51:42 +000080
81// V4 Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +000082def : ProcNoItin<"generic", []>;
83def : ProcNoItin<"arm8", []>;
84def : ProcNoItin<"arm810", []>;
85def : ProcNoItin<"strongarm", []>;
86def : ProcNoItin<"strongarm110", []>;
87def : ProcNoItin<"strongarm1100", []>;
88def : ProcNoItin<"strongarm1110", []>;
Evan Chenga8e29892007-01-19 07:51:42 +000089
90// V4T Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +000091def : ProcNoItin<"arm7tdmi", [ArchV4T]>;
92def : ProcNoItin<"arm7tdmi-s", [ArchV4T]>;
93def : ProcNoItin<"arm710t", [ArchV4T]>;
94def : ProcNoItin<"arm720t", [ArchV4T]>;
95def : ProcNoItin<"arm9", [ArchV4T]>;
96def : ProcNoItin<"arm9tdmi", [ArchV4T]>;
97def : ProcNoItin<"arm920", [ArchV4T]>;
98def : ProcNoItin<"arm920t", [ArchV4T]>;
99def : ProcNoItin<"arm922t", [ArchV4T]>;
100def : ProcNoItin<"arm940t", [ArchV4T]>;
101def : ProcNoItin<"ep9312", [ArchV4T]>;
Evan Chenga8e29892007-01-19 07:51:42 +0000102
103// V5T Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +0000104def : ProcNoItin<"arm10tdmi", [ArchV5T]>;
105def : ProcNoItin<"arm1020t", [ArchV5T]>;
Evan Chenga8e29892007-01-19 07:51:42 +0000106
107// V5TE Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +0000108def : ProcNoItin<"arm9e", [ArchV5TE]>;
109def : ProcNoItin<"arm926ej-s", [ArchV5TE]>;
110def : ProcNoItin<"arm946e-s", [ArchV5TE]>;
111def : ProcNoItin<"arm966e-s", [ArchV5TE]>;
112def : ProcNoItin<"arm968e-s", [ArchV5TE]>;
113def : ProcNoItin<"arm10e", [ArchV5TE]>;
114def : ProcNoItin<"arm1020e", [ArchV5TE]>;
115def : ProcNoItin<"arm1022e", [ArchV5TE]>;
116def : ProcNoItin<"xscale", [ArchV5TE]>;
117def : ProcNoItin<"iwmmxt", [ArchV5TE]>;
Evan Chenga8e29892007-01-19 07:51:42 +0000118
119// V6 Processors.
David Goodwinebb5cb92009-11-18 18:39:57 +0000120def : Processor<"arm1136j-s", ARMV6Itineraries, [ArchV6]>;
Jim Grosbach1118b5e2010-04-01 00:13:43 +0000121def : Processor<"arm1136jf-s", ARMV6Itineraries, [ArchV6, FeatureVFP2,
122 FeatureHasSlowVMLx]>;
David Goodwinebb5cb92009-11-18 18:39:57 +0000123def : Processor<"arm1176jz-s", ARMV6Itineraries, [ArchV6]>;
124def : Processor<"arm1176jzf-s", ARMV6Itineraries, [ArchV6, FeatureVFP2]>;
125def : Processor<"mpcorenovfp", ARMV6Itineraries, [ArchV6]>;
126def : Processor<"mpcore", ARMV6Itineraries, [ArchV6, FeatureVFP2]>;
Evan Chenga8e29892007-01-19 07:51:42 +0000127
Anton Korobeynikovfbbf1ee2009-06-08 21:20:36 +0000128// V6T2 Processors.
David Goodwinebb5cb92009-11-18 18:39:57 +0000129def : Processor<"arm1156t2-s", ARMV6Itineraries,
130 [ArchV6T2, FeatureThumb2]>;
131def : Processor<"arm1156t2f-s", ARMV6Itineraries,
132 [ArchV6T2, FeatureThumb2, FeatureVFP2]>;
Anton Korobeynikovd4022c32009-05-29 23:41:08 +0000133
Anton Korobeynikovfbbf1ee2009-06-08 21:20:36 +0000134// V7 Processors.
Evan Cheng6762d912009-07-21 18:54:14 +0000135def : Processor<"cortex-a8", CortexA8Itineraries,
Jim Grosbach7ec7a0e2010-03-25 23:47:34 +0000136 [ArchV7A, FeatureThumb2, FeatureNEON, FeatureHasSlowVMLx,
Evan Cheng7a415992010-07-13 19:21:50 +0000137 FeatureSlowFPBrcc, FeatureNEONForFP, FeatureT2ExtractPack]>;
Anton Korobeynikov2eeeff82010-04-07 18:19:18 +0000138def : Processor<"cortex-a9", CortexA9Itineraries,
Jim Grosbach29402132010-05-05 23:44:43 +0000139 [ArchV7A, FeatureThumb2, FeatureNEON, FeatureT2ExtractPack]>;
140def : ProcNoItin<"cortex-m3", [ArchV7M, FeatureThumb2, FeatureHWDiv]>;
141def : ProcNoItin<"cortex-m4", [ArchV7M, FeatureThumb2, FeatureHWDiv]>;
Anton Korobeynikov6d7d2aa2009-05-23 19:51:43 +0000142
Evan Chenga8e29892007-01-19 07:51:42 +0000143//===----------------------------------------------------------------------===//
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000144// Register File Description
145//===----------------------------------------------------------------------===//
146
147include "ARMRegisterInfo.td"
148
Bob Wilson1f595bb2009-04-17 19:07:39 +0000149include "ARMCallingConv.td"
150
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000151//===----------------------------------------------------------------------===//
152// Instruction Descriptions
153//===----------------------------------------------------------------------===//
154
155include "ARMInstrInfo.td"
156
Jakob Stoklund Olesenfddb7662010-04-05 03:10:20 +0000157def ARMInstrInfo : InstrInfo;
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000158
159//===----------------------------------------------------------------------===//
160// Declare the target which we are implementing
161//===----------------------------------------------------------------------===//
162
163def ARM : Target {
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000164 // Pull in Instruction Info:
165 let InstructionSet = ARMInstrInfo;
166}