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