blob: 46d56a4a543b9005eb2af7dc64c57ba89465be79 [file] [log] [blame]
Jia Liub22310f2012-02-18 12:03:15 +00001//===-- PPC.td - Describe the PowerPC Target Machine -------*- tablegen -*-===//
2//
Chris Lattner0921e3b2005-10-14 23:37:35 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Jia Liub22310f2012-02-18 12:03:15 +00007//
Chris Lattner0921e3b2005-10-14 23:37:35 +00008//===----------------------------------------------------------------------===//
9//
10// This is the top level entry point for the PowerPC target.
11//
12//===----------------------------------------------------------------------===//
13
14// Get the target-independent interfaces which we are implementing.
15//
Evan Cheng977e7be2008-11-24 07:34:46 +000016include "llvm/Target/Target.td"
Chris Lattner0921e3b2005-10-14 23:37:35 +000017
18//===----------------------------------------------------------------------===//
Jim Laskey13a19452005-10-22 08:04:24 +000019// PowerPC Subtarget features.
Jim Laskey74ab9962005-10-19 19:51:16 +000020//
21
Jim Laskey59e7a772006-12-12 20:57:08 +000022//===----------------------------------------------------------------------===//
23// CPU Directives //
24//===----------------------------------------------------------------------===//
25
Hal Finkel6fa56972011-10-17 04:03:49 +000026def Directive440 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_440", "">;
Jim Laskey59e7a772006-12-12 20:57:08 +000027def Directive601 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_601", "">;
28def Directive602 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_602", "">;
29def Directive603 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">;
30def Directive604 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">;
31def Directive620 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">;
32def Directive7400: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_7400", "">;
33def Directive750 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_750", "">;
34def Directive970 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_970", "">;
35def Directive32 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_32", "">;
36def Directive64 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_64", "">;
Hal Finkel9f9f8922012-04-01 19:22:40 +000037def DirectiveA2 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_A2", "">;
Hal Finkel742b5352012-08-28 16:12:39 +000038def DirectiveE500mc : SubtargetFeature<"", "DarwinDirective",
39 "PPC::DIR_E500mc", "">;
40def DirectiveE5500 : SubtargetFeature<"", "DarwinDirective",
41 "PPC::DIR_E5500", "">;
Bill Schmidt52742c22013-02-01 22:59:51 +000042def DirectivePwr3: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR3", "">;
43def DirectivePwr4: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR4", "">;
44def DirectivePwr5: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR5", "">;
45def DirectivePwr5x: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR5X", "">;
Hal Finkelf2b9c382012-06-11 15:43:08 +000046def DirectivePwr6: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR6", "">;
Bill Schmidt52742c22013-02-01 22:59:51 +000047def DirectivePwr6x: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR6X", "">;
Hal Finkelf2b9c382012-06-11 15:43:08 +000048def DirectivePwr7: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR7", "">;
Will Schmidt970ff642014-06-26 13:36:19 +000049def DirectivePwr8: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR8", "">;
Jim Laskey59e7a772006-12-12 20:57:08 +000050
Chris Lattnera35f3062006-06-16 17:34:12 +000051def Feature64Bit : SubtargetFeature<"64bit","Has64BitSupport", "true",
Chris Lattner0d4923b2005-10-23 05:28:51 +000052 "Enable 64-bit instructions">;
Chris Lattnera35f3062006-06-16 17:34:12 +000053def Feature64BitRegs : SubtargetFeature<"64bitregs","Use64BitRegs", "true",
54 "Enable 64-bit registers usage for ppc32 [beta]">;
Hal Finkel940ab932014-02-28 00:27:01 +000055def FeatureCRBits : SubtargetFeature<"crbits", "UseCRBits", "true",
56 "Use condition-register bits individually">;
Evan Chengd98701c2006-01-27 08:09:42 +000057def FeatureAltivec : SubtargetFeature<"altivec","HasAltivec", "true",
Chris Lattner0d4923b2005-10-23 05:28:51 +000058 "Enable Altivec instructions">;
Joerg Sonnenberger39f095a2014-08-07 12:18:21 +000059def FeatureSPE : SubtargetFeature<"spe","HasSPE", "true",
60 "Enable SPE instructions">;
Hal Finkelbfd3d082012-06-11 19:57:01 +000061def FeatureMFOCRF : SubtargetFeature<"mfocrf","HasMFOCRF", "true",
62 "Enable the MFOCRF instruction">;
Evan Chengd98701c2006-01-27 08:09:42 +000063def FeatureFSqrt : SubtargetFeature<"fsqrt","HasFSQRT", "true",
Hal Finkel49033792011-10-14 18:54:13 +000064 "Enable the fsqrt instruction">;
Hal Finkeldbc78e12013-08-19 05:01:02 +000065def FeatureFCPSGN : SubtargetFeature<"fcpsgn", "HasFCPSGN", "true",
66 "Enable the fcpsgn instruction">;
Hal Finkel2e103312013-04-03 04:01:11 +000067def FeatureFRE : SubtargetFeature<"fre", "HasFRE", "true",
68 "Enable the fre instruction">;
69def FeatureFRES : SubtargetFeature<"fres", "HasFRES", "true",
70 "Enable the fres instruction">;
71def FeatureFRSQRTE : SubtargetFeature<"frsqrte", "HasFRSQRTE", "true",
72 "Enable the frsqrte instruction">;
73def FeatureFRSQRTES : SubtargetFeature<"frsqrtes", "HasFRSQRTES", "true",
74 "Enable the frsqrtes instruction">;
75def FeatureRecipPrec : SubtargetFeature<"recipprec", "HasRecipPrec", "true",
76 "Assume higher precision reciprocal estimates">;
Chris Lattnerb9f35f02006-02-28 07:08:22 +000077def FeatureSTFIWX : SubtargetFeature<"stfiwx","HasSTFIWX", "true",
Hal Finkel49033792011-10-14 18:54:13 +000078 "Enable the stfiwx instruction">;
Hal Finkelbeb296b2013-03-31 10:12:51 +000079def FeatureLFIWAX : SubtargetFeature<"lfiwax","HasLFIWAX", "true",
80 "Enable the lfiwax instruction">;
Hal Finkelc20a08d2013-03-29 08:57:48 +000081def FeatureFPRND : SubtargetFeature<"fprnd", "HasFPRND", "true",
82 "Enable the fri[mnpz] instructions">;
Hal Finkelf6d45f22013-04-01 17:52:07 +000083def FeatureFPCVT : SubtargetFeature<"fpcvt", "HasFPCVT", "true",
84 "Enable fc[ft]* (unsigned and single-precision) and lfiwzx instructions">;
Hal Finkel460e94d2012-06-22 23:10:08 +000085def FeatureISEL : SubtargetFeature<"isel","HasISEL", "true",
86 "Enable the isel instruction">;
Hal Finkela4d07482013-03-28 13:29:47 +000087def FeaturePOPCNTD : SubtargetFeature<"popcntd","HasPOPCNTD", "true",
88 "Enable the popcnt[dw] instructions">;
Hal Finkel31d29562013-03-28 19:25:55 +000089def FeatureLDBRX : SubtargetFeature<"ldbrx","HasLDBRX", "true",
90 "Enable the ldbrx instruction">;
Hal Finkel6fa56972011-10-17 04:03:49 +000091def FeatureBookE : SubtargetFeature<"booke", "IsBookE", "true",
92 "Enable Book E instructions">;
Hal Finkelfe3368c2014-10-02 22:34:22 +000093def FeatureMSYNC : SubtargetFeature<"msync", "HasOnlyMSYNC", "true",
94 "Has only the msync instruction instead of sync",
95 [FeatureBookE]>;
Joerg Sonnenberger6ae087a2014-08-07 12:31:28 +000096def FeatureE500 : SubtargetFeature<"e500", "IsE500", "true",
Joerg Sonnenberger0b2ebcb2014-08-04 15:47:38 +000097 "Enable E500/E500mc instructions">;
98def FeaturePPC4xx : SubtargetFeature<"ppc4xx", "IsPPC4xx", "true",
99 "Enable PPC 4xx instructions">;
Joerg Sonnenberger74052102014-08-04 17:07:41 +0000100def FeaturePPC6xx : SubtargetFeature<"ppc6xx", "IsPPC6xx", "true",
101 "Enable PPC 6xx instructions">;
Hal Finkelefb305e2013-01-30 21:17:42 +0000102def FeatureQPX : SubtargetFeature<"qpx","HasQPX", "true",
103 "Enable QPX instructions">;
Eric Christopher081efcc2013-10-16 20:38:58 +0000104def FeatureVSX : SubtargetFeature<"vsx","HasVSX", "true",
Hal Finkel27774d92014-03-13 07:58:58 +0000105 "Enable VSX instructions",
106 [FeatureAltivec]>;
NAKAMURA Takumicc4487e2014-12-09 01:03:27 +0000107def FeatureP8Vector : SubtargetFeature<"power8-vector", "HasP8Vector", "true",
108 "Enable POWER8 vector instructions",
109 [FeatureVSX, FeatureAltivec]>;
Jim Laskey74ab9962005-10-19 19:51:16 +0000110
Hal Finkel0096dbd2013-09-12 14:40:06 +0000111def DeprecatedMFTB : SubtargetFeature<"", "DeprecatedMFTB", "true",
112 "Treat mftb as deprecated">;
113def DeprecatedDST : SubtargetFeature<"", "DeprecatedDST", "true",
114 "Treat vector data stream cache control instructions as deprecated">;
115
Bill Schmidtcc99a2f2013-02-01 23:10:09 +0000116// Note: Future features to add when support is extended to more
117// recent ISA levels:
118//
119// CMPB p6, p6x, p7 cmpb
120// DFP p6, p6x, p7 decimal floating-point instructions
Bill Schmidtcc99a2f2013-02-01 23:10:09 +0000121// POPCNTB p5 through p7 popcntb and related instructions
Bill Schmidtcc99a2f2013-02-01 23:10:09 +0000122
Jim Laskey74ab9962005-10-19 19:51:16 +0000123//===----------------------------------------------------------------------===//
Ulrich Weigand90a5de82014-07-28 13:09:28 +0000124// ABI Selection //
125//===----------------------------------------------------------------------===//
126
127def FeatureELFv1 : SubtargetFeature<"elfv1", "TargetABI", "PPC_ABI_ELFv1",
128 "Use the ELFv1 ABI">;
129
130def FeatureELFv2 : SubtargetFeature<"elfv2", "TargetABI", "PPC_ABI_ELFv2",
131 "Use the ELFv2 ABI">;
132
133//===----------------------------------------------------------------------===//
Hal Finkel654d43b2013-04-12 02:18:09 +0000134// Classes used for relation maps.
135//===----------------------------------------------------------------------===//
136// RecFormRel - Filter class used to relate non-record-form instructions with
137// their record-form variants.
138class RecFormRel;
139
Hal Finkel25e04542014-03-25 18:55:11 +0000140// AltVSXFMARel - Filter class used to relate the primary addend-killing VSX
141// FMA instruction forms with their corresponding factor-killing forms.
142class AltVSXFMARel {
143 bit IsVSXFMAAlt = 0;
144}
145
Hal Finkel654d43b2013-04-12 02:18:09 +0000146//===----------------------------------------------------------------------===//
147// Relation Map Definitions.
148//===----------------------------------------------------------------------===//
149
150def getRecordFormOpcode : InstrMapping {
151 let FilterClass = "RecFormRel";
152 // Instructions with the same BaseName and Interpretation64Bit values
153 // form a row.
154 let RowFields = ["BaseName", "Interpretation64Bit"];
155 // Instructions with the same RC value form a column.
156 let ColFields = ["RC"];
157 // The key column are the non-record-form instructions.
158 let KeyCol = ["0"];
159 // Value columns RC=1
160 let ValueCols = [["1"]];
161}
162
163def getNonRecordFormOpcode : InstrMapping {
164 let FilterClass = "RecFormRel";
165 // Instructions with the same BaseName and Interpretation64Bit values
166 // form a row.
167 let RowFields = ["BaseName", "Interpretation64Bit"];
168 // Instructions with the same RC value form a column.
169 let ColFields = ["RC"];
170 // The key column are the record-form instructions.
171 let KeyCol = ["1"];
172 // Value columns are RC=0
173 let ValueCols = [["0"]];
174}
175
Hal Finkel25e04542014-03-25 18:55:11 +0000176def getAltVSXFMAOpcode : InstrMapping {
177 let FilterClass = "AltVSXFMARel";
178 // Instructions with the same BaseName and Interpretation64Bit values
179 // form a row.
180 let RowFields = ["BaseName"];
181 // Instructions with the same RC value form a column.
182 let ColFields = ["IsVSXFMAAlt"];
183 // The key column are the (default) addend-killing instructions.
184 let KeyCol = ["0"];
185 // Value columns IsVSXFMAAlt=1
186 let ValueCols = [["1"]];
187}
188
Hal Finkel654d43b2013-04-12 02:18:09 +0000189//===----------------------------------------------------------------------===//
Chris Lattnera389f0d2005-10-23 22:08:13 +0000190// Register File Description
191//===----------------------------------------------------------------------===//
192
193include "PPCRegisterInfo.td"
194include "PPCSchedule.td"
195include "PPCInstrInfo.td"
196
197//===----------------------------------------------------------------------===//
198// PowerPC processors supported.
Jim Laskey74ab9962005-10-19 19:51:16 +0000199//
200
Jim Laskey59e7a772006-12-12 20:57:08 +0000201def : Processor<"generic", G3Itineraries, [Directive32]>;
Hal Finkel5a7162f2013-11-29 06:32:17 +0000202def : ProcessorModel<"440", PPC440Model, [Directive440, FeatureISEL,
203 FeatureFRES, FeatureFRSQRTE,
Hal Finkelfe3368c2014-10-02 22:34:22 +0000204 FeatureBookE, FeatureMSYNC,
205 DeprecatedMFTB]>;
Hal Finkel5a7162f2013-11-29 06:32:17 +0000206def : ProcessorModel<"450", PPC440Model, [Directive440, FeatureISEL,
207 FeatureFRES, FeatureFRSQRTE,
Hal Finkelfe3368c2014-10-02 22:34:22 +0000208 FeatureBookE, FeatureMSYNC,
209 DeprecatedMFTB]>;
Jim Laskey59e7a772006-12-12 20:57:08 +0000210def : Processor<"601", G3Itineraries, [Directive601]>;
211def : Processor<"602", G3Itineraries, [Directive602]>;
Hal Finkel2e103312013-04-03 04:01:11 +0000212def : Processor<"603", G3Itineraries, [Directive603,
213 FeatureFRES, FeatureFRSQRTE]>;
214def : Processor<"603e", G3Itineraries, [Directive603,
215 FeatureFRES, FeatureFRSQRTE]>;
216def : Processor<"603ev", G3Itineraries, [Directive603,
217 FeatureFRES, FeatureFRSQRTE]>;
218def : Processor<"604", G3Itineraries, [Directive604,
219 FeatureFRES, FeatureFRSQRTE]>;
220def : Processor<"604e", G3Itineraries, [Directive604,
221 FeatureFRES, FeatureFRSQRTE]>;
222def : Processor<"620", G3Itineraries, [Directive620,
223 FeatureFRES, FeatureFRSQRTE]>;
224def : Processor<"750", G4Itineraries, [Directive750,
225 FeatureFRES, FeatureFRSQRTE]>;
226def : Processor<"g3", G3Itineraries, [Directive750,
227 FeatureFRES, FeatureFRSQRTE]>;
228def : Processor<"7400", G4Itineraries, [Directive7400, FeatureAltivec,
229 FeatureFRES, FeatureFRSQRTE]>;
230def : Processor<"g4", G4Itineraries, [Directive7400, FeatureAltivec,
231 FeatureFRES, FeatureFRSQRTE]>;
232def : Processor<"7450", G4PlusItineraries, [Directive7400, FeatureAltivec,
233 FeatureFRES, FeatureFRSQRTE]>;
234def : Processor<"g4+", G4PlusItineraries, [Directive7400, FeatureAltivec,
235 FeatureFRES, FeatureFRSQRTE]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000236def : ProcessorModel<"970", G5Model,
Jim Laskey59e7a772006-12-12 20:57:08 +0000237 [Directive970, FeatureAltivec,
Hal Finkel2e103312013-04-03 04:01:11 +0000238 FeatureMFOCRF, FeatureFSqrt,
239 FeatureFRES, FeatureFRSQRTE, FeatureSTFIWX,
Jim Laskey13a19452005-10-22 08:04:24 +0000240 Feature64Bit /*, Feature64BitRegs */]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000241def : ProcessorModel<"g5", G5Model,
Jim Laskey59e7a772006-12-12 20:57:08 +0000242 [Directive970, FeatureAltivec,
Hal Finkelbfd3d082012-06-11 19:57:01 +0000243 FeatureMFOCRF, FeatureFSqrt, FeatureSTFIWX,
Hal Finkel2e103312013-04-03 04:01:11 +0000244 FeatureFRES, FeatureFRSQRTE,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000245 Feature64Bit /*, Feature64BitRegs */,
246 DeprecatedMFTB, DeprecatedDST]>;
Hal Finkel742b5352012-08-28 16:12:39 +0000247def : ProcessorModel<"e500mc", PPCE500mcModel,
248 [DirectiveE500mc, FeatureMFOCRF,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000249 FeatureSTFIWX, FeatureBookE, FeatureISEL,
250 DeprecatedMFTB]>;
Hal Finkel742b5352012-08-28 16:12:39 +0000251def : ProcessorModel<"e5500", PPCE5500Model,
252 [DirectiveE5500, FeatureMFOCRF, Feature64Bit,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000253 FeatureSTFIWX, FeatureBookE, FeatureISEL,
254 DeprecatedMFTB]>;
Hal Finkel5fde1b02013-04-05 05:34:08 +0000255def : ProcessorModel<"a2", PPCA2Model,
Hal Finkel31d29562013-03-28 19:25:55 +0000256 [DirectiveA2, FeatureBookE, FeatureMFOCRF,
Hal Finkeldbc78e12013-08-19 05:01:02 +0000257 FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES,
Hal Finkel2e103312013-04-03 04:01:11 +0000258 FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec,
259 FeatureSTFIWX, FeatureLFIWAX,
Hal Finkelf6d45f22013-04-01 17:52:07 +0000260 FeatureFPRND, FeatureFPCVT, FeatureISEL,
261 FeaturePOPCNTD, FeatureLDBRX, Feature64Bit
Hal Finkel0096dbd2013-09-12 14:40:06 +0000262 /*, Feature64BitRegs */, DeprecatedMFTB]>;
Hal Finkel5fde1b02013-04-05 05:34:08 +0000263def : ProcessorModel<"a2q", PPCA2Model,
Hal Finkel31d29562013-03-28 19:25:55 +0000264 [DirectiveA2, FeatureBookE, FeatureMFOCRF,
Hal Finkeldbc78e12013-08-19 05:01:02 +0000265 FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES,
Hal Finkel2e103312013-04-03 04:01:11 +0000266 FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec,
267 FeatureSTFIWX, FeatureLFIWAX,
Hal Finkelf6d45f22013-04-01 17:52:07 +0000268 FeatureFPRND, FeatureFPCVT, FeatureISEL,
269 FeaturePOPCNTD, FeatureLDBRX, Feature64Bit
Hal Finkel0096dbd2013-09-12 14:40:06 +0000270 /*, Feature64BitRegs */, FeatureQPX, DeprecatedMFTB]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000271def : ProcessorModel<"pwr3", G5Model,
Hal Finkel2e103312013-04-03 04:01:11 +0000272 [DirectivePwr3, FeatureAltivec,
273 FeatureFRES, FeatureFRSQRTE, FeatureMFOCRF,
Bill Schmidt52742c22013-02-01 22:59:51 +0000274 FeatureSTFIWX, Feature64Bit]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000275def : ProcessorModel<"pwr4", G5Model,
Bill Schmidt52742c22013-02-01 22:59:51 +0000276 [DirectivePwr4, FeatureAltivec, FeatureMFOCRF,
Hal Finkel2e103312013-04-03 04:01:11 +0000277 FeatureFSqrt, FeatureFRES, FeatureFRSQRTE,
278 FeatureSTFIWX, Feature64Bit]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000279def : ProcessorModel<"pwr5", G5Model,
Bill Schmidt52742c22013-02-01 22:59:51 +0000280 [DirectivePwr5, FeatureAltivec, FeatureMFOCRF,
Hal Finkel2e103312013-04-03 04:01:11 +0000281 FeatureFSqrt, FeatureFRE, FeatureFRES,
282 FeatureFRSQRTE, FeatureFRSQRTES,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000283 FeatureSTFIWX, Feature64Bit,
284 DeprecatedMFTB, DeprecatedDST]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000285def : ProcessorModel<"pwr5x", G5Model,
Bill Schmidt52742c22013-02-01 22:59:51 +0000286 [DirectivePwr5x, FeatureAltivec, FeatureMFOCRF,
Hal Finkel2e103312013-04-03 04:01:11 +0000287 FeatureFSqrt, FeatureFRE, FeatureFRES,
288 FeatureFRSQRTE, FeatureFRSQRTES,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000289 FeatureSTFIWX, FeatureFPRND, Feature64Bit,
290 DeprecatedMFTB, DeprecatedDST]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000291def : ProcessorModel<"pwr6", G5Model,
Hal Finkelf2b9c382012-06-11 15:43:08 +0000292 [DirectivePwr6, FeatureAltivec,
Hal Finkeldbc78e12013-08-19 05:01:02 +0000293 FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE,
Hal Finkel2e103312013-04-03 04:01:11 +0000294 FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES,
295 FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000296 FeatureFPRND, Feature64Bit /*, Feature64BitRegs */,
297 DeprecatedMFTB, DeprecatedDST]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000298def : ProcessorModel<"pwr6x", G5Model,
Bill Schmidt52742c22013-02-01 22:59:51 +0000299 [DirectivePwr5x, FeatureAltivec, FeatureMFOCRF,
Hal Finkeldbc78e12013-08-19 05:01:02 +0000300 FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES,
Hal Finkel2e103312013-04-03 04:01:11 +0000301 FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec,
302 FeatureSTFIWX, FeatureLFIWAX,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000303 FeatureFPRND, Feature64Bit,
304 DeprecatedMFTB, DeprecatedDST]>;
Hal Finkel42daeae2013-11-30 20:55:12 +0000305def : ProcessorModel<"pwr7", P7Model,
NAKAMURA Takumicc4487e2014-12-09 01:03:27 +0000306 [DirectivePwr7, FeatureAltivec,
Hal Finkeldbc78e12013-08-19 05:01:02 +0000307 FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE,
Hal Finkel2e103312013-04-03 04:01:11 +0000308 FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES,
309 FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX,
310 FeatureFPRND, FeatureFPCVT, FeatureISEL,
311 FeaturePOPCNTD, FeatureLDBRX,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000312 Feature64Bit /*, Feature64BitRegs */,
313 DeprecatedMFTB, DeprecatedDST]>;
Will Schmidt970ff642014-06-26 13:36:19 +0000314def : ProcessorModel<"pwr8", P7Model /* FIXME: Update to P8Model when available */,
NAKAMURA Takumicc4487e2014-12-09 01:03:27 +0000315 [DirectivePwr8, FeatureAltivec,
Will Schmidt970ff642014-06-26 13:36:19 +0000316 FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE,
317 FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES,
318 FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX,
319 FeatureFPRND, FeatureFPCVT, FeatureISEL,
320 FeaturePOPCNTD, FeatureLDBRX,
321 Feature64Bit /*, Feature64BitRegs */,
322 DeprecatedMFTB, DeprecatedDST]>;
Jim Laskey59e7a772006-12-12 20:57:08 +0000323def : Processor<"ppc", G3Itineraries, [Directive32]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000324def : ProcessorModel<"ppc64", G5Model,
Jim Laskey59e7a772006-12-12 20:57:08 +0000325 [Directive64, FeatureAltivec,
Hal Finkel7ac45922013-04-03 14:40:18 +0000326 FeatureMFOCRF, FeatureFSqrt, FeatureFRES,
327 FeatureFRSQRTE, FeatureSTFIWX,
Jim Laskey13a19452005-10-22 08:04:24 +0000328 Feature64Bit /*, Feature64BitRegs */]>;
Bill Schmidt0a9170d2013-07-26 01:35:43 +0000329def : ProcessorModel<"ppc64le", G5Model,
330 [Directive64, FeatureAltivec,
331 FeatureMFOCRF, FeatureFSqrt, FeatureFRES,
332 FeatureFRSQRTE, FeatureSTFIWX,
333 Feature64Bit /*, Feature64BitRegs */]>;
Jim Laskey74ab9962005-10-19 19:51:16 +0000334
Chris Lattner4f2e4e02007-03-06 00:59:59 +0000335//===----------------------------------------------------------------------===//
336// Calling Conventions
337//===----------------------------------------------------------------------===//
338
339include "PPCCallingConv.td"
340
Chris Lattner51348c52006-03-12 09:13:49 +0000341def PPCInstrInfo : InstrInfo {
Chris Lattner51348c52006-03-12 09:13:49 +0000342 let isLittleEndianEncoding = 1;
Hal Finkel23453472013-12-19 16:13:01 +0000343
344 // FIXME: Unset this when no longer needed!
345 let decodePositionallyEncodedOperands = 1;
Hal Finkel5457bd02014-03-13 07:57:54 +0000346
347 let noNamedPositionallyEncodedOperands = 1;
Chris Lattner51348c52006-03-12 09:13:49 +0000348}
349
Ulrich Weigand640192d2013-05-03 19:49:39 +0000350def PPCAsmParser : AsmParser {
351 let ShouldEmitMatchRegisterName = 0;
352}
353
Ulrich Weigandc0944b52013-07-08 14:49:37 +0000354def PPCAsmParserVariant : AsmParserVariant {
355 int Variant = 0;
356
357 // We do not use hard coded registers in asm strings. However, some
358 // InstAlias definitions use immediate literals. Set RegisterPrefix
359 // so that those are not misinterpreted as registers.
360 string RegisterPrefix = "%";
361}
362
Chris Lattner0921e3b2005-10-14 23:37:35 +0000363def PPC : Target {
Chris Lattner51348c52006-03-12 09:13:49 +0000364 // Information about the instructions.
365 let InstructionSet = PPCInstrInfo;
Rafael Espindola50712a42013-12-02 04:55:42 +0000366
Ulrich Weigand640192d2013-05-03 19:49:39 +0000367 let AssemblyParsers = [PPCAsmParser];
Ulrich Weigandc0944b52013-07-08 14:49:37 +0000368 let AssemblyParserVariants = [PPCAsmParserVariant];
Chris Lattner0921e3b2005-10-14 23:37:35 +0000369}