LLVM API Documentation
00001 //===- TableGen'erated file -------------------------------------*- C++ -*-===// 00002 // 00003 // Subtarget Enumeration Source Fragment 00004 // 00005 // Automatically generated file, do not edit! 00006 // 00007 //===----------------------------------------------------------------------===// 00008 00009 #include "llvm/Target/SubtargetFeature.h" 00010 #include "llvm/Target/TargetInstrItineraries.h" 00011 00012 enum { 00013 BPU = 1 << 0, 00014 FPU1 = 1 << 1, 00015 FPU2 = 1 << 2, 00016 IU1 = 1 << 3, 00017 IU2 = 1 << 4, 00018 IU3 = 1 << 5, 00019 IU4 = 1 << 6, 00020 SLU = 1 << 7, 00021 SRU = 1 << 8, 00022 VFPU = 1 << 9, 00023 VIU1 = 1 << 10, 00024 VIU2 = 1 << 11, 00025 VPU = 1 << 12 00026 }; 00027 00028 enum { 00029 Directive32 = 1 << 0, 00030 Directive601 = 1 << 1, 00031 Directive602 = 1 << 2, 00032 Directive603 = 1 << 3, 00033 Directive604 = 1 << 4, 00034 Directive620 = 1 << 5, 00035 Directive64 = 1 << 6, 00036 Directive7400 = 1 << 7, 00037 Directive750 = 1 << 8, 00038 Directive970 = 1 << 9, 00039 Feature64Bit = 1 << 10, 00040 Feature64BitRegs = 1 << 11, 00041 FeatureAltivec = 1 << 12, 00042 FeatureFSqrt = 1 << 13, 00043 FeatureGPUL = 1 << 14, 00044 FeatureSTFIWX = 1 << 15 00045 }; 00046 00047 // Sorted (by key) array of values for CPU features. 00048 static const llvm::SubtargetFeatureKV FeatureKV[] = { 00049 { "64bit", "Enable 64-bit instructions", Feature64Bit, 0 }, 00050 { "64bitregs", "Enable 64-bit registers usage for ppc32 [beta]", Feature64BitRegs, 0 }, 00051 { "altivec", "Enable Altivec instructions", FeatureAltivec, 0 }, 00052 { "fsqrt", "Enable the fsqrt instruction", FeatureFSqrt, 0 }, 00053 { "gpul", "Enable GPUL instructions", FeatureGPUL, 0 }, 00054 { "stfiwx", "Enable the stfiwx instruction", FeatureSTFIWX, 0 } 00055 }; 00056 00057 enum { 00058 FeatureKVSize = sizeof(FeatureKV)/sizeof(llvm::SubtargetFeatureKV) 00059 }; 00060 00061 // Sorted (by key) array of values for CPU subtype. 00062 static const llvm::SubtargetFeatureKV SubTypeKV[] = { 00063 { "601", "Select the 601 processor", Directive601, 0 }, 00064 { "602", "Select the 602 processor", Directive602, 0 }, 00065 { "603", "Select the 603 processor", Directive603, 0 }, 00066 { "603e", "Select the 603e processor", Directive603, 0 }, 00067 { "603ev", "Select the 603ev processor", Directive603, 0 }, 00068 { "604", "Select the 604 processor", Directive604, 0 }, 00069 { "604e", "Select the 604e processor", Directive604, 0 }, 00070 { "620", "Select the 620 processor", Directive620, 0 }, 00071 { "7400", "Select the 7400 processor", Directive7400 | FeatureAltivec, 0 }, 00072 { "7450", "Select the 7450 processor", Directive7400 | FeatureAltivec, 0 }, 00073 { "750", "Select the 750 processor", Directive750 | FeatureAltivec, 0 }, 00074 { "970", "Select the 970 processor", Directive970 | FeatureAltivec | FeatureGPUL | FeatureFSqrt | FeatureSTFIWX | Feature64Bit, 0 }, 00075 { "g3", "Select the g3 processor", Directive7400, 0 }, 00076 { "g4", "Select the g4 processor", Directive7400 | FeatureAltivec, 0 }, 00077 { "g4+", "Select the g4+ processor", Directive750 | FeatureAltivec, 0 }, 00078 { "g5", "Select the g5 processor", Directive970 | FeatureAltivec | FeatureGPUL | FeatureFSqrt | FeatureSTFIWX | Feature64Bit, 0 }, 00079 { "generic", "Select the generic processor", Directive32, 0 }, 00080 { "ppc", "Select the ppc processor", Directive32, 0 }, 00081 { "ppc64", "Select the ppc64 processor", Directive64 | FeatureAltivec | FeatureGPUL | FeatureFSqrt | FeatureSTFIWX | Feature64Bit, 0 } 00082 }; 00083 00084 enum { 00085 SubTypeKVSize = sizeof(SubTypeKV)/sizeof(llvm::SubtargetFeatureKV) 00086 }; 00087 00088 00089 enum { 00090 ItinClassesSize = 74 00091 }; 00092 static const llvm::InstrStage Stages[] = { 00093 { 0, 0 }, // No itinerary 00094 { 1, IU1 | IU2 }, // 1 00095 { 19, IU1 }, // 2 00096 { 1, FPU1 }, // 3 00097 { 3, FPU1 }, // 4 00098 { 5, IU1 }, // 5 00099 { 6, IU1 }, // 6 00100 { 3, IU1 }, // 7 00101 { 2, IU1 | IU2 }, // 8 00102 { 1, BPU }, // 9 00103 { 1, SRU }, // 10 00104 { 2, SLU }, // 11 00105 { 3, SLU }, // 12 00106 { 34, SLU }, // 13 00107 { 8, SLU }, // 14 00108 { 2, SRU }, // 15 00109 { 3, SRU }, // 16 00110 { 31, FPU1 }, // 17 00111 { 17, FPU1 }, // 18 00112 { 2, FPU1 }, // 19 00113 { 10, FPU1 }, // 20 00114 { 1, VIU1 }, // 21 00115 { 5, SLU }, // 22 00116 { 8, SRU }, // 23 00117 { 4, VFPU }, // 24 00118 { 3, VIU2 }, // 25 00119 { 1, VPU }, // 26 00120 { 1, IU1 | IU2 | IU3 | IU4 }, // 27 00121 { 23, IU2 }, // 28 00122 { 5, FPU1 }, // 29 00123 { 2, VFPU }, // 30 00124 { 4, IU2 }, // 31 00125 { 3, IU2 }, // 32 00126 { 2, IU1 | IU2 | IU3 | IU4 }, // 33 00127 { 2, IU2 }, // 34 00128 { 4, SLU }, // 35 00129 { 37, SLU }, // 36 00130 { 35, SLU }, // 37 00131 { 0, IU1 | IU2 | IU3 | IU4 }, // 38 00132 { 5, IU2 }, // 39 00133 { 35, FPU1 }, // 40 00134 { 21, FPU1 }, // 41 00135 { 14, FPU1 }, // 42 00136 { 4, VIU2 }, // 43 00137 { 2, VPU }, // 44 00138 { 4, VIU1 }, // 45 00139 { 3, IU1 | IU2 }, // 46 00140 { 68, IU1 }, // 47 00141 { 36, IU1 }, // 48 00142 { 6, IU2 }, // 49 00143 { 1, VFPU }, // 50 00144 { 6, FPU1 | FPU2 }, // 51 00145 { 7, IU1 | IU2 }, // 52 00146 { 5, IU1 | IU2 }, // 53 00147 { 4, IU1 | IU2 }, // 54 00148 { 1, IU2 }, // 55 00149 { 4, BPU }, // 56 00150 { 2, BPU }, // 57 00151 { 3, BPU }, // 58 00152 { 10, SLU }, // 59 00153 { 40, SLU }, // 60 00154 { 11, SLU }, // 61 00155 { 64, SLU }, // 62 00156 { 10, IU2 }, // 63 00157 { 8, IU2 }, // 64 00158 { 8, FPU1 | FPU2 }, // 65 00159 { 33, FPU1 | FPU2 }, // 66 00160 { 40, FPU1 | FPU2 }, // 67 00161 { 2, VIU1 }, // 68 00162 { 8, VFPU }, // 69 00163 { 5, VIU2 }, // 70 00164 { 3, VPU }, // 71 00165 { 0, 0 } // End itinerary 00166 }; 00167 00168 enum { 00169 StagesSize = sizeof(Stages)/sizeof(llvm::InstrStage) 00170 }; 00171 00172 static const llvm::InstrItinerary G3Itineraries[] = { 00173 { 9, 10 }, // 0 00174 { 10, 11 }, // 1 00175 { 10, 11 }, // 2 00176 { 10, 11 }, // 3 00177 { 3, 4 }, // 4 00178 { 17, 18 }, // 5 00179 { 18, 19 }, // 6 00180 { 19, 20 }, // 7 00181 { 3, 4 }, // 8 00182 { 20, 21 }, // 9 00183 { 0, 0 }, // 10 00184 { 1, 2 }, // 11 00185 { 0, 0 }, // 12 00186 { 2, 3 }, // 13 00187 { 1, 2 }, // 14 00188 { 3, 4 }, // 15 00189 { 0, 0 }, // 16 00190 { 4, 5 }, // 17 00191 { 0, 0 }, // 18 00192 { 0, 0 }, // 19 00193 { 5, 6 }, // 20 00194 { 6, 7 }, // 21 00195 { 7, 8 }, // 22 00196 { 0, 0 }, // 23 00197 { 1, 2 }, // 24 00198 { 0, 0 }, // 25 00199 { 1, 2 }, // 26 00200 { 0, 0 }, // 27 00201 { 8, 9 }, // 28 00202 { 11, 12 }, // 29 00203 { 12, 13 }, // 30 00204 { 12, 13 }, // 31 00205 { 0, 0 }, // 32 00206 { 11, 12 }, // 33 00207 { 12, 13 }, // 34 00208 { 0, 0 }, // 35 00209 { 0, 0 }, // 36 00210 { 11, 12 }, // 37 00211 { 11, 12 }, // 38 00212 { 11, 12 }, // 39 00213 { 13, 14 }, // 40 00214 { 0, 0 }, // 41 00215 { 0, 0 }, // 42 00216 { 12, 13 }, // 43 00217 { 0, 0 }, // 44 00218 { 0, 0 }, // 45 00219 { 0, 0 }, // 46 00220 { 0, 0 }, // 47 00221 { 0, 0 }, // 48 00222 { 14, 15 }, // 49 00223 { 12, 13 }, // 50 00224 { 11, 12 }, // 51 00225 { 0, 0 }, // 52 00226 { 15, 16 }, // 53 00227 { 10, 11 }, // 54 00228 { 10, 11 }, // 55 00229 { 16, 17 }, // 56 00230 { 16, 17 }, // 57 00231 { 16, 17 }, // 58 00232 { 10, 11 }, // 59 00233 { 15, 16 }, // 60 00234 { 15, 16 }, // 61 00235 { 15, 16 }, // 62 00236 { 15, 16 }, // 63 00237 { 15, 16 }, // 64 00238 { 16, 17 }, // 65 00239 { 0, 0 }, // 66 00240 { 0, 0 }, // 67 00241 { 0, 0 }, // 68 00242 { 0, 0 }, // 69 00243 { 0, 0 }, // 70 00244 { 0, 0 }, // 71 00245 { 0, 0 }, // 72 00246 { 0, 0 } // 73 00247 }; 00248 00249 static const llvm::InstrItinerary G4Itineraries[] = { 00250 { 9, 10 }, // 0 00251 { 10, 11 }, // 1 00252 { 10, 11 }, // 2 00253 { 10, 11 }, // 3 00254 { 3, 4 }, // 4 00255 { 17, 18 }, // 5 00256 { 18, 19 }, // 6 00257 { 3, 4 }, // 7 00258 { 3, 4 }, // 8 00259 { 20, 21 }, // 9 00260 { 0, 0 }, // 10 00261 { 1, 2 }, // 11 00262 { 0, 0 }, // 12 00263 { 2, 3 }, // 13 00264 { 1, 2 }, // 14 00265 { 4, 5 }, // 15 00266 { 21, 22 }, // 16 00267 { 4, 5 }, // 17 00268 { 0, 0 }, // 18 00269 { 0, 0 }, // 19 00270 { 5, 6 }, // 20 00271 { 6, 7 }, // 21 00272 { 7, 8 }, // 22 00273 { 0, 0 }, // 23 00274 { 1, 2 }, // 24 00275 { 0, 0 }, // 25 00276 { 1, 2 }, // 26 00277 { 0, 0 }, // 27 00278 { 8, 9 }, // 28 00279 { 0, 0 }, // 29 00280 { 11, 12 }, // 30 00281 { 11, 12 }, // 31 00282 { 11, 12 }, // 32 00283 { 11, 12 }, // 33 00284 { 11, 12 }, // 34 00285 { 0, 0 }, // 35 00286 { 0, 0 }, // 36 00287 { 11, 12 }, // 37 00288 { 11, 12 }, // 38 00289 { 11, 12 }, // 39 00290 { 13, 14 }, // 40 00291 { 11, 12 }, // 41 00292 { 0, 0 }, // 42 00293 { 12, 13 }, // 43 00294 { 0, 0 }, // 44 00295 { 0, 0 }, // 45 00296 { 0, 0 }, // 46 00297 { 0, 0 }, // 47 00298 { 11, 12 }, // 48 00299 { 22, 23 }, // 49 00300 { 14, 15 }, // 50 00301 { 11, 12 }, // 51 00302 { 0, 0 }, // 52 00303 { 15, 16 }, // 53 00304 { 10, 11 }, // 54 00305 { 10, 11 }, // 55 00306 { 16, 17 }, // 56 00307 { 16, 17 }, // 57 00308 { 10, 11 }, // 58 00309 { 10, 11 }, // 59 00310 { 15, 16 }, // 60 00311 { 15, 16 }, // 61 00312 { 15, 16 }, // 62 00313 { 15, 16 }, // 63 00314 { 15, 16 }, // 64 00315 { 23, 24 }, // 65 00316 { 25, 26 }, // 66 00317 { 24, 25 }, // 67 00318 { 21, 22 }, // 68 00319 { 24, 25 }, // 69 00320 { 21, 22 }, // 70 00321 { 26, 27 }, // 71 00322 { 21, 22 }, // 72 00323 { 21, 22 } // 73 00324 }; 00325 00326 static const llvm::InstrItinerary G4PlusItineraries[] = { 00327 { 9, 10 }, // 0 00328 { 34, 35 }, // 1 00329 { 34, 35 }, // 2 00330 { 34, 35 }, // 3 00331 { 29, 30 }, // 4 00332 { 40, 41 }, // 5 00333 { 41, 42 }, // 6 00334 { 29, 30 }, // 7 00335 { 29, 30 }, // 8 00336 { 42, 43 }, // 9 00337 { 0, 0 }, // 10 00338 { 27, 28 }, // 11 00339 { 0, 0 }, // 12 00340 { 28, 29 }, // 13 00341 { 27, 28 }, // 14 00342 { 29, 30 }, // 15 00343 { 30, 31 }, // 16 00344 { 29, 30 }, // 17 00345 { 0, 0 }, // 18 00346 { 0, 0 }, // 19 00347 { 31, 32 }, // 20 00348 { 31, 32 }, // 21 00349 { 32, 33 }, // 22 00350 { 0, 0 }, // 23 00351 { 27, 28 }, // 24 00352 { 0, 0 }, // 25 00353 { 33, 34 }, // 26 00354 { 0, 0 }, // 27 00355 { 33, 34 }, // 28 00356 { 0, 0 }, // 29 00357 { 12, 13 }, // 30 00358 { 12, 13 }, // 31 00359 { 12, 13 }, // 32 00360 { 12, 13 }, // 33 00361 { 32, 33 }, // 34 00362 { 0, 0 }, // 35 00363 { 0, 0 }, // 36 00364 { 35, 36 }, // 37 00365 { 35, 36 }, // 38 00366 { 12, 13 }, // 39 00367 { 36, 37 }, // 40 00368 { 12, 13 }, // 41 00369 { 12, 13 }, // 42 00370 { 12, 13 }, // 43 00371 { 0, 0 }, // 44 00372 { 0, 0 }, // 45 00373 { 12, 13 }, // 46 00374 { 12, 13 }, // 47 00375 { 12, 13 }, // 48 00376 { 12, 13 }, // 49 00377 { 37, 38 }, // 50 00378 { 12, 13 }, // 51 00379 { 0, 0 }, // 52 00380 { 38, 39 }, // 53 00381 { 34, 35 }, // 54 00382 { 32, 33 }, // 55 00383 { 31, 32 }, // 56 00384 { 31, 32 }, // 57 00385 { 39, 40 }, // 58 00386 { 34, 35 }, // 59 00387 { 34, 35 }, // 60 00388 { 34, 35 }, // 61 00389 { 34, 35 }, // 62 00390 { 27, 28 }, // 63 00391 { 38, 39 }, // 64 00392 { 12, 13 }, // 65 00393 { 43, 44 }, // 66 00394 { 24, 25 }, // 67 00395 { 30, 31 }, // 68 00396 { 45, 46 }, // 69 00397 { 21, 22 }, // 70 00398 { 44, 45 }, // 71 00399 { 44, 45 }, // 72 00400 { 44, 45 } // 73 00401 }; 00402 00403 static const llvm::InstrItinerary G5Itineraries[] = { 00404 { 9, 10 }, // 0 00405 { 56, 57 }, // 1 00406 { 57, 58 }, // 2 00407 { 58, 59 }, // 3 00408 { 65, 66 }, // 4 00409 { 66, 67 }, // 5 00410 { 66, 67 }, // 6 00411 { 51, 52 }, // 7 00412 { 51, 52 }, // 8 00413 { 51, 52 }, // 9 00414 { 67, 68 }, // 10 00415 { 46, 47 }, // 11 00416 { 47, 48 }, // 12 00417 { 48, 49 }, // 13 00418 { 8, 9 }, // 14 00419 { 49, 50 }, // 15 00420 { 50, 51 }, // 16 00421 { 51, 52 }, // 17 00422 { 0, 0 }, // 18 00423 { 52, 53 }, // 19 00424 { 53, 54 }, // 20 00425 { 53, 54 }, // 21 00426 { 54, 55 }, // 22 00427 { 55, 56 }, // 23 00428 { 54, 55 }, // 24 00429 { 8, 9 }, // 25 00430 { 8, 9 }, // 26 00431 { 1, 2 }, // 27 00432 { 1, 2 }, // 28 00433 { 0, 0 }, // 29 00434 { 12, 13 }, // 30 00435 { 0, 0 }, // 31 00436 { 59, 60 }, // 32 00437 { 12, 13 }, // 33 00438 { 60, 61 }, // 34 00439 { 12, 13 }, // 35 00440 { 61, 62 }, // 36 00441 { 12, 13 }, // 37 00442 { 22, 23 }, // 38 00443 { 22, 23 }, // 39 00444 { 62, 63 }, // 40 00445 { 12, 13 }, // 41 00446 { 22, 23 }, // 42 00447 { 61, 62 }, // 43 00448 { 60, 61 }, // 44 00449 { 11, 12 }, // 45 00450 { 12, 13 }, // 46 00451 { 61, 62 }, // 47 00452 { 22, 23 }, // 48 00453 { 61, 62 }, // 49 00454 { 37, 38 }, // 50 00455 { 35, 36 }, // 51 00456 { 0, 0 }, // 52 00457 { 60, 61 }, // 53 00458 { 34, 35 }, // 54 00459 { 32, 33 }, // 55 00460 { 32, 33 }, // 56 00461 { 12, 13 }, // 57 00462 { 63, 64 }, // 58 00463 { 12, 13 }, // 59 00464 { 64, 65 }, // 60 00465 { 12, 13 }, // 61 00466 { 0, 0 }, // 62 00467 { 0, 0 }, // 63 00468 { 55, 56 }, // 64 00469 { 12, 13 }, // 65 00470 { 70, 71 }, // 66 00471 { 69, 70 }, // 67 00472 { 30, 31 }, // 68 00473 { 69, 70 }, // 69 00474 { 68, 69 }, // 70 00475 { 71, 72 }, // 71 00476 { 68, 69 }, // 72 00477 { 71, 72 } // 73 00478 }; 00479 00480 // Sorted (by key) array of itineraries for CPU subtype. 00481 static const llvm::SubtargetInfoKV ProcItinKV[] = { 00482 { "601", (void *)&G3Itineraries }, 00483 { "602", (void *)&G3Itineraries }, 00484 { "603", (void *)&G3Itineraries }, 00485 { "603e", (void *)&G3Itineraries }, 00486 { "603ev", (void *)&G3Itineraries }, 00487 { "604", (void *)&G3Itineraries }, 00488 { "604e", (void *)&G3Itineraries }, 00489 { "620", (void *)&G3Itineraries }, 00490 { "7400", (void *)&G4Itineraries }, 00491 { "7450", (void *)&G4PlusItineraries }, 00492 { "750", (void *)&G4Itineraries }, 00493 { "970", (void *)&G5Itineraries }, 00494 { "g3", (void *)&G3Itineraries }, 00495 { "g4", (void *)&G4Itineraries }, 00496 { "g4+", (void *)&G4PlusItineraries }, 00497 { "g5", (void *)&G5Itineraries }, 00498 { "generic", (void *)&G3Itineraries }, 00499 { "ppc", (void *)&G3Itineraries }, 00500 { "ppc64", (void *)&G5Itineraries } 00501 }; 00502 00503 enum { 00504 ProcItinKVSize = sizeof(ProcItinKV)/sizeof(llvm::SubtargetInfoKV) 00505 }; 00506 00507 // ParseSubtargetFeatures - Parses features string setting specified 00508 // subtarget options. 00509 void llvm::PPCSubtarget::ParseSubtargetFeatures(const std::string &FS, 00510 const std::string &CPU) { 00511 SubtargetFeatures Features(FS); 00512 Features.setCPUIfNone(CPU); 00513 uint32_t Bits = Features.getBits(SubTypeKV, SubTypeKVSize, 00514 FeatureKV, FeatureKVSize); 00515 if ((Bits & Directive32) != 0 && DarwinDirective < PPC::DIR_32) DarwinDirective = PPC::DIR_32; 00516 if ((Bits & Directive601) != 0 && DarwinDirective < PPC::DIR_601) DarwinDirective = PPC::DIR_601; 00517 if ((Bits & Directive602) != 0 && DarwinDirective < PPC::DIR_602) DarwinDirective = PPC::DIR_602; 00518 if ((Bits & Directive603) != 0 && DarwinDirective < PPC::DIR_603) DarwinDirective = PPC::DIR_603; 00519 if ((Bits & Directive604) != 0 && DarwinDirective < PPC::DIR_603) DarwinDirective = PPC::DIR_603; 00520 if ((Bits & Directive620) != 0 && DarwinDirective < PPC::DIR_603) DarwinDirective = PPC::DIR_603; 00521 if ((Bits & Directive64) != 0 && DarwinDirective < PPC::DIR_64) DarwinDirective = PPC::DIR_64; 00522 if ((Bits & Directive7400) != 0 && DarwinDirective < PPC::DIR_7400) DarwinDirective = PPC::DIR_7400; 00523 if ((Bits & Directive750) != 0 && DarwinDirective < PPC::DIR_750) DarwinDirective = PPC::DIR_750; 00524 if ((Bits & Directive970) != 0 && DarwinDirective < PPC::DIR_970) DarwinDirective = PPC::DIR_970; 00525 if ((Bits & Feature64Bit) != 0) Has64BitSupport = true; 00526 if ((Bits & Feature64BitRegs) != 0) Use64BitRegs = true; 00527 if ((Bits & FeatureAltivec) != 0) HasAltivec = true; 00528 if ((Bits & FeatureFSqrt) != 0) HasFSQRT = true; 00529 if ((Bits & FeatureGPUL) != 0) IsGigaProcessor = true; 00530 if ((Bits & FeatureSTFIWX) != 0) HasSTFIWX = true; 00531 00532 InstrItinerary *Itinerary = (InstrItinerary *)Features.getInfo(ProcItinKV, ProcItinKVSize); 00533 InstrItins = InstrItineraryData(Stages, Itinerary); 00534 }