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