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