Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- PPC.td - Describe the PowerPC Target Machine -------*- tablegen -*-===// |
| 2 | // |
Chris Lattner | 0921e3b | 2005-10-14 23:37:35 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | f3ebc3f | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 7 | // |
Chris Lattner | 0921e3b | 2005-10-14 23:37:35 +0000 | [diff] [blame] | 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 | // |
Evan Cheng | 977e7be | 2008-11-24 07:34:46 +0000 | [diff] [blame] | 16 | include "llvm/Target/Target.td" |
Chris Lattner | 0921e3b | 2005-10-14 23:37:35 +0000 | [diff] [blame] | 17 | |
| 18 | //===----------------------------------------------------------------------===// |
Jim Laskey | 13a1945 | 2005-10-22 08:04:24 +0000 | [diff] [blame] | 19 | // PowerPC Subtarget features. |
Jim Laskey | 74ab996 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 20 | // |
| 21 | |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 22 | //===----------------------------------------------------------------------===// |
| 23 | // CPU Directives // |
| 24 | //===----------------------------------------------------------------------===// |
| 25 | |
Hal Finkel | 6fa5697 | 2011-10-17 04:03:49 +0000 | [diff] [blame] | 26 | def Directive440 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_440", "">; |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 27 | def Directive601 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_601", "">; |
| 28 | def Directive602 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_602", "">; |
| 29 | def Directive603 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">; |
| 30 | def Directive604 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">; |
| 31 | def Directive620 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">; |
| 32 | def Directive7400: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_7400", "">; |
| 33 | def Directive750 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_750", "">; |
| 34 | def Directive970 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_970", "">; |
| 35 | def Directive32 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_32", "">; |
| 36 | def Directive64 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_64", "">; |
Hal Finkel | 9f9f892 | 2012-04-01 19:22:40 +0000 | [diff] [blame] | 37 | def DirectiveA2 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_A2", "">; |
Hal Finkel | 742b535 | 2012-08-28 16:12:39 +0000 | [diff] [blame] | 38 | def DirectiveE500mc : SubtargetFeature<"", "DarwinDirective", |
| 39 | "PPC::DIR_E500mc", "">; |
| 40 | def DirectiveE5500 : SubtargetFeature<"", "DarwinDirective", |
| 41 | "PPC::DIR_E5500", "">; |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 42 | def DirectivePwr3: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR3", "">; |
| 43 | def DirectivePwr4: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR4", "">; |
| 44 | def DirectivePwr5: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR5", "">; |
| 45 | def DirectivePwr5x: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR5X", "">; |
Hal Finkel | f2b9c38 | 2012-06-11 15:43:08 +0000 | [diff] [blame] | 46 | def DirectivePwr6: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR6", "">; |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 47 | def DirectivePwr6x: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR6X", "">; |
Hal Finkel | f2b9c38 | 2012-06-11 15:43:08 +0000 | [diff] [blame] | 48 | def DirectivePwr7: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR7", "">; |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 49 | |
Chris Lattner | a35f306 | 2006-06-16 17:34:12 +0000 | [diff] [blame] | 50 | def Feature64Bit : SubtargetFeature<"64bit","Has64BitSupport", "true", |
Chris Lattner | 0d4923b | 2005-10-23 05:28:51 +0000 | [diff] [blame] | 51 | "Enable 64-bit instructions">; |
Chris Lattner | a35f306 | 2006-06-16 17:34:12 +0000 | [diff] [blame] | 52 | def Feature64BitRegs : SubtargetFeature<"64bitregs","Use64BitRegs", "true", |
| 53 | "Enable 64-bit registers usage for ppc32 [beta]">; |
Evan Cheng | d98701c | 2006-01-27 08:09:42 +0000 | [diff] [blame] | 54 | def FeatureAltivec : SubtargetFeature<"altivec","HasAltivec", "true", |
Chris Lattner | 0d4923b | 2005-10-23 05:28:51 +0000 | [diff] [blame] | 55 | "Enable Altivec instructions">; |
Hal Finkel | bfd3d08 | 2012-06-11 19:57:01 +0000 | [diff] [blame] | 56 | def FeatureMFOCRF : SubtargetFeature<"mfocrf","HasMFOCRF", "true", |
| 57 | "Enable the MFOCRF instruction">; |
Evan Cheng | d98701c | 2006-01-27 08:09:42 +0000 | [diff] [blame] | 58 | def FeatureFSqrt : SubtargetFeature<"fsqrt","HasFSQRT", "true", |
Hal Finkel | 4903379 | 2011-10-14 18:54:13 +0000 | [diff] [blame] | 59 | "Enable the fsqrt instruction">; |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 60 | def FeatureFCPSGN : SubtargetFeature<"fcpsgn", "HasFCPSGN", "true", |
| 61 | "Enable the fcpsgn instruction">; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 62 | def FeatureFRE : SubtargetFeature<"fre", "HasFRE", "true", |
| 63 | "Enable the fre instruction">; |
| 64 | def FeatureFRES : SubtargetFeature<"fres", "HasFRES", "true", |
| 65 | "Enable the fres instruction">; |
| 66 | def FeatureFRSQRTE : SubtargetFeature<"frsqrte", "HasFRSQRTE", "true", |
| 67 | "Enable the frsqrte instruction">; |
| 68 | def FeatureFRSQRTES : SubtargetFeature<"frsqrtes", "HasFRSQRTES", "true", |
| 69 | "Enable the frsqrtes instruction">; |
| 70 | def FeatureRecipPrec : SubtargetFeature<"recipprec", "HasRecipPrec", "true", |
| 71 | "Assume higher precision reciprocal estimates">; |
Chris Lattner | b9f35f0 | 2006-02-28 07:08:22 +0000 | [diff] [blame] | 72 | def FeatureSTFIWX : SubtargetFeature<"stfiwx","HasSTFIWX", "true", |
Hal Finkel | 4903379 | 2011-10-14 18:54:13 +0000 | [diff] [blame] | 73 | "Enable the stfiwx instruction">; |
Hal Finkel | beb296b | 2013-03-31 10:12:51 +0000 | [diff] [blame] | 74 | def FeatureLFIWAX : SubtargetFeature<"lfiwax","HasLFIWAX", "true", |
| 75 | "Enable the lfiwax instruction">; |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 76 | def FeatureFPRND : SubtargetFeature<"fprnd", "HasFPRND", "true", |
| 77 | "Enable the fri[mnpz] instructions">; |
Hal Finkel | f6d45f2 | 2013-04-01 17:52:07 +0000 | [diff] [blame] | 78 | def FeatureFPCVT : SubtargetFeature<"fpcvt", "HasFPCVT", "true", |
| 79 | "Enable fc[ft]* (unsigned and single-precision) and lfiwzx instructions">; |
Hal Finkel | 460e94d | 2012-06-22 23:10:08 +0000 | [diff] [blame] | 80 | def FeatureISEL : SubtargetFeature<"isel","HasISEL", "true", |
| 81 | "Enable the isel instruction">; |
Hal Finkel | a4d0748 | 2013-03-28 13:29:47 +0000 | [diff] [blame] | 82 | def FeaturePOPCNTD : SubtargetFeature<"popcntd","HasPOPCNTD", "true", |
| 83 | "Enable the popcnt[dw] instructions">; |
Hal Finkel | 31d2956 | 2013-03-28 19:25:55 +0000 | [diff] [blame] | 84 | def FeatureLDBRX : SubtargetFeature<"ldbrx","HasLDBRX", "true", |
| 85 | "Enable the ldbrx instruction">; |
Hal Finkel | 6fa5697 | 2011-10-17 04:03:49 +0000 | [diff] [blame] | 86 | def FeatureBookE : SubtargetFeature<"booke", "IsBookE", "true", |
| 87 | "Enable Book E instructions">; |
Hal Finkel | efb305e | 2013-01-30 21:17:42 +0000 | [diff] [blame] | 88 | def FeatureQPX : SubtargetFeature<"qpx","HasQPX", "true", |
| 89 | "Enable QPX instructions">; |
Eric Christopher | 081efcc | 2013-10-16 20:38:58 +0000 | [diff] [blame^] | 90 | def FeatureVSX : SubtargetFeature<"vsx","HasVSX", "true", |
| 91 | "Enable VSX instructions">; |
Jim Laskey | 74ab996 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 92 | |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 93 | def DeprecatedMFTB : SubtargetFeature<"", "DeprecatedMFTB", "true", |
| 94 | "Treat mftb as deprecated">; |
| 95 | def DeprecatedDST : SubtargetFeature<"", "DeprecatedDST", "true", |
| 96 | "Treat vector data stream cache control instructions as deprecated">; |
| 97 | |
Bill Schmidt | cc99a2f | 2013-02-01 23:10:09 +0000 | [diff] [blame] | 98 | // Note: Future features to add when support is extended to more |
| 99 | // recent ISA levels: |
| 100 | // |
| 101 | // CMPB p6, p6x, p7 cmpb |
| 102 | // DFP p6, p6x, p7 decimal floating-point instructions |
Bill Schmidt | cc99a2f | 2013-02-01 23:10:09 +0000 | [diff] [blame] | 103 | // POPCNTB p5 through p7 popcntb and related instructions |
Bill Schmidt | cc99a2f | 2013-02-01 23:10:09 +0000 | [diff] [blame] | 104 | // VSX p7 vector-scalar instruction set |
| 105 | |
Jim Laskey | 74ab996 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 106 | //===----------------------------------------------------------------------===// |
Hal Finkel | 654d43b | 2013-04-12 02:18:09 +0000 | [diff] [blame] | 107 | // Classes used for relation maps. |
| 108 | //===----------------------------------------------------------------------===// |
| 109 | // RecFormRel - Filter class used to relate non-record-form instructions with |
| 110 | // their record-form variants. |
| 111 | class RecFormRel; |
| 112 | |
| 113 | //===----------------------------------------------------------------------===// |
| 114 | // Relation Map Definitions. |
| 115 | //===----------------------------------------------------------------------===// |
| 116 | |
| 117 | def getRecordFormOpcode : InstrMapping { |
| 118 | let FilterClass = "RecFormRel"; |
| 119 | // Instructions with the same BaseName and Interpretation64Bit values |
| 120 | // form a row. |
| 121 | let RowFields = ["BaseName", "Interpretation64Bit"]; |
| 122 | // Instructions with the same RC value form a column. |
| 123 | let ColFields = ["RC"]; |
| 124 | // The key column are the non-record-form instructions. |
| 125 | let KeyCol = ["0"]; |
| 126 | // Value columns RC=1 |
| 127 | let ValueCols = [["1"]]; |
| 128 | } |
| 129 | |
| 130 | def getNonRecordFormOpcode : InstrMapping { |
| 131 | let FilterClass = "RecFormRel"; |
| 132 | // Instructions with the same BaseName and Interpretation64Bit values |
| 133 | // form a row. |
| 134 | let RowFields = ["BaseName", "Interpretation64Bit"]; |
| 135 | // Instructions with the same RC value form a column. |
| 136 | let ColFields = ["RC"]; |
| 137 | // The key column are the record-form instructions. |
| 138 | let KeyCol = ["1"]; |
| 139 | // Value columns are RC=0 |
| 140 | let ValueCols = [["0"]]; |
| 141 | } |
| 142 | |
| 143 | //===----------------------------------------------------------------------===// |
Chris Lattner | a389f0d | 2005-10-23 22:08:13 +0000 | [diff] [blame] | 144 | // Register File Description |
| 145 | //===----------------------------------------------------------------------===// |
| 146 | |
| 147 | include "PPCRegisterInfo.td" |
| 148 | include "PPCSchedule.td" |
| 149 | include "PPCInstrInfo.td" |
| 150 | |
| 151 | //===----------------------------------------------------------------------===// |
| 152 | // PowerPC processors supported. |
Jim Laskey | 74ab996 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 153 | // |
| 154 | |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 155 | def : Processor<"generic", G3Itineraries, [Directive32]>; |
Hal Finkel | 460e94d | 2012-06-22 23:10:08 +0000 | [diff] [blame] | 156 | def : Processor<"440", PPC440Itineraries, [Directive440, FeatureISEL, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 157 | FeatureFRES, FeatureFRSQRTE, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 158 | FeatureBookE, DeprecatedMFTB]>; |
Hal Finkel | 460e94d | 2012-06-22 23:10:08 +0000 | [diff] [blame] | 159 | def : Processor<"450", PPC440Itineraries, [Directive440, FeatureISEL, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 160 | FeatureFRES, FeatureFRSQRTE, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 161 | FeatureBookE, DeprecatedMFTB]>; |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 162 | def : Processor<"601", G3Itineraries, [Directive601]>; |
| 163 | def : Processor<"602", G3Itineraries, [Directive602]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 164 | def : Processor<"603", G3Itineraries, [Directive603, |
| 165 | FeatureFRES, FeatureFRSQRTE]>; |
| 166 | def : Processor<"603e", G3Itineraries, [Directive603, |
| 167 | FeatureFRES, FeatureFRSQRTE]>; |
| 168 | def : Processor<"603ev", G3Itineraries, [Directive603, |
| 169 | FeatureFRES, FeatureFRSQRTE]>; |
| 170 | def : Processor<"604", G3Itineraries, [Directive604, |
| 171 | FeatureFRES, FeatureFRSQRTE]>; |
| 172 | def : Processor<"604e", G3Itineraries, [Directive604, |
| 173 | FeatureFRES, FeatureFRSQRTE]>; |
| 174 | def : Processor<"620", G3Itineraries, [Directive620, |
| 175 | FeatureFRES, FeatureFRSQRTE]>; |
| 176 | def : Processor<"750", G4Itineraries, [Directive750, |
| 177 | FeatureFRES, FeatureFRSQRTE]>; |
| 178 | def : Processor<"g3", G3Itineraries, [Directive750, |
| 179 | FeatureFRES, FeatureFRSQRTE]>; |
| 180 | def : Processor<"7400", G4Itineraries, [Directive7400, FeatureAltivec, |
| 181 | FeatureFRES, FeatureFRSQRTE]>; |
| 182 | def : Processor<"g4", G4Itineraries, [Directive7400, FeatureAltivec, |
| 183 | FeatureFRES, FeatureFRSQRTE]>; |
| 184 | def : Processor<"7450", G4PlusItineraries, [Directive7400, FeatureAltivec, |
| 185 | FeatureFRES, FeatureFRSQRTE]>; |
| 186 | def : Processor<"g4+", G4PlusItineraries, [Directive7400, FeatureAltivec, |
| 187 | FeatureFRES, FeatureFRSQRTE]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 188 | def : ProcessorModel<"970", G5Model, |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 189 | [Directive970, FeatureAltivec, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 190 | FeatureMFOCRF, FeatureFSqrt, |
| 191 | FeatureFRES, FeatureFRSQRTE, FeatureSTFIWX, |
Jim Laskey | 13a1945 | 2005-10-22 08:04:24 +0000 | [diff] [blame] | 192 | Feature64Bit /*, Feature64BitRegs */]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 193 | def : ProcessorModel<"g5", G5Model, |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 194 | [Directive970, FeatureAltivec, |
Hal Finkel | bfd3d08 | 2012-06-11 19:57:01 +0000 | [diff] [blame] | 195 | FeatureMFOCRF, FeatureFSqrt, FeatureSTFIWX, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 196 | FeatureFRES, FeatureFRSQRTE, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 197 | Feature64Bit /*, Feature64BitRegs */, |
| 198 | DeprecatedMFTB, DeprecatedDST]>; |
Hal Finkel | 742b535 | 2012-08-28 16:12:39 +0000 | [diff] [blame] | 199 | def : ProcessorModel<"e500mc", PPCE500mcModel, |
| 200 | [DirectiveE500mc, FeatureMFOCRF, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 201 | FeatureSTFIWX, FeatureBookE, FeatureISEL, |
| 202 | DeprecatedMFTB]>; |
Hal Finkel | 742b535 | 2012-08-28 16:12:39 +0000 | [diff] [blame] | 203 | def : ProcessorModel<"e5500", PPCE5500Model, |
| 204 | [DirectiveE5500, FeatureMFOCRF, Feature64Bit, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 205 | FeatureSTFIWX, FeatureBookE, FeatureISEL, |
| 206 | DeprecatedMFTB]>; |
Hal Finkel | 5fde1b0 | 2013-04-05 05:34:08 +0000 | [diff] [blame] | 207 | def : ProcessorModel<"a2", PPCA2Model, |
Hal Finkel | 31d2956 | 2013-03-28 19:25:55 +0000 | [diff] [blame] | 208 | [DirectiveA2, FeatureBookE, FeatureMFOCRF, |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 209 | FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 210 | FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec, |
| 211 | FeatureSTFIWX, FeatureLFIWAX, |
Hal Finkel | f6d45f2 | 2013-04-01 17:52:07 +0000 | [diff] [blame] | 212 | FeatureFPRND, FeatureFPCVT, FeatureISEL, |
| 213 | FeaturePOPCNTD, FeatureLDBRX, Feature64Bit |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 214 | /*, Feature64BitRegs */, DeprecatedMFTB]>; |
Hal Finkel | 5fde1b0 | 2013-04-05 05:34:08 +0000 | [diff] [blame] | 215 | def : ProcessorModel<"a2q", PPCA2Model, |
Hal Finkel | 31d2956 | 2013-03-28 19:25:55 +0000 | [diff] [blame] | 216 | [DirectiveA2, FeatureBookE, FeatureMFOCRF, |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 217 | FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 218 | FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec, |
| 219 | FeatureSTFIWX, FeatureLFIWAX, |
Hal Finkel | f6d45f2 | 2013-04-01 17:52:07 +0000 | [diff] [blame] | 220 | FeatureFPRND, FeatureFPCVT, FeatureISEL, |
| 221 | FeaturePOPCNTD, FeatureLDBRX, Feature64Bit |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 222 | /*, Feature64BitRegs */, FeatureQPX, DeprecatedMFTB]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 223 | def : ProcessorModel<"pwr3", G5Model, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 224 | [DirectivePwr3, FeatureAltivec, |
| 225 | FeatureFRES, FeatureFRSQRTE, FeatureMFOCRF, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 226 | FeatureSTFIWX, Feature64Bit]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 227 | def : ProcessorModel<"pwr4", G5Model, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 228 | [DirectivePwr4, FeatureAltivec, FeatureMFOCRF, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 229 | FeatureFSqrt, FeatureFRES, FeatureFRSQRTE, |
| 230 | FeatureSTFIWX, Feature64Bit]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 231 | def : ProcessorModel<"pwr5", G5Model, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 232 | [DirectivePwr5, FeatureAltivec, FeatureMFOCRF, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 233 | FeatureFSqrt, FeatureFRE, FeatureFRES, |
| 234 | FeatureFRSQRTE, FeatureFRSQRTES, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 235 | FeatureSTFIWX, Feature64Bit, |
| 236 | DeprecatedMFTB, DeprecatedDST]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 237 | def : ProcessorModel<"pwr5x", G5Model, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 238 | [DirectivePwr5x, FeatureAltivec, FeatureMFOCRF, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 239 | FeatureFSqrt, FeatureFRE, FeatureFRES, |
| 240 | FeatureFRSQRTE, FeatureFRSQRTES, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 241 | FeatureSTFIWX, FeatureFPRND, Feature64Bit, |
| 242 | DeprecatedMFTB, DeprecatedDST]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 243 | def : ProcessorModel<"pwr6", G5Model, |
Hal Finkel | f2b9c38 | 2012-06-11 15:43:08 +0000 | [diff] [blame] | 244 | [DirectivePwr6, FeatureAltivec, |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 245 | FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 246 | FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES, |
| 247 | FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 248 | FeatureFPRND, Feature64Bit /*, Feature64BitRegs */, |
| 249 | DeprecatedMFTB, DeprecatedDST]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 250 | def : ProcessorModel<"pwr6x", G5Model, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 251 | [DirectivePwr5x, FeatureAltivec, FeatureMFOCRF, |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 252 | FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 253 | FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec, |
| 254 | FeatureSTFIWX, FeatureLFIWAX, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 255 | FeatureFPRND, Feature64Bit, |
| 256 | DeprecatedMFTB, DeprecatedDST]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 257 | def : ProcessorModel<"pwr7", G5Model, |
Hal Finkel | f2b9c38 | 2012-06-11 15:43:08 +0000 | [diff] [blame] | 258 | [DirectivePwr7, FeatureAltivec, |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 259 | FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 260 | FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES, |
| 261 | FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX, |
| 262 | FeatureFPRND, FeatureFPCVT, FeatureISEL, |
| 263 | FeaturePOPCNTD, FeatureLDBRX, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 264 | Feature64Bit /*, Feature64BitRegs */, |
| 265 | DeprecatedMFTB, DeprecatedDST]>; |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 266 | def : Processor<"ppc", G3Itineraries, [Directive32]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 267 | def : ProcessorModel<"ppc64", G5Model, |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 268 | [Directive64, FeatureAltivec, |
Hal Finkel | 7ac4592 | 2013-04-03 14:40:18 +0000 | [diff] [blame] | 269 | FeatureMFOCRF, FeatureFSqrt, FeatureFRES, |
| 270 | FeatureFRSQRTE, FeatureSTFIWX, |
Jim Laskey | 13a1945 | 2005-10-22 08:04:24 +0000 | [diff] [blame] | 271 | Feature64Bit /*, Feature64BitRegs */]>; |
Bill Schmidt | 0a9170d | 2013-07-26 01:35:43 +0000 | [diff] [blame] | 272 | def : ProcessorModel<"ppc64le", G5Model, |
| 273 | [Directive64, FeatureAltivec, |
| 274 | FeatureMFOCRF, FeatureFSqrt, FeatureFRES, |
| 275 | FeatureFRSQRTE, FeatureSTFIWX, |
| 276 | Feature64Bit /*, Feature64BitRegs */]>; |
Jim Laskey | 74ab996 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 277 | |
Chris Lattner | 4f2e4e0 | 2007-03-06 00:59:59 +0000 | [diff] [blame] | 278 | //===----------------------------------------------------------------------===// |
| 279 | // Calling Conventions |
| 280 | //===----------------------------------------------------------------------===// |
| 281 | |
| 282 | include "PPCCallingConv.td" |
| 283 | |
Chris Lattner | 51348c5 | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 284 | def PPCInstrInfo : InstrInfo { |
Chris Lattner | 51348c5 | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 285 | let isLittleEndianEncoding = 1; |
| 286 | } |
| 287 | |
Chris Lattner | 045e04d | 2010-11-15 03:53:53 +0000 | [diff] [blame] | 288 | def PPCAsmWriter : AsmWriter { |
| 289 | string AsmWriterClassName = "InstPrinter"; |
| 290 | bit isMCAsmWriter = 1; |
| 291 | } |
Chris Lattner | 51348c5 | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 292 | |
Ulrich Weigand | 640192d | 2013-05-03 19:49:39 +0000 | [diff] [blame] | 293 | def PPCAsmParser : AsmParser { |
| 294 | let ShouldEmitMatchRegisterName = 0; |
| 295 | } |
| 296 | |
Ulrich Weigand | c0944b5 | 2013-07-08 14:49:37 +0000 | [diff] [blame] | 297 | def PPCAsmParserVariant : AsmParserVariant { |
| 298 | int Variant = 0; |
| 299 | |
| 300 | // We do not use hard coded registers in asm strings. However, some |
| 301 | // InstAlias definitions use immediate literals. Set RegisterPrefix |
| 302 | // so that those are not misinterpreted as registers. |
| 303 | string RegisterPrefix = "%"; |
| 304 | } |
| 305 | |
Chris Lattner | 0921e3b | 2005-10-14 23:37:35 +0000 | [diff] [blame] | 306 | def PPC : Target { |
Chris Lattner | 51348c5 | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 307 | // Information about the instructions. |
| 308 | let InstructionSet = PPCInstrInfo; |
Chris Lattner | 045e04d | 2010-11-15 03:53:53 +0000 | [diff] [blame] | 309 | |
| 310 | let AssemblyWriters = [PPCAsmWriter]; |
Ulrich Weigand | 640192d | 2013-05-03 19:49:39 +0000 | [diff] [blame] | 311 | let AssemblyParsers = [PPCAsmParser]; |
Ulrich Weigand | c0944b5 | 2013-07-08 14:49:37 +0000 | [diff] [blame] | 312 | let AssemblyParserVariants = [PPCAsmParserVariant]; |
Chris Lattner | 0921e3b | 2005-10-14 23:37:35 +0000 | [diff] [blame] | 313 | } |