blob: 6486a608e46d5585a2cc86c839c7dd9ca0d60220 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===- ARM.td - Describe the ARM Target Machine -----------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
Dan Gohmanf17a25c2007-07-18 16:29:46 +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 Cheng301aaf52008-11-24 07:34:46 +000017include "llvm/Target/Target.td"
Dan Gohmanf17a25c2007-07-18 16:29:46 +000018
19//===----------------------------------------------------------------------===//
20// 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 Korobeynikov48000e92009-06-08 21:20:36 +000031def ArchV6T2 : SubtargetFeature<"v6t2", "ARMArchVersion", "V6T2",
32 "ARM v6t2">;
Anton Korobeynikov1bf0f082009-05-23 19:51:43 +000033def ArchV7A : SubtargetFeature<"v7a", "ARMArchVersion", "V7A",
34 "ARM v7A">;
35def FeatureVFP2 : SubtargetFeature<"vfp2", "ARMFPUType", "VFPv2",
Anton Korobeynikovf2e14752009-05-29 23:41:08 +000036 "Enable VFP2 instructions">;
Anton Korobeynikov1bf0f082009-05-23 19:51:43 +000037def FeatureVFP3 : SubtargetFeature<"vfp3", "ARMFPUType", "VFPv3",
Anton Korobeynikovf2e14752009-05-29 23:41:08 +000038 "Enable VFP3 instructions">;
Anton Korobeynikov1bf0f082009-05-23 19:51:43 +000039def FeatureNEON : SubtargetFeature<"neon", "ARMFPUType", "NEON",
Anton Korobeynikovf2e14752009-05-29 23:41:08 +000040 "Enable NEON instructions">;
41def FeatureThumb2 : SubtargetFeature<"thumb2", "ThumbMode", "Thumb2",
42 "Enable Thumb2 instructions">;
Anton Korobeynikova8f50d82010-03-14 18:42:38 +000043def FeatureFP16 : SubtargetFeature<"fp16", "HasFP16", "true",
44 "Enable half-precision floating point">;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000045
Jim Grosbachdc748c22010-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.
Jim Grosbach20d1d652010-03-25 23:47:34 +000052def FeatureHasSlowVMLx : SubtargetFeature<"vmlx", "SlowVMLx", "true",
53 "Disable VFP MAC instructions">;
54// Some processors benefit from using NEON instructions for scalar
55// single-precision FP operations.
56def FeatureNEONForFP : SubtargetFeature<"neonfp", "UseNEONForSinglePrecisionFP",
57 "true",
58 "Use NEON for single precision FP">;
59
Jim Grosbachdc748c22010-03-25 23:11:16 +000060
Dan Gohmanf17a25c2007-07-18 16:29:46 +000061//===----------------------------------------------------------------------===//
62// ARM Processors supported.
63//
64
Evan Cheng88e78d22009-06-19 01:51:50 +000065include "ARMSchedule.td"
66
67class ProcNoItin<string Name, list<SubtargetFeature> Features>
68 : Processor<Name, GenericItineraries, Features>;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000069
70// V4 Processors.
Evan Cheng88e78d22009-06-19 01:51:50 +000071def : ProcNoItin<"generic", []>;
72def : ProcNoItin<"arm8", []>;
73def : ProcNoItin<"arm810", []>;
74def : ProcNoItin<"strongarm", []>;
75def : ProcNoItin<"strongarm110", []>;
76def : ProcNoItin<"strongarm1100", []>;
77def : ProcNoItin<"strongarm1110", []>;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000078
79// V4T Processors.
Evan Cheng88e78d22009-06-19 01:51:50 +000080def : ProcNoItin<"arm7tdmi", [ArchV4T]>;
81def : ProcNoItin<"arm7tdmi-s", [ArchV4T]>;
82def : ProcNoItin<"arm710t", [ArchV4T]>;
83def : ProcNoItin<"arm720t", [ArchV4T]>;
84def : ProcNoItin<"arm9", [ArchV4T]>;
85def : ProcNoItin<"arm9tdmi", [ArchV4T]>;
86def : ProcNoItin<"arm920", [ArchV4T]>;
87def : ProcNoItin<"arm920t", [ArchV4T]>;
88def : ProcNoItin<"arm922t", [ArchV4T]>;
89def : ProcNoItin<"arm940t", [ArchV4T]>;
90def : ProcNoItin<"ep9312", [ArchV4T]>;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000091
92// V5T Processors.
Evan Cheng88e78d22009-06-19 01:51:50 +000093def : ProcNoItin<"arm10tdmi", [ArchV5T]>;
94def : ProcNoItin<"arm1020t", [ArchV5T]>;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000095
96// V5TE Processors.
Evan Cheng88e78d22009-06-19 01:51:50 +000097def : ProcNoItin<"arm9e", [ArchV5TE]>;
98def : ProcNoItin<"arm926ej-s", [ArchV5TE]>;
99def : ProcNoItin<"arm946e-s", [ArchV5TE]>;
100def : ProcNoItin<"arm966e-s", [ArchV5TE]>;
101def : ProcNoItin<"arm968e-s", [ArchV5TE]>;
102def : ProcNoItin<"arm10e", [ArchV5TE]>;
103def : ProcNoItin<"arm1020e", [ArchV5TE]>;
104def : ProcNoItin<"arm1022e", [ArchV5TE]>;
105def : ProcNoItin<"xscale", [ArchV5TE]>;
106def : ProcNoItin<"iwmmxt", [ArchV5TE]>;
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000107
108// V6 Processors.
David Goodwineb368aa2009-11-18 18:39:57 +0000109def : Processor<"arm1136j-s", ARMV6Itineraries, [ArchV6]>;
Jim Grosbach58bf0ee2010-04-01 00:13:43 +0000110def : Processor<"arm1136jf-s", ARMV6Itineraries, [ArchV6, FeatureVFP2,
111 FeatureHasSlowVMLx]>;
David Goodwineb368aa2009-11-18 18:39:57 +0000112def : Processor<"arm1176jz-s", ARMV6Itineraries, [ArchV6]>;
113def : Processor<"arm1176jzf-s", ARMV6Itineraries, [ArchV6, FeatureVFP2]>;
114def : Processor<"mpcorenovfp", ARMV6Itineraries, [ArchV6]>;
115def : Processor<"mpcore", ARMV6Itineraries, [ArchV6, FeatureVFP2]>;
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000116
Anton Korobeynikov48000e92009-06-08 21:20:36 +0000117// V6T2 Processors.
David Goodwineb368aa2009-11-18 18:39:57 +0000118def : Processor<"arm1156t2-s", ARMV6Itineraries,
119 [ArchV6T2, FeatureThumb2]>;
120def : Processor<"arm1156t2f-s", ARMV6Itineraries,
121 [ArchV6T2, FeatureThumb2, FeatureVFP2]>;
Anton Korobeynikovf2e14752009-05-29 23:41:08 +0000122
Anton Korobeynikov48000e92009-06-08 21:20:36 +0000123// V7 Processors.
Evan Cheng0d68fde2009-07-21 18:54:14 +0000124def : Processor<"cortex-a8", CortexA8Itineraries,
Jim Grosbach20d1d652010-03-25 23:47:34 +0000125 [ArchV7A, FeatureThumb2, FeatureNEON, FeatureHasSlowVMLx,
126 FeatureNEONForFP]>;
David Goodwin78caa122009-09-23 21:38:08 +0000127def : ProcNoItin<"cortex-a9", [ArchV7A, FeatureThumb2, FeatureNEON]>;
Anton Korobeynikov1bf0f082009-05-23 19:51:43 +0000128
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000129//===----------------------------------------------------------------------===//
130// Register File Description
131//===----------------------------------------------------------------------===//
132
133include "ARMRegisterInfo.td"
134
Bob Wilsonfd451172009-04-17 19:07:39 +0000135include "ARMCallingConv.td"
136
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000137//===----------------------------------------------------------------------===//
138// Instruction Descriptions
139//===----------------------------------------------------------------------===//
140
141include "ARMInstrInfo.td"
142
143def ARMInstrInfo : InstrInfo {
144 // Define how we want to layout our target-specific information field.
145 let TSFlagsFields = ["AddrModeBits",
146 "SizeFlag",
147 "IndexModeBits",
Evan Cheng9aa4cd32009-07-08 01:46:35 +0000148 "Form",
Anton Korobeynikoveed9c142009-11-02 00:10:38 +0000149 "isUnaryDataProc",
150 "canXformTo16Bit",
151 "Dom"];
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000152 let TSFlagsShifts = [0,
153 4,
154 7,
Evan Chenga7b3e7c2007-08-07 01:37:15 +0000155 9,
Anton Korobeynikoveed9c142009-11-02 00:10:38 +0000156 15,
157 16,
158 17];
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000159}
160
161//===----------------------------------------------------------------------===//
162// Declare the target which we are implementing
163//===----------------------------------------------------------------------===//
164
165def ARM : Target {
166 // Pull in Instruction Info:
167 let InstructionSet = ARMInstrInfo;
168}