Lines Matching +full:gcc +full:- +full:msm8994

1 //===-- Host.cpp - Implement OS Host Detection ------------------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
18 #include "llvm/Config/llvm-config.h"
25 // Include the platform-specific parts of this class.
54 #define DEBUG_TYPE "host-detection"
56 //===----------------------------------------------------------------------===//
60 //===----------------------------------------------------------------------===//
78 // and so we must use an operating-system interface to determine the current in getHostCPUNameForPowerPC()
117 CPULen = CIP - CPUStart; in getHostCPUNameForPowerPC()
184 // which is undeterministic and wrong. Always return cortex-a53 for these SoC. in getHostCPUNameForARM()
185 if (Hardware.ends_with("MSM8994") || Hardware.ends_with("MSM8996")) in getHostCPUNameForARM()
186 return "cortex-a53"; in getHostCPUNameForARM()
193 // and is used in programs like sys-utils in getHostCPUNameForARM()
195 .Case("0x926", "arm926ej-s") in getHostCPUNameForARM()
197 .Case("0xb36", "arm1136j-s") in getHostCPUNameForARM()
198 .Case("0xb56", "arm1156t2-s") in getHostCPUNameForARM()
199 .Case("0xb76", "arm1176jz-s") in getHostCPUNameForARM()
200 .Case("0xc05", "cortex-a5") in getHostCPUNameForARM()
201 .Case("0xc07", "cortex-a7") in getHostCPUNameForARM()
202 .Case("0xc08", "cortex-a8") in getHostCPUNameForARM()
203 .Case("0xc09", "cortex-a9") in getHostCPUNameForARM()
204 .Case("0xc0f", "cortex-a15") in getHostCPUNameForARM()
205 .Case("0xc0e", "cortex-a17") in getHostCPUNameForARM()
206 .Case("0xc20", "cortex-m0") in getHostCPUNameForARM()
207 .Case("0xc23", "cortex-m3") in getHostCPUNameForARM()
208 .Case("0xc24", "cortex-m4") in getHostCPUNameForARM()
209 .Case("0xc27", "cortex-m7") in getHostCPUNameForARM()
210 .Case("0xd20", "cortex-m23") in getHostCPUNameForARM()
211 .Case("0xd21", "cortex-m33") in getHostCPUNameForARM()
212 .Case("0xd24", "cortex-m52") in getHostCPUNameForARM()
213 .Case("0xd22", "cortex-m55") in getHostCPUNameForARM()
214 .Case("0xd23", "cortex-m85") in getHostCPUNameForARM()
215 .Case("0xc18", "cortex-r8") in getHostCPUNameForARM()
216 .Case("0xd13", "cortex-r52") in getHostCPUNameForARM()
217 .Case("0xd16", "cortex-r52plus") in getHostCPUNameForARM()
218 .Case("0xd15", "cortex-r82") in getHostCPUNameForARM()
219 .Case("0xd14", "cortex-r82ae") in getHostCPUNameForARM()
220 .Case("0xd02", "cortex-a34") in getHostCPUNameForARM()
221 .Case("0xd04", "cortex-a35") in getHostCPUNameForARM()
222 .Case("0xd03", "cortex-a53") in getHostCPUNameForARM()
223 .Case("0xd05", "cortex-a55") in getHostCPUNameForARM()
224 .Case("0xd46", "cortex-a510") in getHostCPUNameForARM()
225 .Case("0xd80", "cortex-a520") in getHostCPUNameForARM()
226 .Case("0xd88", "cortex-a520ae") in getHostCPUNameForARM()
227 .Case("0xd07", "cortex-a57") in getHostCPUNameForARM()
228 .Case("0xd06", "cortex-a65") in getHostCPUNameForARM()
229 .Case("0xd43", "cortex-a65ae") in getHostCPUNameForARM()
230 .Case("0xd08", "cortex-a72") in getHostCPUNameForARM()
231 .Case("0xd09", "cortex-a73") in getHostCPUNameForARM()
232 .Case("0xd0a", "cortex-a75") in getHostCPUNameForARM()
233 .Case("0xd0b", "cortex-a76") in getHostCPUNameForARM()
234 .Case("0xd0e", "cortex-a76ae") in getHostCPUNameForARM()
235 .Case("0xd0d", "cortex-a77") in getHostCPUNameForARM()
236 .Case("0xd41", "cortex-a78") in getHostCPUNameForARM()
237 .Case("0xd42", "cortex-a78ae") in getHostCPUNameForARM()
238 .Case("0xd4b", "cortex-a78c") in getHostCPUNameForARM()
239 .Case("0xd47", "cortex-a710") in getHostCPUNameForARM()
240 .Case("0xd4d", "cortex-a715") in getHostCPUNameForARM()
241 .Case("0xd81", "cortex-a720") in getHostCPUNameForARM()
242 .Case("0xd89", "cortex-a720ae") in getHostCPUNameForARM()
243 .Case("0xd87", "cortex-a725") in getHostCPUNameForARM()
244 .Case("0xd44", "cortex-x1") in getHostCPUNameForARM()
245 .Case("0xd4c", "cortex-x1c") in getHostCPUNameForARM()
246 .Case("0xd48", "cortex-x2") in getHostCPUNameForARM()
247 .Case("0xd4e", "cortex-x3") in getHostCPUNameForARM()
248 .Case("0xd82", "cortex-x4") in getHostCPUNameForARM()
249 .Case("0xd85", "cortex-x925") in getHostCPUNameForARM()
250 .Case("0xd4a", "neoverse-e1") in getHostCPUNameForARM()
251 .Case("0xd0c", "neoverse-n1") in getHostCPUNameForARM()
252 .Case("0xd49", "neoverse-n2") in getHostCPUNameForARM()
253 .Case("0xd8e", "neoverse-n3") in getHostCPUNameForARM()
254 .Case("0xd40", "neoverse-v1") in getHostCPUNameForARM()
255 .Case("0xd4f", "neoverse-v2") in getHostCPUNameForARM()
256 .Case("0xd84", "neoverse-v3") in getHostCPUNameForARM()
257 .Case("0xd83", "neoverse-v3ae") in getHostCPUNameForARM()
301 .Case("0x800", "cortex-a73") // Kryo 2xx Gold in getHostCPUNameForARM()
302 .Case("0x801", "cortex-a73") // Kryo 2xx Silver in getHostCPUNameForARM()
303 .Case("0x802", "cortex-a75") // Kryo 3xx Gold in getHostCPUNameForARM()
304 .Case("0x803", "cortex-a75") // Kryo 3xx Silver in getHostCPUNameForARM()
305 .Case("0x804", "cortex-a76") // Kryo 4xx Gold in getHostCPUNameForARM()
306 .Case("0x805", "cortex-a76") // Kryo 4xx/5xx Silver in getHostCPUNameForARM()
309 .Case("0x001", "oryon-1") in getHostCPUNameForARM()
334 return "exynos-m3"; in getHostCPUNameForARM()
336 return "exynos-m4"; in getHostCPUNameForARM()
343 .Case("0xd49", "neoverse-n2") in getHostCPUNameForARM()
365 case 2094: // z9-109 not supported by LLVM in getCPUNameFromS390Model()
427 Pos += sizeof("machine = ") - 1; in getHostCPUNameForS390x()
454 .Case("sifive,u74-mc", "sifive-u74") in getHostCPUNameForRISCV()
455 .Case("sifive,bullet0", "sifive-u74") in getHostCPUNameForRISCV()
534 // or test-suite, but are used in external projects e.g. libstdcxx
563 /// getX86CpuIDAndInfo - Execute the specified cpuid and return the 4 values in
569 // gcc doesn't know cpuid would clobber ebx/rbx. Preserve it manually. in getX86CpuIDAndInfo()
637 /// getX86CpuIDAndInfoEx - Execute the specified cpuid with subleaf and return
645 // gcc doesn't know cpuid would clobber ebx/rbx. Preserve it manually. in getX86CpuIDAndInfoEx()
696 *Family = (EAX >> 8) & 0xf; // Bits 8 - 11 in detectX86FamilyModel()
697 *Model = (EAX >> 4) & 0xf; // Bits 4 - 7 in detectX86FamilyModel()
701 *Family += (EAX >> 20) & 0xff; // Bits 20 - 27 in detectX86FamilyModel()
703 *Model += ((EAX >> 16) & 0xf) << 4; // Bits 16 - 19 in detectX86FamilyModel()
725 CPU = "pentium-mmx"; in getIntelProcessorTypeAndSubtype()
735 // Pentium Dual-Core processor, Intel Xeon processor, model in getIntelProcessorTypeAndSubtype()
808 case 0xa5: // Comet Lake-H/S in getIntelProcessorTypeAndSubtype()
809 case 0xa6: // Comet Lake-U in getIntelProcessorTypeAndSubtype()
832 CPU = "skylake-avx512"; in getIntelProcessorTypeAndSubtype()
847 CPU = "icelake-client"; in getIntelProcessorTypeAndSubtype()
888 CPU = "arrowlake-s"; in getIntelProcessorTypeAndSubtype()
909 CPU = "graniterapids-d"; in getIntelProcessorTypeAndSubtype()
917 CPU = "icelake-server"; in getIntelProcessorTypeAndSubtype()
957 CPU = "goldmont-plus"; in getIntelProcessorTypeAndSubtype()
998 // They're used above to keep the code in sync with compiler-rt. in getIntelProcessorTypeAndSubtype()
1003 CPU = "icelake-client"; in getIntelProcessorTypeAndSubtype()
1011 CPU = "skylake-avx512"; in getIntelProcessorTypeAndSubtype()
1040 CPU = "pentium-m"; in getIntelProcessorTypeAndSubtype()
1089 CPU = "k6-2"; in getAMDProcessorTypeAndSubtype()
1093 CPU = "k6-3"; in getAMDProcessorTypeAndSubtype()
1102 CPU = "athlon-xp"; in getAMDProcessorTypeAndSubtype()
1109 CPU = "k8-sse3"; in getAMDProcessorTypeAndSubtype()
1139 break; // 60h-7Fh: Excavator in getAMDProcessorTypeAndSubtype()
1144 break; // 30h-3Fh: Steamroller in getAMDProcessorTypeAndSubtype()
1149 break; // 02h, 10h-1Fh: Piledriver in getAMDProcessorTypeAndSubtype()
1153 break; // 00h-0Fh: Bulldozer in getAMDProcessorTypeAndSubtype()
1168 // Family 17h Models 30h-3Fh (Starship) Zen 2 in getAMDProcessorTypeAndSubtype()
1170 // Family 17h Models 60h-67h (Renoir) Zen 2 in getAMDProcessorTypeAndSubtype()
1171 // Family 17h Models 68h-6Fh (Lucienne) Zen 2 in getAMDProcessorTypeAndSubtype()
1172 // Family 17h Models 70h-7Fh (Matisse) Zen 2 in getAMDProcessorTypeAndSubtype()
1173 // Family 17h Models 84h-87h (ProjectX) Zen 2 in getAMDProcessorTypeAndSubtype()
1174 // Family 17h Models 90h-97h (VanGogh) Zen 2 in getAMDProcessorTypeAndSubtype()
1175 // Family 17h Models 98h-9Fh (Mero) Zen 2 in getAMDProcessorTypeAndSubtype()
1176 // Family 17h Models A0h-AFh (Mendocino) Zen 2 in getAMDProcessorTypeAndSubtype()
1182 // Family 17h Models 10h-1Fh (Raven1) Zen in getAMDProcessorTypeAndSubtype()
1183 // Family 17h Models 10h-1Fh (Picasso) Zen+ in getAMDProcessorTypeAndSubtype()
1184 // Family 17h Models 20h-2Fh (Raven2 x86) Zen in getAMDProcessorTypeAndSubtype()
1195 // Family 19h Models 00h-0Fh (Genesis, Chagall) Zen 3 in getAMDProcessorTypeAndSubtype()
1196 // Family 19h Models 20h-2Fh (Vermeer) Zen 3 in getAMDProcessorTypeAndSubtype()
1197 // Family 19h Models 30h-3Fh (Badami) Zen 3 in getAMDProcessorTypeAndSubtype()
1198 // Family 19h Models 40h-4Fh (Rembrandt) Zen 3+ in getAMDProcessorTypeAndSubtype()
1199 // Family 19h Models 50h-5Fh (Cezanne) Zen 3 in getAMDProcessorTypeAndSubtype()
1206 // Family 19h Models 10h-1Fh (Stones; Storm Peak) Zen 4 in getAMDProcessorTypeAndSubtype()
1207 // Family 19h Models 60h-6Fh (Raphael) Zen 4 in getAMDProcessorTypeAndSubtype()
1208 // Family 19h Models 70h-77h (Phoenix, Hawkpoint1) Zen 4 in getAMDProcessorTypeAndSubtype()
1209 // Family 19h Models 78h-7Fh (Phoenix 2, Hawkpoint2) Zen 4 in getAMDProcessorTypeAndSubtype()
1210 // Family 19h Models A0h-AFh (Stones-Dense) Zen 4 in getAMDProcessorTypeAndSubtype()
1220 // Models 00h-0Fh (Breithorn). in getAMDProcessorTypeAndSubtype()
1221 // Models 10h-1Fh (Breithorn-Dense). in getAMDProcessorTypeAndSubtype()
1222 // Models 20h-2Fh (Strix 1). in getAMDProcessorTypeAndSubtype()
1223 // Models 30h-37h (Strix 2). in getAMDProcessorTypeAndSubtype()
1224 // Models 38h-3Fh (Strix 3). in getAMDProcessorTypeAndSubtype()
1225 // Models 40h-4Fh (Granite Ridge). in getAMDProcessorTypeAndSubtype()
1226 // Models 50h-5Fh (Weisshorn). in getAMDProcessorTypeAndSubtype()
1227 // Models 60h-6Fh (Krackan1). in getAMDProcessorTypeAndSubtype()
1228 // Models 70h-77h (Sarlak). in getAMDProcessorTypeAndSubtype()
1393 // same or similar to compiler-rt. in getHostCPUName()
1460 StringRef Content = P ? P->getBuffer() : ""; in getHostCPUName()
1466 StringRef Content = P ? P->getBuffer() : ""; in getHostCPUName()
1472 StringRef Content = P ? P->getBuffer() : ""; in getHostCPUName()
1479 // It is stored as 31 bit pointer and will be zero-extended to 64 bit. in getHostCPUName()
1481 // Since its stored as a 31-bit pointer, get the 4 bytes from the start in getHostCPUName()
1487 // The model number is located in the CVT prefix at offset -6 and stored as in getHostCPUName()
1489 uint16_t Id = *(uint16_t *)&CVT[-6]; in getHostCPUName()
1520 return "apple-a7"; in getHostCPUName()
1522 return "apple-a8"; in getHostCPUName()
1524 return "apple-a9"; in getHostCPUName()
1526 return "apple-a10"; in getHostCPUName()
1528 return "apple-a11"; in getHostCPUName()
1530 return "apple-a12"; in getHostCPUName()
1532 return "apple-a13"; in getHostCPUName()
1534 return "apple-m1"; in getHostCPUName()
1536 return "apple-m2"; in getHostCPUName()
1538 return "apple-m3"; in getHostCPUName()
1541 return "apple-m3"; in getHostCPUName()
1589 case 0xc000: // Loongson 64bit, 4-issue in getHostCPUName()
1591 case 0xd000: // Loongson 64bit, 6-issue in getHostCPUName()
1603 StringRef Content = P ? P->getBuffer() : ""; in getHostCPUName()
1609 return "generic-rv64"; in getHostCPUName()
1611 return "generic-rv32"; in getHostCPUName()
1650 .StartsWith("SPARC-M7", "niagara4" /* "niagara7" */) in getHostCPUNameForSPARC()
1651 .StartsWith("SPARC-S7", "niagara4" /* "niagara7" */) in getHostCPUNameForSPARC()
1652 .StartsWith("SPARC-M8", "niagara4" /* "m8" */) in getHostCPUNameForSPARC()
1660 StringRef Content = P ? P->getBuffer() : ""; in getHostCPUName()
1670 ksp = kstat_lookup(kc, const_cast<char *>("cpu_info"), -1, NULL); in getHostCPUName()
1671 if (ksp != NULL && kstat_read(kc, ksp, NULL) != -1 && in getHostCPUName()
1672 ksp->ks_type == KSTAT_TYPE_NAMED) in getHostCPUName()
1675 if (brand != NULL && brand->data_type == KSTAT_DATA_STRING) in getHostCPUName()
1690 .Case("UltraSPARC-I", "ultrasparc") in getHostCPUName()
1691 .Case("UltraSPARC-II", "ultrasparc") in getHostCPUName()
1692 .Case("UltraSPARC-IIe", "ultrasparc") in getHostCPUName()
1693 .Case("UltraSPARC-IIi", "ultrasparc") in getHostCPUName()
1694 .Case("SPARC64-III", "ultrasparc") in getHostCPUName()
1695 .Case("SPARC64-IV", "ultrasparc") in getHostCPUName()
1696 .Case("UltraSPARC-III", "ultrasparc3") in getHostCPUName()
1697 .Case("UltraSPARC-III+", "ultrasparc3") in getHostCPUName()
1698 .Case("UltraSPARC-IIIi", "ultrasparc3") in getHostCPUName()
1699 .Case("UltraSPARC-IIIi+", "ultrasparc3") in getHostCPUName()
1700 .Case("UltraSPARC-IV", "ultrasparc3") in getHostCPUName()
1701 .Case("UltraSPARC-IV+", "ultrasparc3") in getHostCPUName()
1702 .Case("SPARC64-V", "ultrasparc3") in getHostCPUName()
1703 .Case("SPARC64-VI", "ultrasparc3") in getHostCPUName()
1704 .Case("SPARC64-VII", "ultrasparc3") in getHostCPUName()
1705 .Case("UltraSPARC-T1", "niagara") in getHostCPUName()
1706 .Case("UltraSPARC-T2", "niagara2") in getHostCPUName()
1707 .Case("UltraSPARC-T2", "niagara2") in getHostCPUName()
1708 .Case("UltraSPARC-T2+", "niagara2") in getHostCPUName()
1709 .Case("SPARC-T3", "niagara3") in getHostCPUName()
1710 .Case("SPARC-T4", "niagara4") in getHostCPUName()
1711 .Case("SPARC-T5", "niagara4") in getHostCPUName()
1713 .Case("SPARC-M7", "niagara4" /* "niagara7" */) in getHostCPUName()
1714 .Case("SPARC-S7", "niagara4" /* "niagara7" */) in getHostCPUName()
1715 .Case("SPARC-M8", "niagara4" /* "m8" */) in getHostCPUName()
1875 // detecting features using the "-march=native" flag. in getHostCPUFeatures()
1878 Features["amx-bf16"] = HasLeaf7 && ((EDX >> 22) & 1) && HasAMXSave; in getHostCPUFeatures()
1880 Features["amx-tile"] = HasLeaf7 && ((EDX >> 24) & 1) && HasAMXSave; in getHostCPUFeatures()
1881 Features["amx-int8"] = HasLeaf7 && ((EDX >> 25) & 1) && HasAMXSave; in getHostCPUFeatures()
1893 Features["amx-fp16"] = HasLeaf7Subleaf1 && ((EAX >> 21) & 1) && HasAMXSave; in getHostCPUFeatures()
1899 Features["amx-complex"] = HasLeaf7Subleaf1 && ((EDX >> 8) & 1) && HasAMXSave; in getHostCPUFeatures()
1903 Features["avx10.1-256"] = HasLeaf7Subleaf1 && ((EDX >> 19) & 1); in getHostCPUFeatures()
1931 Features["avx10.1-512"] = in getHostCPUFeatures()
1932 Features["avx10.1-256"] && HasLeaf24 && ((EBX >> 18) & 1); in getHostCPUFeatures()
1944 P->getBuffer().split(Lines, "\n"); in getHostCPUFeatures()
1965 .Case("fp", "fp-armv8") in getHostCPUFeatures()
1976 .Case("idiva", "hwdiv-arm") in getHostCPUFeatures()
2098 // TODO: Re-enable zacas when it is marked non-experimental again. in getHostCPUFeatures()
2104 // TODO: set unaligned-scalar-mem if RISCV_HWPROBE_KEY_MISALIGNED_PERF returns in getHostCPUFeatures()