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", "">; |
Will Schmidt | 970ff64 | 2014-06-26 13:36:19 +0000 | [diff] [blame] | 49 | def DirectivePwr8: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR8", "">; |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 50 | |
Chris Lattner | a35f306 | 2006-06-16 17:34:12 +0000 | [diff] [blame] | 51 | def Feature64Bit : SubtargetFeature<"64bit","Has64BitSupport", "true", |
Chris Lattner | 0d4923b | 2005-10-23 05:28:51 +0000 | [diff] [blame] | 52 | "Enable 64-bit instructions">; |
Chris Lattner | a35f306 | 2006-06-16 17:34:12 +0000 | [diff] [blame] | 53 | def Feature64BitRegs : SubtargetFeature<"64bitregs","Use64BitRegs", "true", |
| 54 | "Enable 64-bit registers usage for ppc32 [beta]">; |
Hal Finkel | 940ab93 | 2014-02-28 00:27:01 +0000 | [diff] [blame] | 55 | def FeatureCRBits : SubtargetFeature<"crbits", "UseCRBits", "true", |
| 56 | "Use condition-register bits individually">; |
Evan Cheng | d98701c | 2006-01-27 08:09:42 +0000 | [diff] [blame] | 57 | def FeatureAltivec : SubtargetFeature<"altivec","HasAltivec", "true", |
Chris Lattner | 0d4923b | 2005-10-23 05:28:51 +0000 | [diff] [blame] | 58 | "Enable Altivec instructions">; |
Joerg Sonnenberger | 39f095a | 2014-08-07 12:18:21 +0000 | [diff] [blame] | 59 | def FeatureSPE : SubtargetFeature<"spe","HasSPE", "true", |
| 60 | "Enable SPE instructions">; |
Hal Finkel | bfd3d08 | 2012-06-11 19:57:01 +0000 | [diff] [blame] | 61 | def FeatureMFOCRF : SubtargetFeature<"mfocrf","HasMFOCRF", "true", |
| 62 | "Enable the MFOCRF instruction">; |
Evan Cheng | d98701c | 2006-01-27 08:09:42 +0000 | [diff] [blame] | 63 | def FeatureFSqrt : SubtargetFeature<"fsqrt","HasFSQRT", "true", |
Hal Finkel | 4903379 | 2011-10-14 18:54:13 +0000 | [diff] [blame] | 64 | "Enable the fsqrt instruction">; |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 65 | def FeatureFCPSGN : SubtargetFeature<"fcpsgn", "HasFCPSGN", "true", |
| 66 | "Enable the fcpsgn instruction">; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 67 | def FeatureFRE : SubtargetFeature<"fre", "HasFRE", "true", |
| 68 | "Enable the fre instruction">; |
| 69 | def FeatureFRES : SubtargetFeature<"fres", "HasFRES", "true", |
| 70 | "Enable the fres instruction">; |
| 71 | def FeatureFRSQRTE : SubtargetFeature<"frsqrte", "HasFRSQRTE", "true", |
| 72 | "Enable the frsqrte instruction">; |
| 73 | def FeatureFRSQRTES : SubtargetFeature<"frsqrtes", "HasFRSQRTES", "true", |
| 74 | "Enable the frsqrtes instruction">; |
| 75 | def FeatureRecipPrec : SubtargetFeature<"recipprec", "HasRecipPrec", "true", |
| 76 | "Assume higher precision reciprocal estimates">; |
Chris Lattner | b9f35f0 | 2006-02-28 07:08:22 +0000 | [diff] [blame] | 77 | def FeatureSTFIWX : SubtargetFeature<"stfiwx","HasSTFIWX", "true", |
Hal Finkel | 4903379 | 2011-10-14 18:54:13 +0000 | [diff] [blame] | 78 | "Enable the stfiwx instruction">; |
Hal Finkel | beb296b | 2013-03-31 10:12:51 +0000 | [diff] [blame] | 79 | def FeatureLFIWAX : SubtargetFeature<"lfiwax","HasLFIWAX", "true", |
| 80 | "Enable the lfiwax instruction">; |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 81 | def FeatureFPRND : SubtargetFeature<"fprnd", "HasFPRND", "true", |
| 82 | "Enable the fri[mnpz] instructions">; |
Hal Finkel | f6d45f2 | 2013-04-01 17:52:07 +0000 | [diff] [blame] | 83 | def FeatureFPCVT : SubtargetFeature<"fpcvt", "HasFPCVT", "true", |
| 84 | "Enable fc[ft]* (unsigned and single-precision) and lfiwzx instructions">; |
Hal Finkel | 460e94d | 2012-06-22 23:10:08 +0000 | [diff] [blame] | 85 | def FeatureISEL : SubtargetFeature<"isel","HasISEL", "true", |
| 86 | "Enable the isel instruction">; |
Hal Finkel | a4d0748 | 2013-03-28 13:29:47 +0000 | [diff] [blame] | 87 | def FeaturePOPCNTD : SubtargetFeature<"popcntd","HasPOPCNTD", "true", |
| 88 | "Enable the popcnt[dw] instructions">; |
Hal Finkel | 31d2956 | 2013-03-28 19:25:55 +0000 | [diff] [blame] | 89 | def FeatureLDBRX : SubtargetFeature<"ldbrx","HasLDBRX", "true", |
| 90 | "Enable the ldbrx instruction">; |
Hal Finkel | 6fa5697 | 2011-10-17 04:03:49 +0000 | [diff] [blame] | 91 | def FeatureBookE : SubtargetFeature<"booke", "IsBookE", "true", |
| 92 | "Enable Book E instructions">; |
Joerg Sonnenberger | 6ae087a | 2014-08-07 12:31:28 +0000 | [diff] [blame] | 93 | def FeatureE500 : SubtargetFeature<"e500", "IsE500", "true", |
Joerg Sonnenberger | 0b2ebcb | 2014-08-04 15:47:38 +0000 | [diff] [blame] | 94 | "Enable E500/E500mc instructions">; |
| 95 | def FeaturePPC4xx : SubtargetFeature<"ppc4xx", "IsPPC4xx", "true", |
| 96 | "Enable PPC 4xx instructions">; |
Joerg Sonnenberger | 7405210 | 2014-08-04 17:07:41 +0000 | [diff] [blame] | 97 | def FeaturePPC6xx : SubtargetFeature<"ppc6xx", "IsPPC6xx", "true", |
| 98 | "Enable PPC 6xx instructions">; |
Hal Finkel | efb305e | 2013-01-30 21:17:42 +0000 | [diff] [blame] | 99 | def FeatureQPX : SubtargetFeature<"qpx","HasQPX", "true", |
| 100 | "Enable QPX instructions">; |
Eric Christopher | 081efcc | 2013-10-16 20:38:58 +0000 | [diff] [blame] | 101 | def FeatureVSX : SubtargetFeature<"vsx","HasVSX", "true", |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 102 | "Enable VSX instructions", |
| 103 | [FeatureAltivec]>; |
Jim Laskey | 74ab996 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 104 | |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 105 | def DeprecatedMFTB : SubtargetFeature<"", "DeprecatedMFTB", "true", |
| 106 | "Treat mftb as deprecated">; |
| 107 | def DeprecatedDST : SubtargetFeature<"", "DeprecatedDST", "true", |
| 108 | "Treat vector data stream cache control instructions as deprecated">; |
| 109 | |
Bill Schmidt | cc99a2f | 2013-02-01 23:10:09 +0000 | [diff] [blame] | 110 | // Note: Future features to add when support is extended to more |
| 111 | // recent ISA levels: |
| 112 | // |
| 113 | // CMPB p6, p6x, p7 cmpb |
| 114 | // DFP p6, p6x, p7 decimal floating-point instructions |
Bill Schmidt | cc99a2f | 2013-02-01 23:10:09 +0000 | [diff] [blame] | 115 | // POPCNTB p5 through p7 popcntb and related instructions |
Bill Schmidt | cc99a2f | 2013-02-01 23:10:09 +0000 | [diff] [blame] | 116 | // VSX p7 vector-scalar instruction set |
| 117 | |
Jim Laskey | 74ab996 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 118 | //===----------------------------------------------------------------------===// |
Ulrich Weigand | 90a5de8 | 2014-07-28 13:09:28 +0000 | [diff] [blame] | 119 | // ABI Selection // |
| 120 | //===----------------------------------------------------------------------===// |
| 121 | |
| 122 | def FeatureELFv1 : SubtargetFeature<"elfv1", "TargetABI", "PPC_ABI_ELFv1", |
| 123 | "Use the ELFv1 ABI">; |
| 124 | |
| 125 | def FeatureELFv2 : SubtargetFeature<"elfv2", "TargetABI", "PPC_ABI_ELFv2", |
| 126 | "Use the ELFv2 ABI">; |
| 127 | |
| 128 | //===----------------------------------------------------------------------===// |
Hal Finkel | 654d43b | 2013-04-12 02:18:09 +0000 | [diff] [blame] | 129 | // Classes used for relation maps. |
| 130 | //===----------------------------------------------------------------------===// |
| 131 | // RecFormRel - Filter class used to relate non-record-form instructions with |
| 132 | // their record-form variants. |
| 133 | class RecFormRel; |
| 134 | |
Hal Finkel | 25e0454 | 2014-03-25 18:55:11 +0000 | [diff] [blame] | 135 | // AltVSXFMARel - Filter class used to relate the primary addend-killing VSX |
| 136 | // FMA instruction forms with their corresponding factor-killing forms. |
| 137 | class AltVSXFMARel { |
| 138 | bit IsVSXFMAAlt = 0; |
| 139 | } |
| 140 | |
Hal Finkel | 654d43b | 2013-04-12 02:18:09 +0000 | [diff] [blame] | 141 | //===----------------------------------------------------------------------===// |
| 142 | // Relation Map Definitions. |
| 143 | //===----------------------------------------------------------------------===// |
| 144 | |
| 145 | def getRecordFormOpcode : InstrMapping { |
| 146 | let FilterClass = "RecFormRel"; |
| 147 | // Instructions with the same BaseName and Interpretation64Bit values |
| 148 | // form a row. |
| 149 | let RowFields = ["BaseName", "Interpretation64Bit"]; |
| 150 | // Instructions with the same RC value form a column. |
| 151 | let ColFields = ["RC"]; |
| 152 | // The key column are the non-record-form instructions. |
| 153 | let KeyCol = ["0"]; |
| 154 | // Value columns RC=1 |
| 155 | let ValueCols = [["1"]]; |
| 156 | } |
| 157 | |
| 158 | def getNonRecordFormOpcode : InstrMapping { |
| 159 | let FilterClass = "RecFormRel"; |
| 160 | // Instructions with the same BaseName and Interpretation64Bit values |
| 161 | // form a row. |
| 162 | let RowFields = ["BaseName", "Interpretation64Bit"]; |
| 163 | // Instructions with the same RC value form a column. |
| 164 | let ColFields = ["RC"]; |
| 165 | // The key column are the record-form instructions. |
| 166 | let KeyCol = ["1"]; |
| 167 | // Value columns are RC=0 |
| 168 | let ValueCols = [["0"]]; |
| 169 | } |
| 170 | |
Hal Finkel | 25e0454 | 2014-03-25 18:55:11 +0000 | [diff] [blame] | 171 | def getAltVSXFMAOpcode : InstrMapping { |
| 172 | let FilterClass = "AltVSXFMARel"; |
| 173 | // Instructions with the same BaseName and Interpretation64Bit values |
| 174 | // form a row. |
| 175 | let RowFields = ["BaseName"]; |
| 176 | // Instructions with the same RC value form a column. |
| 177 | let ColFields = ["IsVSXFMAAlt"]; |
| 178 | // The key column are the (default) addend-killing instructions. |
| 179 | let KeyCol = ["0"]; |
| 180 | // Value columns IsVSXFMAAlt=1 |
| 181 | let ValueCols = [["1"]]; |
| 182 | } |
| 183 | |
Hal Finkel | 654d43b | 2013-04-12 02:18:09 +0000 | [diff] [blame] | 184 | //===----------------------------------------------------------------------===// |
Chris Lattner | a389f0d | 2005-10-23 22:08:13 +0000 | [diff] [blame] | 185 | // Register File Description |
| 186 | //===----------------------------------------------------------------------===// |
| 187 | |
| 188 | include "PPCRegisterInfo.td" |
| 189 | include "PPCSchedule.td" |
| 190 | include "PPCInstrInfo.td" |
| 191 | |
| 192 | //===----------------------------------------------------------------------===// |
| 193 | // PowerPC processors supported. |
Jim Laskey | 74ab996 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 194 | // |
| 195 | |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 196 | def : Processor<"generic", G3Itineraries, [Directive32]>; |
Hal Finkel | 5a7162f | 2013-11-29 06:32:17 +0000 | [diff] [blame] | 197 | def : ProcessorModel<"440", PPC440Model, [Directive440, FeatureISEL, |
| 198 | FeatureFRES, FeatureFRSQRTE, |
| 199 | FeatureBookE, DeprecatedMFTB]>; |
| 200 | def : ProcessorModel<"450", PPC440Model, [Directive440, FeatureISEL, |
| 201 | FeatureFRES, FeatureFRSQRTE, |
| 202 | FeatureBookE, DeprecatedMFTB]>; |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 203 | def : Processor<"601", G3Itineraries, [Directive601]>; |
| 204 | def : Processor<"602", G3Itineraries, [Directive602]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 205 | def : Processor<"603", G3Itineraries, [Directive603, |
| 206 | FeatureFRES, FeatureFRSQRTE]>; |
| 207 | def : Processor<"603e", G3Itineraries, [Directive603, |
| 208 | FeatureFRES, FeatureFRSQRTE]>; |
| 209 | def : Processor<"603ev", G3Itineraries, [Directive603, |
| 210 | FeatureFRES, FeatureFRSQRTE]>; |
| 211 | def : Processor<"604", G3Itineraries, [Directive604, |
| 212 | FeatureFRES, FeatureFRSQRTE]>; |
| 213 | def : Processor<"604e", G3Itineraries, [Directive604, |
| 214 | FeatureFRES, FeatureFRSQRTE]>; |
| 215 | def : Processor<"620", G3Itineraries, [Directive620, |
| 216 | FeatureFRES, FeatureFRSQRTE]>; |
| 217 | def : Processor<"750", G4Itineraries, [Directive750, |
| 218 | FeatureFRES, FeatureFRSQRTE]>; |
| 219 | def : Processor<"g3", G3Itineraries, [Directive750, |
| 220 | FeatureFRES, FeatureFRSQRTE]>; |
| 221 | def : Processor<"7400", G4Itineraries, [Directive7400, FeatureAltivec, |
| 222 | FeatureFRES, FeatureFRSQRTE]>; |
| 223 | def : Processor<"g4", G4Itineraries, [Directive7400, FeatureAltivec, |
| 224 | FeatureFRES, FeatureFRSQRTE]>; |
| 225 | def : Processor<"7450", G4PlusItineraries, [Directive7400, FeatureAltivec, |
| 226 | FeatureFRES, FeatureFRSQRTE]>; |
| 227 | def : Processor<"g4+", G4PlusItineraries, [Directive7400, FeatureAltivec, |
| 228 | FeatureFRES, FeatureFRSQRTE]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 229 | def : ProcessorModel<"970", G5Model, |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 230 | [Directive970, FeatureAltivec, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 231 | FeatureMFOCRF, FeatureFSqrt, |
| 232 | FeatureFRES, FeatureFRSQRTE, FeatureSTFIWX, |
Jim Laskey | 13a1945 | 2005-10-22 08:04:24 +0000 | [diff] [blame] | 233 | Feature64Bit /*, Feature64BitRegs */]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 234 | def : ProcessorModel<"g5", G5Model, |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 235 | [Directive970, FeatureAltivec, |
Hal Finkel | bfd3d08 | 2012-06-11 19:57:01 +0000 | [diff] [blame] | 236 | FeatureMFOCRF, FeatureFSqrt, FeatureSTFIWX, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 237 | FeatureFRES, FeatureFRSQRTE, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 238 | Feature64Bit /*, Feature64BitRegs */, |
| 239 | DeprecatedMFTB, DeprecatedDST]>; |
Hal Finkel | 742b535 | 2012-08-28 16:12:39 +0000 | [diff] [blame] | 240 | def : ProcessorModel<"e500mc", PPCE500mcModel, |
| 241 | [DirectiveE500mc, FeatureMFOCRF, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 242 | FeatureSTFIWX, FeatureBookE, FeatureISEL, |
| 243 | DeprecatedMFTB]>; |
Hal Finkel | 742b535 | 2012-08-28 16:12:39 +0000 | [diff] [blame] | 244 | def : ProcessorModel<"e5500", PPCE5500Model, |
| 245 | [DirectiveE5500, FeatureMFOCRF, Feature64Bit, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 246 | FeatureSTFIWX, FeatureBookE, FeatureISEL, |
| 247 | DeprecatedMFTB]>; |
Hal Finkel | 5fde1b0 | 2013-04-05 05:34:08 +0000 | [diff] [blame] | 248 | def : ProcessorModel<"a2", PPCA2Model, |
Hal Finkel | 31d2956 | 2013-03-28 19:25:55 +0000 | [diff] [blame] | 249 | [DirectiveA2, FeatureBookE, FeatureMFOCRF, |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 250 | FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 251 | FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec, |
| 252 | FeatureSTFIWX, FeatureLFIWAX, |
Hal Finkel | f6d45f2 | 2013-04-01 17:52:07 +0000 | [diff] [blame] | 253 | FeatureFPRND, FeatureFPCVT, FeatureISEL, |
| 254 | FeaturePOPCNTD, FeatureLDBRX, Feature64Bit |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 255 | /*, Feature64BitRegs */, DeprecatedMFTB]>; |
Hal Finkel | 5fde1b0 | 2013-04-05 05:34:08 +0000 | [diff] [blame] | 256 | def : ProcessorModel<"a2q", PPCA2Model, |
Hal Finkel | 31d2956 | 2013-03-28 19:25:55 +0000 | [diff] [blame] | 257 | [DirectiveA2, FeatureBookE, FeatureMFOCRF, |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 258 | FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 259 | FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec, |
| 260 | FeatureSTFIWX, FeatureLFIWAX, |
Hal Finkel | f6d45f2 | 2013-04-01 17:52:07 +0000 | [diff] [blame] | 261 | FeatureFPRND, FeatureFPCVT, FeatureISEL, |
| 262 | FeaturePOPCNTD, FeatureLDBRX, Feature64Bit |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 263 | /*, Feature64BitRegs */, FeatureQPX, DeprecatedMFTB]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 264 | def : ProcessorModel<"pwr3", G5Model, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 265 | [DirectivePwr3, FeatureAltivec, |
| 266 | FeatureFRES, FeatureFRSQRTE, FeatureMFOCRF, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 267 | FeatureSTFIWX, Feature64Bit]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 268 | def : ProcessorModel<"pwr4", G5Model, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 269 | [DirectivePwr4, FeatureAltivec, FeatureMFOCRF, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 270 | FeatureFSqrt, FeatureFRES, FeatureFRSQRTE, |
| 271 | FeatureSTFIWX, Feature64Bit]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 272 | def : ProcessorModel<"pwr5", G5Model, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 273 | [DirectivePwr5, FeatureAltivec, FeatureMFOCRF, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 274 | FeatureFSqrt, FeatureFRE, FeatureFRES, |
| 275 | FeatureFRSQRTE, FeatureFRSQRTES, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 276 | FeatureSTFIWX, Feature64Bit, |
| 277 | DeprecatedMFTB, DeprecatedDST]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 278 | def : ProcessorModel<"pwr5x", G5Model, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 279 | [DirectivePwr5x, FeatureAltivec, FeatureMFOCRF, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 280 | FeatureFSqrt, FeatureFRE, FeatureFRES, |
| 281 | FeatureFRSQRTE, FeatureFRSQRTES, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 282 | FeatureSTFIWX, FeatureFPRND, Feature64Bit, |
| 283 | DeprecatedMFTB, DeprecatedDST]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 284 | def : ProcessorModel<"pwr6", G5Model, |
Hal Finkel | f2b9c38 | 2012-06-11 15:43:08 +0000 | [diff] [blame] | 285 | [DirectivePwr6, FeatureAltivec, |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 286 | FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 287 | FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES, |
| 288 | FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 289 | FeatureFPRND, Feature64Bit /*, Feature64BitRegs */, |
| 290 | DeprecatedMFTB, DeprecatedDST]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 291 | def : ProcessorModel<"pwr6x", G5Model, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 292 | [DirectivePwr5x, FeatureAltivec, FeatureMFOCRF, |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 293 | FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 294 | FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec, |
| 295 | FeatureSTFIWX, FeatureLFIWAX, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 296 | FeatureFPRND, Feature64Bit, |
| 297 | DeprecatedMFTB, DeprecatedDST]>; |
Hal Finkel | 42daeae | 2013-11-30 20:55:12 +0000 | [diff] [blame] | 298 | def : ProcessorModel<"pwr7", P7Model, |
Hal Finkel | f2b9c38 | 2012-06-11 15:43:08 +0000 | [diff] [blame] | 299 | [DirectivePwr7, FeatureAltivec, |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 300 | FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 301 | FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES, |
| 302 | FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX, |
| 303 | FeatureFPRND, FeatureFPCVT, FeatureISEL, |
| 304 | FeaturePOPCNTD, FeatureLDBRX, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 305 | Feature64Bit /*, Feature64BitRegs */, |
| 306 | DeprecatedMFTB, DeprecatedDST]>; |
Will Schmidt | 970ff64 | 2014-06-26 13:36:19 +0000 | [diff] [blame] | 307 | def : ProcessorModel<"pwr8", P7Model /* FIXME: Update to P8Model when available */, |
| 308 | [DirectivePwr8, FeatureAltivec, |
| 309 | FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE, |
| 310 | FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES, |
| 311 | FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX, |
| 312 | FeatureFPRND, FeatureFPCVT, FeatureISEL, |
| 313 | FeaturePOPCNTD, FeatureLDBRX, |
| 314 | Feature64Bit /*, Feature64BitRegs */, |
| 315 | DeprecatedMFTB, DeprecatedDST]>; |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 316 | def : Processor<"ppc", G3Itineraries, [Directive32]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 317 | def : ProcessorModel<"ppc64", G5Model, |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 318 | [Directive64, FeatureAltivec, |
Hal Finkel | 7ac4592 | 2013-04-03 14:40:18 +0000 | [diff] [blame] | 319 | FeatureMFOCRF, FeatureFSqrt, FeatureFRES, |
| 320 | FeatureFRSQRTE, FeatureSTFIWX, |
Jim Laskey | 13a1945 | 2005-10-22 08:04:24 +0000 | [diff] [blame] | 321 | Feature64Bit /*, Feature64BitRegs */]>; |
Bill Schmidt | 0a9170d | 2013-07-26 01:35:43 +0000 | [diff] [blame] | 322 | def : ProcessorModel<"ppc64le", G5Model, |
| 323 | [Directive64, FeatureAltivec, |
| 324 | FeatureMFOCRF, FeatureFSqrt, FeatureFRES, |
| 325 | FeatureFRSQRTE, FeatureSTFIWX, |
| 326 | Feature64Bit /*, Feature64BitRegs */]>; |
Jim Laskey | 74ab996 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 327 | |
Chris Lattner | 4f2e4e0 | 2007-03-06 00:59:59 +0000 | [diff] [blame] | 328 | //===----------------------------------------------------------------------===// |
| 329 | // Calling Conventions |
| 330 | //===----------------------------------------------------------------------===// |
| 331 | |
| 332 | include "PPCCallingConv.td" |
| 333 | |
Chris Lattner | 51348c5 | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 334 | def PPCInstrInfo : InstrInfo { |
Chris Lattner | 51348c5 | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 335 | let isLittleEndianEncoding = 1; |
Hal Finkel | 2345347 | 2013-12-19 16:13:01 +0000 | [diff] [blame] | 336 | |
| 337 | // FIXME: Unset this when no longer needed! |
| 338 | let decodePositionallyEncodedOperands = 1; |
Hal Finkel | 5457bd0 | 2014-03-13 07:57:54 +0000 | [diff] [blame] | 339 | |
| 340 | let noNamedPositionallyEncodedOperands = 1; |
Chris Lattner | 51348c5 | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 341 | } |
| 342 | |
Ulrich Weigand | 640192d | 2013-05-03 19:49:39 +0000 | [diff] [blame] | 343 | def PPCAsmParser : AsmParser { |
| 344 | let ShouldEmitMatchRegisterName = 0; |
| 345 | } |
| 346 | |
Ulrich Weigand | c0944b5 | 2013-07-08 14:49:37 +0000 | [diff] [blame] | 347 | def PPCAsmParserVariant : AsmParserVariant { |
| 348 | int Variant = 0; |
| 349 | |
| 350 | // We do not use hard coded registers in asm strings. However, some |
| 351 | // InstAlias definitions use immediate literals. Set RegisterPrefix |
| 352 | // so that those are not misinterpreted as registers. |
| 353 | string RegisterPrefix = "%"; |
| 354 | } |
| 355 | |
Chris Lattner | 0921e3b | 2005-10-14 23:37:35 +0000 | [diff] [blame] | 356 | def PPC : Target { |
Chris Lattner | 51348c5 | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 357 | // Information about the instructions. |
| 358 | let InstructionSet = PPCInstrInfo; |
Rafael Espindola | 50712a4 | 2013-12-02 04:55:42 +0000 | [diff] [blame] | 359 | |
Ulrich Weigand | 640192d | 2013-05-03 19:49:39 +0000 | [diff] [blame] | 360 | let AssemblyParsers = [PPCAsmParser]; |
Ulrich Weigand | c0944b5 | 2013-07-08 14:49:37 +0000 | [diff] [blame] | 361 | let AssemblyParserVariants = [PPCAsmParserVariant]; |
Chris Lattner | 0921e3b | 2005-10-14 23:37:35 +0000 | [diff] [blame] | 362 | } |