blob: 50d54b436e076aa4c4dd0c1e222c7a9ccfcdb783 [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">;
35def FeatureVFP2 : SubtargetFeature<"vfp2", "ARMFPUType", "VFPv2",
Anton Korobeynikovd4022c32009-05-29 23:41:08 +000036 "Enable VFP2 instructions">;
Anton Korobeynikov6d7d2aa2009-05-23 19:51:43 +000037def FeatureVFP3 : SubtargetFeature<"vfp3", "ARMFPUType", "VFPv3",
Anton Korobeynikovd4022c32009-05-29 23:41:08 +000038 "Enable VFP3 instructions">;
Anton Korobeynikov6d7d2aa2009-05-23 19:51:43 +000039def FeatureNEON : SubtargetFeature<"neon", "ARMFPUType", "NEON",
Anton Korobeynikovd4022c32009-05-29 23:41:08 +000040 "Enable NEON instructions">;
41def FeatureThumb2 : SubtargetFeature<"thumb2", "ThumbMode", "Thumb2",
42 "Enable Thumb2 instructions">;
Anton Korobeynikov631379e2010-03-14 18:42:38 +000043def FeatureFP16 : SubtargetFeature<"fp16", "HasFP16", "true",
44 "Enable half-precision floating point">;
Evan Chenga8e29892007-01-19 07:51:42 +000045
Jim Grosbach6b2e8dc2010-03-25 23:11:16 +000046// Some processors have multiply-accumulate instructions that don't
47// play nicely with other VFP instructions, and it's generally better
48// to just not use them.
49// FIXME: Currently, this is only flagged for Cortex-A8. It may be true for
50// others as well. We should do more benchmarking and confirm one way or
51// the other.
52def HasSlowVMLx : SubtargetFeature<"vmlx", "SlowVMLx", "true",
53 "Disable VFP MAC instructions">;
54
Evan Chenga8e29892007-01-19 07:51:42 +000055//===----------------------------------------------------------------------===//
56// ARM Processors supported.
57//
58
Evan Cheng8557c2b2009-06-19 01:51:50 +000059include "ARMSchedule.td"
60
61class ProcNoItin<string Name, list<SubtargetFeature> Features>
62 : Processor<Name, GenericItineraries, Features>;
Evan Chenga8e29892007-01-19 07:51:42 +000063
64// V4 Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +000065def : ProcNoItin<"generic", []>;
66def : ProcNoItin<"arm8", []>;
67def : ProcNoItin<"arm810", []>;
68def : ProcNoItin<"strongarm", []>;
69def : ProcNoItin<"strongarm110", []>;
70def : ProcNoItin<"strongarm1100", []>;
71def : ProcNoItin<"strongarm1110", []>;
Evan Chenga8e29892007-01-19 07:51:42 +000072
73// V4T Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +000074def : ProcNoItin<"arm7tdmi", [ArchV4T]>;
75def : ProcNoItin<"arm7tdmi-s", [ArchV4T]>;
76def : ProcNoItin<"arm710t", [ArchV4T]>;
77def : ProcNoItin<"arm720t", [ArchV4T]>;
78def : ProcNoItin<"arm9", [ArchV4T]>;
79def : ProcNoItin<"arm9tdmi", [ArchV4T]>;
80def : ProcNoItin<"arm920", [ArchV4T]>;
81def : ProcNoItin<"arm920t", [ArchV4T]>;
82def : ProcNoItin<"arm922t", [ArchV4T]>;
83def : ProcNoItin<"arm940t", [ArchV4T]>;
84def : ProcNoItin<"ep9312", [ArchV4T]>;
Evan Chenga8e29892007-01-19 07:51:42 +000085
86// V5T Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +000087def : ProcNoItin<"arm10tdmi", [ArchV5T]>;
88def : ProcNoItin<"arm1020t", [ArchV5T]>;
Evan Chenga8e29892007-01-19 07:51:42 +000089
90// V5TE Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +000091def : ProcNoItin<"arm9e", [ArchV5TE]>;
92def : ProcNoItin<"arm926ej-s", [ArchV5TE]>;
93def : ProcNoItin<"arm946e-s", [ArchV5TE]>;
94def : ProcNoItin<"arm966e-s", [ArchV5TE]>;
95def : ProcNoItin<"arm968e-s", [ArchV5TE]>;
96def : ProcNoItin<"arm10e", [ArchV5TE]>;
97def : ProcNoItin<"arm1020e", [ArchV5TE]>;
98def : ProcNoItin<"arm1022e", [ArchV5TE]>;
99def : ProcNoItin<"xscale", [ArchV5TE]>;
100def : ProcNoItin<"iwmmxt", [ArchV5TE]>;
Evan Chenga8e29892007-01-19 07:51:42 +0000101
102// V6 Processors.
David Goodwinebb5cb92009-11-18 18:39:57 +0000103def : Processor<"arm1136j-s", ARMV6Itineraries, [ArchV6]>;
104def : Processor<"arm1136jf-s", ARMV6Itineraries, [ArchV6, FeatureVFP2]>;
105def : Processor<"arm1176jz-s", ARMV6Itineraries, [ArchV6]>;
106def : Processor<"arm1176jzf-s", ARMV6Itineraries, [ArchV6, FeatureVFP2]>;
107def : Processor<"mpcorenovfp", ARMV6Itineraries, [ArchV6]>;
108def : Processor<"mpcore", ARMV6Itineraries, [ArchV6, FeatureVFP2]>;
Evan Chenga8e29892007-01-19 07:51:42 +0000109
Anton Korobeynikovfbbf1ee2009-06-08 21:20:36 +0000110// V6T2 Processors.
David Goodwinebb5cb92009-11-18 18:39:57 +0000111def : Processor<"arm1156t2-s", ARMV6Itineraries,
112 [ArchV6T2, FeatureThumb2]>;
113def : Processor<"arm1156t2f-s", ARMV6Itineraries,
114 [ArchV6T2, FeatureThumb2, FeatureVFP2]>;
Anton Korobeynikovd4022c32009-05-29 23:41:08 +0000115
Anton Korobeynikovfbbf1ee2009-06-08 21:20:36 +0000116// V7 Processors.
Evan Cheng6762d912009-07-21 18:54:14 +0000117def : Processor<"cortex-a8", CortexA8Itineraries,
Jim Grosbach6b2e8dc2010-03-25 23:11:16 +0000118 [ArchV7A, FeatureThumb2, FeatureNEON, HasSlowVMLx]>;
David Goodwin127221f2009-09-23 21:38:08 +0000119def : ProcNoItin<"cortex-a9", [ArchV7A, FeatureThumb2, FeatureNEON]>;
Anton Korobeynikov6d7d2aa2009-05-23 19:51:43 +0000120
Evan Chenga8e29892007-01-19 07:51:42 +0000121//===----------------------------------------------------------------------===//
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000122// Register File Description
123//===----------------------------------------------------------------------===//
124
125include "ARMRegisterInfo.td"
126
Bob Wilson1f595bb2009-04-17 19:07:39 +0000127include "ARMCallingConv.td"
128
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000129//===----------------------------------------------------------------------===//
130// Instruction Descriptions
131//===----------------------------------------------------------------------===//
132
133include "ARMInstrInfo.td"
134
135def ARMInstrInfo : InstrInfo {
136 // Define how we want to layout our target-specific information field.
Evan Chenga8e29892007-01-19 07:51:42 +0000137 let TSFlagsFields = ["AddrModeBits",
138 "SizeFlag",
139 "IndexModeBits",
Evan Cheng34a0fa32009-07-08 01:46:35 +0000140 "Form",
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000141 "isUnaryDataProc",
142 "canXformTo16Bit",
143 "Dom"];
Evan Chenga8e29892007-01-19 07:51:42 +0000144 let TSFlagsShifts = [0,
145 4,
146 7,
Evan Cheng0ff94f72007-08-07 01:37:15 +0000147 9,
Anton Korobeynikovf95215f2009-11-02 00:10:38 +0000148 15,
149 16,
150 17];
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000151}
152
153//===----------------------------------------------------------------------===//
154// Declare the target which we are implementing
155//===----------------------------------------------------------------------===//
156
157def ARM : Target {
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000158 // Pull in Instruction Info:
159 let InstructionSet = ARMInstrInfo;
160}