blob: 9001e5033c7dba44fd91ced26af8bb1a8aa05d48 [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">;
Evan Chenga8e29892007-01-19 07:51:42 +000043
44//===----------------------------------------------------------------------===//
45// ARM Processors supported.
46//
47
Evan Cheng8557c2b2009-06-19 01:51:50 +000048include "ARMSchedule.td"
49
50class ProcNoItin<string Name, list<SubtargetFeature> Features>
51 : Processor<Name, GenericItineraries, Features>;
Evan Chenga8e29892007-01-19 07:51:42 +000052
53// V4 Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +000054def : ProcNoItin<"generic", []>;
55def : ProcNoItin<"arm8", []>;
56def : ProcNoItin<"arm810", []>;
57def : ProcNoItin<"strongarm", []>;
58def : ProcNoItin<"strongarm110", []>;
59def : ProcNoItin<"strongarm1100", []>;
60def : ProcNoItin<"strongarm1110", []>;
Evan Chenga8e29892007-01-19 07:51:42 +000061
62// V4T Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +000063def : ProcNoItin<"arm7tdmi", [ArchV4T]>;
64def : ProcNoItin<"arm7tdmi-s", [ArchV4T]>;
65def : ProcNoItin<"arm710t", [ArchV4T]>;
66def : ProcNoItin<"arm720t", [ArchV4T]>;
67def : ProcNoItin<"arm9", [ArchV4T]>;
68def : ProcNoItin<"arm9tdmi", [ArchV4T]>;
69def : ProcNoItin<"arm920", [ArchV4T]>;
70def : ProcNoItin<"arm920t", [ArchV4T]>;
71def : ProcNoItin<"arm922t", [ArchV4T]>;
72def : ProcNoItin<"arm940t", [ArchV4T]>;
73def : ProcNoItin<"ep9312", [ArchV4T]>;
Evan Chenga8e29892007-01-19 07:51:42 +000074
75// V5T Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +000076def : ProcNoItin<"arm10tdmi", [ArchV5T]>;
77def : ProcNoItin<"arm1020t", [ArchV5T]>;
Evan Chenga8e29892007-01-19 07:51:42 +000078
79// V5TE Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +000080def : ProcNoItin<"arm9e", [ArchV5TE]>;
81def : ProcNoItin<"arm926ej-s", [ArchV5TE]>;
82def : ProcNoItin<"arm946e-s", [ArchV5TE]>;
83def : ProcNoItin<"arm966e-s", [ArchV5TE]>;
84def : ProcNoItin<"arm968e-s", [ArchV5TE]>;
85def : ProcNoItin<"arm10e", [ArchV5TE]>;
86def : ProcNoItin<"arm1020e", [ArchV5TE]>;
87def : ProcNoItin<"arm1022e", [ArchV5TE]>;
88def : ProcNoItin<"xscale", [ArchV5TE]>;
89def : ProcNoItin<"iwmmxt", [ArchV5TE]>;
Evan Chenga8e29892007-01-19 07:51:42 +000090
91// V6 Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +000092def : Processor<"arm1136j-s", V6Itineraries,
93 [ArchV6]>;
94def : Processor<"arm1136jf-s", V6Itineraries,
95 [ArchV6, FeatureVFP2]>;
96def : Processor<"arm1176jz-s", V6Itineraries,
97 [ArchV6]>;
98def : Processor<"arm1176jzf-s", V6Itineraries,
99 [ArchV6, FeatureVFP2]>;
100def : Processor<"mpcorenovfp", V6Itineraries,
101 [ArchV6]>;
102def : Processor<"mpcore", V6Itineraries,
103 [ArchV6, FeatureVFP2]>;
Evan Chenga8e29892007-01-19 07:51:42 +0000104
Anton Korobeynikovfbbf1ee2009-06-08 21:20:36 +0000105// V6T2 Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +0000106def : Processor<"arm1156t2-s", V6Itineraries,
107 [ArchV6T2, FeatureThumb2]>;
108def : Processor<"arm1156t2f-s", V6Itineraries,
109 [ArchV6T2, FeatureThumb2, FeatureVFP2]>;
Anton Korobeynikovd4022c32009-05-29 23:41:08 +0000110
Anton Korobeynikovfbbf1ee2009-06-08 21:20:36 +0000111// V7 Processors.
Evan Cheng8557c2b2009-06-19 01:51:50 +0000112def : ProcNoItin<"cortex-a8", [ArchV7A, FeatureThumb2, FeatureNEON]>;
113def : ProcNoItin<"cortex-a9", [ArchV7A, FeatureThumb2, FeatureNEON]>;
Anton Korobeynikov6d7d2aa2009-05-23 19:51:43 +0000114
Evan Chenga8e29892007-01-19 07:51:42 +0000115//===----------------------------------------------------------------------===//
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000116// Register File Description
117//===----------------------------------------------------------------------===//
118
119include "ARMRegisterInfo.td"
120
Bob Wilson1f595bb2009-04-17 19:07:39 +0000121include "ARMCallingConv.td"
122
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000123//===----------------------------------------------------------------------===//
124// Instruction Descriptions
125//===----------------------------------------------------------------------===//
126
127include "ARMInstrInfo.td"
128
129def ARMInstrInfo : InstrInfo {
130 // Define how we want to layout our target-specific information field.
Evan Chenga8e29892007-01-19 07:51:42 +0000131 let TSFlagsFields = ["AddrModeBits",
132 "SizeFlag",
133 "IndexModeBits",
Evan Chengedda31c2008-11-05 18:35:52 +0000134 "isUnaryDataProc",
Evan Cheng0ff94f72007-08-07 01:37:15 +0000135 "Form"];
Evan Chenga8e29892007-01-19 07:51:42 +0000136 let TSFlagsShifts = [0,
137 4,
138 7,
Evan Cheng0ff94f72007-08-07 01:37:15 +0000139 9,
Evan Chengd87293c2008-11-06 08:47:38 +0000140 10];
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000141}
142
143//===----------------------------------------------------------------------===//
144// Declare the target which we are implementing
145//===----------------------------------------------------------------------===//
146
147def ARM : Target {
Rafael Espindola7bc59bc2006-05-14 22:18:28 +0000148 // Pull in Instruction Info:
149 let InstructionSet = ARMInstrInfo;
150}