Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / lib / Target / PowerPC / PPC.td
blobfbca91437ec7b731916daa8f9735fd478392c0eb
1 //===-- PPC.td - Describe the PowerPC Target Machine -------*- tablegen -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This is the top level entry point for the PowerPC target.
11 //===----------------------------------------------------------------------===//
13 // Get the target-independent interfaces which we are implementing.
15 include "llvm/Target/Target.td"
17 //===----------------------------------------------------------------------===//
18 // PowerPC Subtarget features.
21 //===----------------------------------------------------------------------===//
22 // CPU Directives                                                             //
23 //===----------------------------------------------------------------------===//
25 def Directive440 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_440", "">;
26 def Directive601 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_601", "">;
27 def Directive602 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_602", "">;
28 def Directive603 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">;
29 def Directive604 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">;
30 def Directive620 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">;
31 def Directive7400: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_7400", "">;
32 def Directive750 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_750", "">;
33 def Directive970 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_970", "">;
34 def Directive32  : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_32", "">;
35 def Directive64  : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_64", "">;
36 def DirectiveA2  : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_A2", "">;
37 def DirectiveE500   : SubtargetFeature<"", "DarwinDirective",
38                                        "PPC::DIR_E500", "">;
39 def DirectiveE500mc : SubtargetFeature<"", "DarwinDirective",
40                                        "PPC::DIR_E500mc", "">;
41 def DirectiveE5500  : SubtargetFeature<"", "DarwinDirective",
42                                        "PPC::DIR_E5500", "">;
43 def DirectivePwr3: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR3", "">;
44 def DirectivePwr4: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR4", "">;
45 def DirectivePwr5: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR5", "">;
46 def DirectivePwr5x
47     : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR5X", "">;
48 def DirectivePwr6: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR6", "">;
49 def DirectivePwr6x
50     : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR6X", "">;
51 def DirectivePwr7: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR7", "">;
52 def DirectivePwr8: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR8", "">;
53 def DirectivePwr9: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR9", "">;
55 def Feature64Bit     : SubtargetFeature<"64bit","Has64BitSupport", "true",
56                                         "Enable 64-bit instructions">;
57 def FeatureHardFloat : SubtargetFeature<"hard-float", "HasHardFloat", "true",
58                               "Enable floating-point instructions">;
59 def Feature64BitRegs : SubtargetFeature<"64bitregs","Use64BitRegs", "true",
60                               "Enable 64-bit registers usage for ppc32 [beta]">;
61 def FeatureCRBits    : SubtargetFeature<"crbits", "UseCRBits", "true",
62                               "Use condition-register bits individually">;
63 def FeatureFPU       : SubtargetFeature<"fpu","HasFPU","true",
64                                         "Enable classic FPU instructions",
65                                         [FeatureHardFloat]>;
66 def FeatureAltivec   : SubtargetFeature<"altivec","HasAltivec", "true",
67                                         "Enable Altivec instructions",
68                                         [FeatureFPU]>;
69 def FeatureSPE       : SubtargetFeature<"spe","HasSPE", "true",
70                                         "Enable SPE instructions",
71                                         [FeatureHardFloat]>;
72 def FeatureMFOCRF    : SubtargetFeature<"mfocrf","HasMFOCRF", "true",
73                                         "Enable the MFOCRF instruction">;
74 def FeatureFSqrt     : SubtargetFeature<"fsqrt","HasFSQRT", "true",
75                                         "Enable the fsqrt instruction",
76                                         [FeatureFPU]>;
77 def FeatureFCPSGN    : SubtargetFeature<"fcpsgn", "HasFCPSGN", "true",
78                                         "Enable the fcpsgn instruction",
79                                         [FeatureFPU]>;
80 def FeatureFRE       : SubtargetFeature<"fre", "HasFRE", "true",
81                                         "Enable the fre instruction",
82                                         [FeatureFPU]>;
83 def FeatureFRES      : SubtargetFeature<"fres", "HasFRES", "true",
84                                         "Enable the fres instruction",
85                                         [FeatureFPU]>;
86 def FeatureFRSQRTE   : SubtargetFeature<"frsqrte", "HasFRSQRTE", "true",
87                                         "Enable the frsqrte instruction",
88                                         [FeatureFPU]>;
89 def FeatureFRSQRTES  : SubtargetFeature<"frsqrtes", "HasFRSQRTES", "true",
90                                         "Enable the frsqrtes instruction",
91                                         [FeatureFPU]>;
92 def FeatureRecipPrec : SubtargetFeature<"recipprec", "HasRecipPrec", "true",
93                               "Assume higher precision reciprocal estimates">;
94 def FeatureSTFIWX    : SubtargetFeature<"stfiwx","HasSTFIWX", "true",
95                                         "Enable the stfiwx instruction",
96                                         [FeatureFPU]>;
97 def FeatureLFIWAX    : SubtargetFeature<"lfiwax","HasLFIWAX", "true",
98                                         "Enable the lfiwax instruction",
99                                         [FeatureFPU]>;
100 def FeatureFPRND     : SubtargetFeature<"fprnd", "HasFPRND", "true",
101                                         "Enable the fri[mnpz] instructions",
102                                         [FeatureFPU]>;
103 def FeatureFPCVT     : SubtargetFeature<"fpcvt", "HasFPCVT", "true",
104   "Enable fc[ft]* (unsigned and single-precision) and lfiwzx instructions",
105                                         [FeatureFPU]>;
106 def FeatureISEL      : SubtargetFeature<"isel","HasISEL", "true",
107                                         "Enable the isel instruction">;
108 def FeatureBPERMD    : SubtargetFeature<"bpermd", "HasBPERMD", "true",
109                                         "Enable the bpermd instruction">;
110 def FeatureExtDiv    : SubtargetFeature<"extdiv", "HasExtDiv", "true",
111                                         "Enable extended divide instructions">;
112 def FeatureLDBRX     : SubtargetFeature<"ldbrx","HasLDBRX", "true",
113                                         "Enable the ldbrx instruction">;
114 def FeatureCMPB      : SubtargetFeature<"cmpb", "HasCMPB", "true",
115                                         "Enable the cmpb instruction">;
116 def FeatureICBT      : SubtargetFeature<"icbt","HasICBT", "true",
117                                         "Enable icbt instruction">;
118 def FeatureBookE     : SubtargetFeature<"booke", "IsBookE", "true",
119                                         "Enable Book E instructions",
120                                         [FeatureICBT]>;
121 def FeatureMSYNC     : SubtargetFeature<"msync", "HasOnlyMSYNC", "true",
122                               "Has only the msync instruction instead of sync",
123                               [FeatureBookE]>;
124 def FeatureE500      : SubtargetFeature<"e500", "IsE500", "true",
125                                         "Enable E500/E500mc instructions">;
126 def FeatureSecurePlt : SubtargetFeature<"secure-plt","SecurePlt", "true",
127                                         "Enable secure plt mode">;
128 def FeaturePPC4xx    : SubtargetFeature<"ppc4xx", "IsPPC4xx", "true",
129                                         "Enable PPC 4xx instructions">;
130 def FeaturePPC6xx    : SubtargetFeature<"ppc6xx", "IsPPC6xx", "true",
131                                         "Enable PPC 6xx instructions">;
132 def FeatureQPX       : SubtargetFeature<"qpx","HasQPX", "true",
133                                         "Enable QPX instructions",
134                                         [FeatureFPU]>;
135 def FeatureVSX       : SubtargetFeature<"vsx","HasVSX", "true",
136                                         "Enable VSX instructions",
137                                         [FeatureAltivec]>;
138 def FeatureP8Altivec : SubtargetFeature<"power8-altivec", "HasP8Altivec", "true",
139                                         "Enable POWER8 Altivec instructions",
140                                         [FeatureAltivec]>;
141 def FeatureP8Crypto : SubtargetFeature<"crypto", "HasP8Crypto", "true",
142                                        "Enable POWER8 Crypto instructions",
143                                        [FeatureP8Altivec]>;
144 def FeatureP8Vector  : SubtargetFeature<"power8-vector", "HasP8Vector", "true",
145                                         "Enable POWER8 vector instructions",
146                                         [FeatureVSX, FeatureP8Altivec]>;
147 def FeatureDirectMove :
148   SubtargetFeature<"direct-move", "HasDirectMove", "true",
149                    "Enable Power8 direct move instructions",
150                    [FeatureVSX]>;
151 def FeaturePartwordAtomic : SubtargetFeature<"partword-atomics",
152                                              "HasPartwordAtomics", "true",
153                                              "Enable l[bh]arx and st[bh]cx.">;
154 def FeatureInvariantFunctionDescriptors :
155   SubtargetFeature<"invariant-function-descriptors",
156                    "HasInvariantFunctionDescriptors", "true",
157                    "Assume function descriptors are invariant">;
158 def FeatureLongCall : SubtargetFeature<"longcall", "UseLongCalls", "true",
159                                        "Always use indirect calls">;
160 def FeatureHTM : SubtargetFeature<"htm", "HasHTM", "true",
161                                   "Enable Hardware Transactional Memory instructions">;
162 def FeatureMFTB   : SubtargetFeature<"", "FeatureMFTB", "true",
163                                         "Implement mftb using the mfspr instruction">;
164 def FeatureFusion : SubtargetFeature<"fusion", "HasFusion", "true",
165                                      "Target supports add/load integer fusion.">;
166 def FeatureFloat128 :
167   SubtargetFeature<"float128", "HasFloat128", "true",
168                    "Enable the __float128 data type for IEEE-754R Binary128.",
169                    [FeatureVSX]>;
170 def FeaturePOPCNTD   : SubtargetFeature<"popcntd","HasPOPCNTD",
171                                         "POPCNTD_Fast",
172                                         "Enable the popcnt[dw] instructions">;
173 // Note that for the a2/a2q processor models we should not use popcnt[dw] by
174 // default. These processors do support the instructions, but they're
175 // microcoded, and the software emulation is about twice as fast.
176 def FeatureSlowPOPCNTD : SubtargetFeature<"slow-popcntd","HasPOPCNTD",
177                                           "POPCNTD_Slow",
178                                           "Has slow popcnt[dw] instructions">;
180 def DeprecatedDST    : SubtargetFeature<"", "DeprecatedDST", "true",
181   "Treat vector data stream cache control instructions as deprecated">;
183 def FeatureISA3_0 : SubtargetFeature<"isa-v30-instructions", "IsISA3_0",
184                                      "true",
185                                      "Enable instructions added in ISA 3.0.">;
186 def FeatureP9Altivec : SubtargetFeature<"power9-altivec", "HasP9Altivec", "true",
187                                         "Enable POWER9 Altivec instructions",
188                                         [FeatureISA3_0, FeatureP8Altivec]>;
189 def FeatureP9Vector  : SubtargetFeature<"power9-vector", "HasP9Vector", "true",
190                                         "Enable POWER9 vector instructions",
191                                         [FeatureISA3_0, FeatureP8Vector,
192                                          FeatureP9Altivec]>;
193 // A separate feature for this even though it is equivalent to P9Vector
194 // because this is a feature of the implementation rather than the architecture
195 // and may go away with future CPU's.
196 def FeatureVectorsUseTwoUnits : SubtargetFeature<"vectors-use-two-units",
197                                                  "VectorsUseTwoUnits",
198                                                  "true",
199                                                  "Vectors use two units">;
201 // Since new processors generally contain a superset of features of those that
202 // came before them, the idea is to make implementations of new processors
203 // less error prone and easier to read.
204 // Namely:
205 //     list<SubtargetFeature> Power8FeatureList = ...
206 //     list<SubtargetFeature> FutureProcessorSpecificFeatureList =
207 //         [ features that Power8 does not support ]
208 //     list<SubtargetFeature> FutureProcessorFeatureList =
209 //         !listconcat(Power8FeatureList, FutureProcessorSpecificFeatureList)
211 // Makes it explicit and obvious what is new in FutureProcesor vs. Power8 as
212 // well as providing a single point of definition if the feature set will be
213 // used elsewhere.
214 def ProcessorFeatures {
215   list<SubtargetFeature> Power7FeatureList =
216       [DirectivePwr7, FeatureAltivec, FeatureVSX,
217        FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE,
218        FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES,
219        FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX,
220        FeatureFPRND, FeatureFPCVT, FeatureISEL,
221        FeaturePOPCNTD, FeatureCMPB, FeatureLDBRX,
222        Feature64Bit /*, Feature64BitRegs */,
223        FeatureBPERMD, FeatureExtDiv,
224        FeatureMFTB, DeprecatedDST];
225   list<SubtargetFeature> Power8SpecificFeatures =
226       [DirectivePwr8, FeatureP8Altivec, FeatureP8Vector, FeatureP8Crypto,
227        FeatureHTM, FeatureDirectMove, FeatureICBT, FeaturePartwordAtomic,
228        FeatureFusion];
229   list<SubtargetFeature> Power8FeatureList =
230       !listconcat(Power7FeatureList, Power8SpecificFeatures);
231   list<SubtargetFeature> Power9SpecificFeatures =
232       [DirectivePwr9, FeatureP9Altivec, FeatureP9Vector, FeatureISA3_0,
233        FeatureVectorsUseTwoUnits];
234   list<SubtargetFeature> Power9FeatureList =
235       !listconcat(Power8FeatureList, Power9SpecificFeatures);
238 // Note: Future features to add when support is extended to more
239 // recent ISA levels:
241 // DFP          p6, p6x, p7        decimal floating-point instructions
242 // POPCNTB      p5 through p7      popcntb and related instructions
244 //===----------------------------------------------------------------------===//
245 // Classes used for relation maps.
246 //===----------------------------------------------------------------------===//
247 // RecFormRel - Filter class used to relate non-record-form instructions with
248 // their record-form variants.
249 class RecFormRel;
251 // AltVSXFMARel - Filter class used to relate the primary addend-killing VSX
252 // FMA instruction forms with their corresponding factor-killing forms.
253 class AltVSXFMARel {
254   bit IsVSXFMAAlt = 0;
257 //===----------------------------------------------------------------------===//
258 // Relation Map Definitions.
259 //===----------------------------------------------------------------------===//
261 def getRecordFormOpcode : InstrMapping {
262   let FilterClass = "RecFormRel";
263   // Instructions with the same BaseName and Interpretation64Bit values
264   // form a row.
265   let RowFields = ["BaseName", "Interpretation64Bit"];
266   // Instructions with the same RC value form a column.
267   let ColFields = ["RC"];
268   // The key column are the non-record-form instructions.
269   let KeyCol = ["0"];
270   // Value columns RC=1
271   let ValueCols = [["1"]];
274 def getNonRecordFormOpcode : InstrMapping {
275   let FilterClass = "RecFormRel";
276   // Instructions with the same BaseName and Interpretation64Bit values
277   // form a row.
278   let RowFields = ["BaseName", "Interpretation64Bit"];
279   // Instructions with the same RC value form a column.
280   let ColFields = ["RC"];
281   // The key column are the record-form instructions.
282   let KeyCol = ["1"];
283   // Value columns are RC=0
284   let ValueCols = [["0"]];
287 def getAltVSXFMAOpcode : InstrMapping {
288   let FilterClass = "AltVSXFMARel";
289   // Instructions with the same BaseName and Interpretation64Bit values
290   // form a row.
291   let RowFields = ["BaseName"];
292   // Instructions with the same RC value form a column.
293   let ColFields = ["IsVSXFMAAlt"];
294   // The key column are the (default) addend-killing instructions.
295   let KeyCol = ["0"];
296   // Value columns IsVSXFMAAlt=1
297   let ValueCols = [["1"]];
300 //===----------------------------------------------------------------------===//
301 // Register File Description
302 //===----------------------------------------------------------------------===//
304 include "PPCRegisterInfo.td"
305 include "PPCSchedule.td"
307 //===----------------------------------------------------------------------===//
308 // PowerPC processors supported.
311 def : Processor<"generic", G3Itineraries, [Directive32, FeatureHardFloat,
312                                            FeatureMFTB]>;
313 def : ProcessorModel<"440", PPC440Model, [Directive440, FeatureISEL,
314                                           FeatureFRES, FeatureFRSQRTE,
315                                           FeatureICBT, FeatureBookE,
316                                           FeatureMSYNC, FeatureMFTB]>;
317 def : ProcessorModel<"450", PPC440Model, [Directive440, FeatureISEL,
318                                           FeatureFRES, FeatureFRSQRTE,
319                                           FeatureICBT, FeatureBookE,
320                                           FeatureMSYNC, FeatureMFTB]>;
321 def : Processor<"601", G3Itineraries, [Directive601, FeatureFPU]>;
322 def : Processor<"602", G3Itineraries, [Directive602, FeatureFPU,
323                                        FeatureMFTB]>;
324 def : Processor<"603", G3Itineraries, [Directive603,
325                                        FeatureFRES, FeatureFRSQRTE,
326                                        FeatureMFTB]>;
327 def : Processor<"603e", G3Itineraries, [Directive603,
328                                         FeatureFRES, FeatureFRSQRTE,
329                                         FeatureMFTB]>;
330 def : Processor<"603ev", G3Itineraries, [Directive603,
331                                          FeatureFRES, FeatureFRSQRTE,
332                                          FeatureMFTB]>;
333 def : Processor<"604", G3Itineraries, [Directive604,
334                                        FeatureFRES, FeatureFRSQRTE,
335                                        FeatureMFTB]>;
336 def : Processor<"604e", G3Itineraries, [Directive604,
337                                         FeatureFRES, FeatureFRSQRTE,
338                                         FeatureMFTB]>;
339 def : Processor<"620", G3Itineraries, [Directive620,
340                                        FeatureFRES, FeatureFRSQRTE,
341                                        FeatureMFTB]>;
342 def : Processor<"750", G4Itineraries, [Directive750,
343                                        FeatureFRES, FeatureFRSQRTE,
344                                        FeatureMFTB]>;
345 def : Processor<"g3", G3Itineraries, [Directive750,
346                                       FeatureFRES, FeatureFRSQRTE,
347                                       FeatureMFTB]>;
348 def : Processor<"7400", G4Itineraries, [Directive7400, FeatureAltivec,
349                                         FeatureFRES, FeatureFRSQRTE,
350                                         FeatureMFTB]>;
351 def : Processor<"g4", G4Itineraries, [Directive7400, FeatureAltivec,
352                                       FeatureFRES, FeatureFRSQRTE,
353                                       FeatureMFTB]>;
354 def : Processor<"7450", G4PlusItineraries, [Directive7400, FeatureAltivec,
355                                             FeatureFRES, FeatureFRSQRTE,
356                                             FeatureMFTB]>;
357 def : Processor<"g4+", G4PlusItineraries, [Directive7400, FeatureAltivec,
358                                            FeatureFRES, FeatureFRSQRTE,
359                                            FeatureMFTB]>;
361 def : ProcessorModel<"970", G5Model,
362                   [Directive970, FeatureAltivec,
363                    FeatureMFOCRF, FeatureFSqrt,
364                    FeatureFRES, FeatureFRSQRTE, FeatureSTFIWX,
365                    Feature64Bit /*, Feature64BitRegs */,
366                    FeatureMFTB]>;
367 def : ProcessorModel<"g5", G5Model,
368                   [Directive970, FeatureAltivec,
369                    FeatureMFOCRF, FeatureFSqrt, FeatureSTFIWX,
370                    FeatureFRES, FeatureFRSQRTE,
371                    Feature64Bit /*, Feature64BitRegs */,
372                    FeatureMFTB, DeprecatedDST]>;
373 def : ProcessorModel<"e500", PPCE500Model,
374                   [DirectiveE500,
375                    FeatureICBT, FeatureBookE,
376                    FeatureISEL, FeatureMFTB]>;
377 def : ProcessorModel<"e500mc", PPCE500mcModel,
378                   [DirectiveE500mc,
379                    FeatureSTFIWX, FeatureICBT, FeatureBookE,
380                    FeatureISEL, FeatureMFTB]>;
381 def : ProcessorModel<"e5500", PPCE5500Model,
382                   [DirectiveE5500, FeatureMFOCRF, Feature64Bit,
383                    FeatureSTFIWX, FeatureICBT, FeatureBookE,
384                    FeatureISEL, FeatureMFTB]>;
385 def : ProcessorModel<"a2", PPCA2Model,
386                   [DirectiveA2, FeatureICBT, FeatureBookE, FeatureMFOCRF,
387                    FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES,
388                    FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec,
389                    FeatureSTFIWX, FeatureLFIWAX,
390                    FeatureFPRND, FeatureFPCVT, FeatureISEL,
391                    FeatureSlowPOPCNTD, FeatureCMPB, FeatureLDBRX,
392                    Feature64Bit /*, Feature64BitRegs */, FeatureMFTB]>;
393 def : ProcessorModel<"a2q", PPCA2Model,
394                   [DirectiveA2, FeatureICBT, FeatureBookE, FeatureMFOCRF,
395                    FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES,
396                    FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec,
397                    FeatureSTFIWX, FeatureLFIWAX,
398                    FeatureFPRND, FeatureFPCVT, FeatureISEL,
399                    FeatureSlowPOPCNTD, FeatureCMPB, FeatureLDBRX,
400                    Feature64Bit /*, Feature64BitRegs */, FeatureQPX,
401                    FeatureMFTB]>;
402 def : ProcessorModel<"pwr3", G5Model,
403                   [DirectivePwr3, FeatureAltivec,
404                    FeatureFRES, FeatureFRSQRTE, FeatureMFOCRF,
405                    FeatureSTFIWX, Feature64Bit]>;
406 def : ProcessorModel<"pwr4", G5Model,
407                   [DirectivePwr4, FeatureAltivec, FeatureMFOCRF,
408                    FeatureFSqrt, FeatureFRES, FeatureFRSQRTE,
409                    FeatureSTFIWX, Feature64Bit, FeatureMFTB]>;
410 def : ProcessorModel<"pwr5", G5Model,
411                   [DirectivePwr5, FeatureAltivec, FeatureMFOCRF,
412                    FeatureFSqrt, FeatureFRE, FeatureFRES,
413                    FeatureFRSQRTE, FeatureFRSQRTES,
414                    FeatureSTFIWX, Feature64Bit,
415                    FeatureMFTB, DeprecatedDST]>;
416 def : ProcessorModel<"pwr5x", G5Model,
417                   [DirectivePwr5x, FeatureAltivec, FeatureMFOCRF,
418                    FeatureFSqrt, FeatureFRE, FeatureFRES,
419                    FeatureFRSQRTE, FeatureFRSQRTES,
420                    FeatureSTFIWX, FeatureFPRND, Feature64Bit,
421                    FeatureMFTB, DeprecatedDST]>;
422 def : ProcessorModel<"pwr6", G5Model,
423                   [DirectivePwr6, FeatureAltivec,
424                    FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE,
425                    FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES,
426                    FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX, FeatureCMPB,
427                    FeatureFPRND, Feature64Bit /*, Feature64BitRegs */,
428                    FeatureMFTB, DeprecatedDST]>;
429 def : ProcessorModel<"pwr6x", G5Model,
430                   [DirectivePwr5x, FeatureAltivec, FeatureMFOCRF,
431                    FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES,
432                    FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec,
433                    FeatureSTFIWX, FeatureLFIWAX, FeatureCMPB,
434                    FeatureFPRND, Feature64Bit,
435                    FeatureMFTB, DeprecatedDST]>;
436 def : ProcessorModel<"pwr7", P7Model, ProcessorFeatures.Power7FeatureList>;
437 def : ProcessorModel<"pwr8", P8Model, ProcessorFeatures.Power8FeatureList>;
438 def : ProcessorModel<"pwr9", P9Model, ProcessorFeatures.Power9FeatureList>;
439 def : Processor<"ppc", G3Itineraries, [Directive32, FeatureHardFloat,
440                                        FeatureMFTB]>;
441 def : Processor<"ppc32", G3Itineraries, [Directive32, FeatureHardFloat,
442                                          FeatureMFTB]>;
443 def : ProcessorModel<"ppc64", G5Model,
444                   [Directive64, FeatureAltivec,
445                    FeatureMFOCRF, FeatureFSqrt, FeatureFRES,
446                    FeatureFRSQRTE, FeatureSTFIWX,
447                    Feature64Bit /*, Feature64BitRegs */,
448                    FeatureMFTB]>;
449 def : ProcessorModel<"ppc64le", P8Model, ProcessorFeatures.Power8FeatureList>;
451 //===----------------------------------------------------------------------===//
452 // Calling Conventions
453 //===----------------------------------------------------------------------===//
455 include "PPCCallingConv.td"
457 def PPCInstrInfo : InstrInfo {
458   let isLittleEndianEncoding = 1;
460   // FIXME: Unset this when no longer needed!
461   let decodePositionallyEncodedOperands = 1;
463   let noNamedPositionallyEncodedOperands = 1;
466 def PPCAsmParser : AsmParser {
467   let ShouldEmitMatchRegisterName = 0;
470 def PPCAsmParserVariant : AsmParserVariant {
471   int Variant = 0;
473   // We do not use hard coded registers in asm strings.  However, some
474   // InstAlias definitions use immediate literals.  Set RegisterPrefix
475   // so that those are not misinterpreted as registers.
476   string RegisterPrefix = "%";
477   string BreakCharacters = ".";
480 def PPC : Target {
481   // Information about the instructions.
482   let InstructionSet = PPCInstrInfo;
484   let AssemblyParsers = [PPCAsmParser];
485   let AssemblyParserVariants = [PPCAsmParserVariant];
486   let AllowRegisterRenaming = 1;
489 //===----------------------------------------------------------------------===//
490 // Pfm Counters
491 //===----------------------------------------------------------------------===//
493 include "PPCPfmCounters.td"