blob: bd58539c6fc29edae37ac9170b997aca6b62e213 [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", "">;
Jim Laskey59e7a772006-12-12 20:57:08 +000049
Chris Lattnera35f3062006-06-16 17:34:12 +000050def Feature64Bit : SubtargetFeature<"64bit","Has64BitSupport", "true",
Chris Lattner0d4923b2005-10-23 05:28:51 +000051 "Enable 64-bit instructions">;
Chris Lattnera35f3062006-06-16 17:34:12 +000052def Feature64BitRegs : SubtargetFeature<"64bitregs","Use64BitRegs", "true",
53 "Enable 64-bit registers usage for ppc32 [beta]">;
Hal Finkel940ab932014-02-28 00:27:01 +000054def FeatureCRBits : SubtargetFeature<"crbits", "UseCRBits", "true",
55 "Use condition-register bits individually">;
Evan Chengd98701c2006-01-27 08:09:42 +000056def FeatureAltivec : SubtargetFeature<"altivec","HasAltivec", "true",
Chris Lattner0d4923b2005-10-23 05:28:51 +000057 "Enable Altivec instructions">;
Hal Finkelbfd3d082012-06-11 19:57:01 +000058def FeatureMFOCRF : SubtargetFeature<"mfocrf","HasMFOCRF", "true",
59 "Enable the MFOCRF instruction">;
Evan Chengd98701c2006-01-27 08:09:42 +000060def FeatureFSqrt : SubtargetFeature<"fsqrt","HasFSQRT", "true",
Hal Finkel49033792011-10-14 18:54:13 +000061 "Enable the fsqrt instruction">;
Hal Finkeldbc78e12013-08-19 05:01:02 +000062def FeatureFCPSGN : SubtargetFeature<"fcpsgn", "HasFCPSGN", "true",
63 "Enable the fcpsgn instruction">;
Hal Finkel2e103312013-04-03 04:01:11 +000064def FeatureFRE : SubtargetFeature<"fre", "HasFRE", "true",
65 "Enable the fre instruction">;
66def FeatureFRES : SubtargetFeature<"fres", "HasFRES", "true",
67 "Enable the fres instruction">;
68def FeatureFRSQRTE : SubtargetFeature<"frsqrte", "HasFRSQRTE", "true",
69 "Enable the frsqrte instruction">;
70def FeatureFRSQRTES : SubtargetFeature<"frsqrtes", "HasFRSQRTES", "true",
71 "Enable the frsqrtes instruction">;
72def FeatureRecipPrec : SubtargetFeature<"recipprec", "HasRecipPrec", "true",
73 "Assume higher precision reciprocal estimates">;
Chris Lattnerb9f35f02006-02-28 07:08:22 +000074def FeatureSTFIWX : SubtargetFeature<"stfiwx","HasSTFIWX", "true",
Hal Finkel49033792011-10-14 18:54:13 +000075 "Enable the stfiwx instruction">;
Hal Finkelbeb296b2013-03-31 10:12:51 +000076def FeatureLFIWAX : SubtargetFeature<"lfiwax","HasLFIWAX", "true",
77 "Enable the lfiwax instruction">;
Hal Finkelc20a08d2013-03-29 08:57:48 +000078def FeatureFPRND : SubtargetFeature<"fprnd", "HasFPRND", "true",
79 "Enable the fri[mnpz] instructions">;
Hal Finkelf6d45f22013-04-01 17:52:07 +000080def FeatureFPCVT : SubtargetFeature<"fpcvt", "HasFPCVT", "true",
81 "Enable fc[ft]* (unsigned and single-precision) and lfiwzx instructions">;
Hal Finkel460e94d2012-06-22 23:10:08 +000082def FeatureISEL : SubtargetFeature<"isel","HasISEL", "true",
83 "Enable the isel instruction">;
Hal Finkela4d07482013-03-28 13:29:47 +000084def FeaturePOPCNTD : SubtargetFeature<"popcntd","HasPOPCNTD", "true",
85 "Enable the popcnt[dw] instructions">;
Hal Finkel31d29562013-03-28 19:25:55 +000086def FeatureLDBRX : SubtargetFeature<"ldbrx","HasLDBRX", "true",
87 "Enable the ldbrx instruction">;
Hal Finkel6fa56972011-10-17 04:03:49 +000088def FeatureBookE : SubtargetFeature<"booke", "IsBookE", "true",
89 "Enable Book E instructions">;
Hal Finkelefb305e2013-01-30 21:17:42 +000090def FeatureQPX : SubtargetFeature<"qpx","HasQPX", "true",
91 "Enable QPX instructions">;
Eric Christopher081efcc2013-10-16 20:38:58 +000092def FeatureVSX : SubtargetFeature<"vsx","HasVSX", "true",
Hal Finkel27774d92014-03-13 07:58:58 +000093 "Enable VSX instructions",
94 [FeatureAltivec]>;
Jim Laskey74ab9962005-10-19 19:51:16 +000095
Hal Finkel0096dbd2013-09-12 14:40:06 +000096def DeprecatedMFTB : SubtargetFeature<"", "DeprecatedMFTB", "true",
97 "Treat mftb as deprecated">;
98def DeprecatedDST : SubtargetFeature<"", "DeprecatedDST", "true",
99 "Treat vector data stream cache control instructions as deprecated">;
100
Bill Schmidtcc99a2f2013-02-01 23:10:09 +0000101// Note: Future features to add when support is extended to more
102// recent ISA levels:
103//
104// CMPB p6, p6x, p7 cmpb
105// DFP p6, p6x, p7 decimal floating-point instructions
Bill Schmidtcc99a2f2013-02-01 23:10:09 +0000106// POPCNTB p5 through p7 popcntb and related instructions
Bill Schmidtcc99a2f2013-02-01 23:10:09 +0000107// VSX p7 vector-scalar instruction set
108
Jim Laskey74ab9962005-10-19 19:51:16 +0000109//===----------------------------------------------------------------------===//
Hal Finkel654d43b2013-04-12 02:18:09 +0000110// Classes used for relation maps.
111//===----------------------------------------------------------------------===//
112// RecFormRel - Filter class used to relate non-record-form instructions with
113// their record-form variants.
114class RecFormRel;
115
Hal Finkel25e04542014-03-25 18:55:11 +0000116// AltVSXFMARel - Filter class used to relate the primary addend-killing VSX
117// FMA instruction forms with their corresponding factor-killing forms.
118class AltVSXFMARel {
119 bit IsVSXFMAAlt = 0;
120}
121
Hal Finkel654d43b2013-04-12 02:18:09 +0000122//===----------------------------------------------------------------------===//
123// Relation Map Definitions.
124//===----------------------------------------------------------------------===//
125
126def getRecordFormOpcode : InstrMapping {
127 let FilterClass = "RecFormRel";
128 // Instructions with the same BaseName and Interpretation64Bit values
129 // form a row.
130 let RowFields = ["BaseName", "Interpretation64Bit"];
131 // Instructions with the same RC value form a column.
132 let ColFields = ["RC"];
133 // The key column are the non-record-form instructions.
134 let KeyCol = ["0"];
135 // Value columns RC=1
136 let ValueCols = [["1"]];
137}
138
139def getNonRecordFormOpcode : InstrMapping {
140 let FilterClass = "RecFormRel";
141 // Instructions with the same BaseName and Interpretation64Bit values
142 // form a row.
143 let RowFields = ["BaseName", "Interpretation64Bit"];
144 // Instructions with the same RC value form a column.
145 let ColFields = ["RC"];
146 // The key column are the record-form instructions.
147 let KeyCol = ["1"];
148 // Value columns are RC=0
149 let ValueCols = [["0"]];
150}
151
Hal Finkel25e04542014-03-25 18:55:11 +0000152def getAltVSXFMAOpcode : InstrMapping {
153 let FilterClass = "AltVSXFMARel";
154 // Instructions with the same BaseName and Interpretation64Bit values
155 // form a row.
156 let RowFields = ["BaseName"];
157 // Instructions with the same RC value form a column.
158 let ColFields = ["IsVSXFMAAlt"];
159 // The key column are the (default) addend-killing instructions.
160 let KeyCol = ["0"];
161 // Value columns IsVSXFMAAlt=1
162 let ValueCols = [["1"]];
163}
164
Hal Finkel654d43b2013-04-12 02:18:09 +0000165//===----------------------------------------------------------------------===//
Chris Lattnera389f0d2005-10-23 22:08:13 +0000166// Register File Description
167//===----------------------------------------------------------------------===//
168
169include "PPCRegisterInfo.td"
170include "PPCSchedule.td"
171include "PPCInstrInfo.td"
172
173//===----------------------------------------------------------------------===//
174// PowerPC processors supported.
Jim Laskey74ab9962005-10-19 19:51:16 +0000175//
176
Jim Laskey59e7a772006-12-12 20:57:08 +0000177def : Processor<"generic", G3Itineraries, [Directive32]>;
Hal Finkel5a7162f2013-11-29 06:32:17 +0000178def : ProcessorModel<"440", PPC440Model, [Directive440, FeatureISEL,
179 FeatureFRES, FeatureFRSQRTE,
180 FeatureBookE, DeprecatedMFTB]>;
181def : ProcessorModel<"450", PPC440Model, [Directive440, FeatureISEL,
182 FeatureFRES, FeatureFRSQRTE,
183 FeatureBookE, DeprecatedMFTB]>;
Jim Laskey59e7a772006-12-12 20:57:08 +0000184def : Processor<"601", G3Itineraries, [Directive601]>;
185def : Processor<"602", G3Itineraries, [Directive602]>;
Hal Finkel2e103312013-04-03 04:01:11 +0000186def : Processor<"603", G3Itineraries, [Directive603,
187 FeatureFRES, FeatureFRSQRTE]>;
188def : Processor<"603e", G3Itineraries, [Directive603,
189 FeatureFRES, FeatureFRSQRTE]>;
190def : Processor<"603ev", G3Itineraries, [Directive603,
191 FeatureFRES, FeatureFRSQRTE]>;
192def : Processor<"604", G3Itineraries, [Directive604,
193 FeatureFRES, FeatureFRSQRTE]>;
194def : Processor<"604e", G3Itineraries, [Directive604,
195 FeatureFRES, FeatureFRSQRTE]>;
196def : Processor<"620", G3Itineraries, [Directive620,
197 FeatureFRES, FeatureFRSQRTE]>;
198def : Processor<"750", G4Itineraries, [Directive750,
199 FeatureFRES, FeatureFRSQRTE]>;
200def : Processor<"g3", G3Itineraries, [Directive750,
201 FeatureFRES, FeatureFRSQRTE]>;
202def : Processor<"7400", G4Itineraries, [Directive7400, FeatureAltivec,
203 FeatureFRES, FeatureFRSQRTE]>;
204def : Processor<"g4", G4Itineraries, [Directive7400, FeatureAltivec,
205 FeatureFRES, FeatureFRSQRTE]>;
206def : Processor<"7450", G4PlusItineraries, [Directive7400, FeatureAltivec,
207 FeatureFRES, FeatureFRSQRTE]>;
208def : Processor<"g4+", G4PlusItineraries, [Directive7400, FeatureAltivec,
209 FeatureFRES, FeatureFRSQRTE]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000210def : ProcessorModel<"970", G5Model,
Jim Laskey59e7a772006-12-12 20:57:08 +0000211 [Directive970, FeatureAltivec,
Hal Finkel2e103312013-04-03 04:01:11 +0000212 FeatureMFOCRF, FeatureFSqrt,
213 FeatureFRES, FeatureFRSQRTE, FeatureSTFIWX,
Jim Laskey13a19452005-10-22 08:04:24 +0000214 Feature64Bit /*, Feature64BitRegs */]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000215def : ProcessorModel<"g5", G5Model,
Jim Laskey59e7a772006-12-12 20:57:08 +0000216 [Directive970, FeatureAltivec,
Hal Finkelbfd3d082012-06-11 19:57:01 +0000217 FeatureMFOCRF, FeatureFSqrt, FeatureSTFIWX,
Hal Finkel2e103312013-04-03 04:01:11 +0000218 FeatureFRES, FeatureFRSQRTE,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000219 Feature64Bit /*, Feature64BitRegs */,
220 DeprecatedMFTB, DeprecatedDST]>;
Hal Finkel742b5352012-08-28 16:12:39 +0000221def : ProcessorModel<"e500mc", PPCE500mcModel,
222 [DirectiveE500mc, FeatureMFOCRF,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000223 FeatureSTFIWX, FeatureBookE, FeatureISEL,
224 DeprecatedMFTB]>;
Hal Finkel742b5352012-08-28 16:12:39 +0000225def : ProcessorModel<"e5500", PPCE5500Model,
226 [DirectiveE5500, FeatureMFOCRF, Feature64Bit,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000227 FeatureSTFIWX, FeatureBookE, FeatureISEL,
228 DeprecatedMFTB]>;
Hal Finkel5fde1b02013-04-05 05:34:08 +0000229def : ProcessorModel<"a2", PPCA2Model,
Hal Finkel31d29562013-03-28 19:25:55 +0000230 [DirectiveA2, FeatureBookE, FeatureMFOCRF,
Hal Finkeldbc78e12013-08-19 05:01:02 +0000231 FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES,
Hal Finkel2e103312013-04-03 04:01:11 +0000232 FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec,
233 FeatureSTFIWX, FeatureLFIWAX,
Hal Finkelf6d45f22013-04-01 17:52:07 +0000234 FeatureFPRND, FeatureFPCVT, FeatureISEL,
235 FeaturePOPCNTD, FeatureLDBRX, Feature64Bit
Hal Finkel0096dbd2013-09-12 14:40:06 +0000236 /*, Feature64BitRegs */, DeprecatedMFTB]>;
Hal Finkel5fde1b02013-04-05 05:34:08 +0000237def : ProcessorModel<"a2q", PPCA2Model,
Hal Finkel31d29562013-03-28 19:25:55 +0000238 [DirectiveA2, FeatureBookE, FeatureMFOCRF,
Hal Finkeldbc78e12013-08-19 05:01:02 +0000239 FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES,
Hal Finkel2e103312013-04-03 04:01:11 +0000240 FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec,
241 FeatureSTFIWX, FeatureLFIWAX,
Hal Finkelf6d45f22013-04-01 17:52:07 +0000242 FeatureFPRND, FeatureFPCVT, FeatureISEL,
243 FeaturePOPCNTD, FeatureLDBRX, Feature64Bit
Hal Finkel0096dbd2013-09-12 14:40:06 +0000244 /*, Feature64BitRegs */, FeatureQPX, DeprecatedMFTB]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000245def : ProcessorModel<"pwr3", G5Model,
Hal Finkel2e103312013-04-03 04:01:11 +0000246 [DirectivePwr3, FeatureAltivec,
247 FeatureFRES, FeatureFRSQRTE, FeatureMFOCRF,
Bill Schmidt52742c22013-02-01 22:59:51 +0000248 FeatureSTFIWX, Feature64Bit]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000249def : ProcessorModel<"pwr4", G5Model,
Bill Schmidt52742c22013-02-01 22:59:51 +0000250 [DirectivePwr4, FeatureAltivec, FeatureMFOCRF,
Hal Finkel2e103312013-04-03 04:01:11 +0000251 FeatureFSqrt, FeatureFRES, FeatureFRSQRTE,
252 FeatureSTFIWX, Feature64Bit]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000253def : ProcessorModel<"pwr5", G5Model,
Bill Schmidt52742c22013-02-01 22:59:51 +0000254 [DirectivePwr5, FeatureAltivec, FeatureMFOCRF,
Hal Finkel2e103312013-04-03 04:01:11 +0000255 FeatureFSqrt, FeatureFRE, FeatureFRES,
256 FeatureFRSQRTE, FeatureFRSQRTES,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000257 FeatureSTFIWX, Feature64Bit,
258 DeprecatedMFTB, DeprecatedDST]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000259def : ProcessorModel<"pwr5x", G5Model,
Bill Schmidt52742c22013-02-01 22:59:51 +0000260 [DirectivePwr5x, FeatureAltivec, FeatureMFOCRF,
Hal Finkel2e103312013-04-03 04:01:11 +0000261 FeatureFSqrt, FeatureFRE, FeatureFRES,
262 FeatureFRSQRTE, FeatureFRSQRTES,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000263 FeatureSTFIWX, FeatureFPRND, Feature64Bit,
264 DeprecatedMFTB, DeprecatedDST]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000265def : ProcessorModel<"pwr6", G5Model,
Hal Finkelf2b9c382012-06-11 15:43:08 +0000266 [DirectivePwr6, FeatureAltivec,
Hal Finkeldbc78e12013-08-19 05:01:02 +0000267 FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE,
Hal Finkel2e103312013-04-03 04:01:11 +0000268 FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES,
269 FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000270 FeatureFPRND, Feature64Bit /*, Feature64BitRegs */,
271 DeprecatedMFTB, DeprecatedDST]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000272def : ProcessorModel<"pwr6x", G5Model,
Bill Schmidt52742c22013-02-01 22:59:51 +0000273 [DirectivePwr5x, FeatureAltivec, FeatureMFOCRF,
Hal Finkeldbc78e12013-08-19 05:01:02 +0000274 FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES,
Hal Finkel2e103312013-04-03 04:01:11 +0000275 FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec,
276 FeatureSTFIWX, FeatureLFIWAX,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000277 FeatureFPRND, Feature64Bit,
278 DeprecatedMFTB, DeprecatedDST]>;
Hal Finkel42daeae2013-11-30 20:55:12 +0000279def : ProcessorModel<"pwr7", P7Model,
Hal Finkelf2b9c382012-06-11 15:43:08 +0000280 [DirectivePwr7, FeatureAltivec,
Hal Finkeldbc78e12013-08-19 05:01:02 +0000281 FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE,
Hal Finkel2e103312013-04-03 04:01:11 +0000282 FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES,
283 FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX,
284 FeatureFPRND, FeatureFPCVT, FeatureISEL,
285 FeaturePOPCNTD, FeatureLDBRX,
Hal Finkel0096dbd2013-09-12 14:40:06 +0000286 Feature64Bit /*, Feature64BitRegs */,
287 DeprecatedMFTB, DeprecatedDST]>;
Jim Laskey59e7a772006-12-12 20:57:08 +0000288def : Processor<"ppc", G3Itineraries, [Directive32]>;
Hal Finkel1a958cf2013-04-05 05:49:18 +0000289def : ProcessorModel<"ppc64", G5Model,
Jim Laskey59e7a772006-12-12 20:57:08 +0000290 [Directive64, FeatureAltivec,
Hal Finkel7ac45922013-04-03 14:40:18 +0000291 FeatureMFOCRF, FeatureFSqrt, FeatureFRES,
292 FeatureFRSQRTE, FeatureSTFIWX,
Jim Laskey13a19452005-10-22 08:04:24 +0000293 Feature64Bit /*, Feature64BitRegs */]>;
Bill Schmidt0a9170d2013-07-26 01:35:43 +0000294def : ProcessorModel<"ppc64le", G5Model,
295 [Directive64, FeatureAltivec,
296 FeatureMFOCRF, FeatureFSqrt, FeatureFRES,
297 FeatureFRSQRTE, FeatureSTFIWX,
298 Feature64Bit /*, Feature64BitRegs */]>;
Jim Laskey74ab9962005-10-19 19:51:16 +0000299
Chris Lattner4f2e4e02007-03-06 00:59:59 +0000300//===----------------------------------------------------------------------===//
301// Calling Conventions
302//===----------------------------------------------------------------------===//
303
304include "PPCCallingConv.td"
305
Chris Lattner51348c52006-03-12 09:13:49 +0000306def PPCInstrInfo : InstrInfo {
Chris Lattner51348c52006-03-12 09:13:49 +0000307 let isLittleEndianEncoding = 1;
Hal Finkel23453472013-12-19 16:13:01 +0000308
309 // FIXME: Unset this when no longer needed!
310 let decodePositionallyEncodedOperands = 1;
Hal Finkel5457bd02014-03-13 07:57:54 +0000311
312 let noNamedPositionallyEncodedOperands = 1;
Chris Lattner51348c52006-03-12 09:13:49 +0000313}
314
Ulrich Weigand640192d2013-05-03 19:49:39 +0000315def PPCAsmParser : AsmParser {
316 let ShouldEmitMatchRegisterName = 0;
317}
318
Ulrich Weigandc0944b52013-07-08 14:49:37 +0000319def PPCAsmParserVariant : AsmParserVariant {
320 int Variant = 0;
321
322 // We do not use hard coded registers in asm strings. However, some
323 // InstAlias definitions use immediate literals. Set RegisterPrefix
324 // so that those are not misinterpreted as registers.
325 string RegisterPrefix = "%";
326}
327
Chris Lattner0921e3b2005-10-14 23:37:35 +0000328def PPC : Target {
Chris Lattner51348c52006-03-12 09:13:49 +0000329 // Information about the instructions.
330 let InstructionSet = PPCInstrInfo;
Rafael Espindola50712a42013-12-02 04:55:42 +0000331
Ulrich Weigand640192d2013-05-03 19:49:39 +0000332 let AssemblyParsers = [PPCAsmParser];
Ulrich Weigandc0944b52013-07-08 14:49:37 +0000333 let AssemblyParserVariants = [PPCAsmParserVariant];
Chris Lattner0921e3b2005-10-14 23:37:35 +0000334}