Lines Matching full:features
444 // Look for the CPU features.
447 if (Lines[I].starts_with("features")) {
648 // Read control register 0 (XCR0). Used to detect features such as AVX.
682 #define testFeature(F) (Features[F / 32] & (1 << (F % 32))) != 0
686 const unsigned *Features,
1087 const unsigned *Features,
1261 unsigned *Features) {
1265 Features[F / 32] |= 1U << (F % 32);
1404 unsigned Features[(X86::CPU_FEATURE_MAX + 31) / 32] = {0};
1406 getAvailableFeatures(ECX, EDX, MaxLeaf, Features);
1416 CPU = getIntelProcessorTypeAndSubtype(Family, Model, Features, &Type,
1419 CPU = getAMDProcessorTypeAndSubtype(Family, Model, Features, &Type,
1814 StringMap<bool> Features;
1817 return Features;
1821 Features["cx8"] = (EDX >> 8) & 1;
1822 Features["cmov"] = (EDX >> 15) & 1;
1823 Features["mmx"] = (EDX >> 23) & 1;
1824 Features["fxsr"] = (EDX >> 24) & 1;
1825 Features["sse"] = (EDX >> 25) & 1;
1826 Features["sse2"] = (EDX >> 26) & 1;
1828 Features["sse3"] = (ECX >> 0) & 1;
1829 Features["pclmul"] = (ECX >> 1) & 1;
1830 Features["ssse3"] = (ECX >> 9) & 1;
1831 Features["cx16"] = (ECX >> 13) & 1;
1832 Features["sse4.1"] = (ECX >> 19) & 1;
1833 Features["sse4.2"] = (ECX >> 20) & 1;
1834 Features["crc32"] = Features["sse4.2"];
1835 Features["movbe"] = (ECX >> 22) & 1;
1836 Features["popcnt"] = (ECX >> 23) & 1;
1837 Features["aes"] = (ECX >> 25) & 1;
1838 Features["rdrnd"] = (ECX >> 30) & 1;
1858 Features["avx"] = HasAVXSave;
1859 Features["fma"] = ((ECX >> 12) & 1) && HasAVXSave;
1861 Features["xsave"] = ((ECX >> 26) & 1) && HasAVXSave;
1862 Features["f16c"] = ((ECX >> 29) & 1) && HasAVXSave;
1869 Features["sahf"] = HasExtLeaf1 && ((ECX >> 0) & 1);
1870 Features["lzcnt"] = HasExtLeaf1 && ((ECX >> 5) & 1);
1871 Features["sse4a"] = HasExtLeaf1 && ((ECX >> 6) & 1);
1872 Features["prfchw"] = HasExtLeaf1 && ((ECX >> 8) & 1);
1873 Features["xop"] = HasExtLeaf1 && ((ECX >> 11) & 1) && HasAVXSave;
1874 Features["lwp"] = HasExtLeaf1 && ((ECX >> 15) & 1);
1875 Features["fma4"] = HasExtLeaf1 && ((ECX >> 16) & 1) && HasAVXSave;
1876 Features["tbm"] = HasExtLeaf1 && ((ECX >> 21) & 1);
1877 Features["mwaitx"] = HasExtLeaf1 && ((ECX >> 29) & 1);
1879 Features["64bit"] = HasExtLeaf1 && ((EDX >> 29) & 1);
1881 // Miscellaneous memory related features, detected by
1885 Features["clzero"] = HasExtLeaf8 && ((EBX >> 0) & 1);
1886 Features["rdpru"] = HasExtLeaf8 && ((EBX >> 4) & 1);
1887 Features["wbnoinvd"] = HasExtLeaf8 && ((EBX >> 9) & 1);
1892 Features["fsgsbase"] = HasLeaf7 && ((EBX >> 0) & 1);
1893 Features["sgx"] = HasLeaf7 && ((EBX >> 2) & 1);
1894 Features["bmi"] = HasLeaf7 && ((EBX >> 3) & 1);
1896 Features["avx2"] = HasLeaf7 && ((EBX >> 5) & 1) && HasAVXSave;
1897 Features["bmi2"] = HasLeaf7 && ((EBX >> 8) & 1);
1898 Features["invpcid"] = HasLeaf7 && ((EBX >> 10) & 1);
1899 Features["rtm"] = HasLeaf7 && ((EBX >> 11) & 1);
1901 Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save;
1902 if (Features["avx512f"])
1903 Features["evex512"] = true;
1904 Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save;
1905 Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1);
1906 Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1);
1907 Features["avx512ifma"] = HasLeaf7 && ((EBX >> 21) & 1) && HasAVX512Save;
1908 Features["clflushopt"] = HasLeaf7 && ((EBX >> 23) & 1);
1909 Features["clwb"] = HasLeaf7 && ((EBX >> 24) & 1);
1910 Features["avx512cd"] = HasLeaf7 && ((EBX >> 28) & 1) && HasAVX512Save;
1911 Features["sha"] = HasLeaf7 && ((EBX >> 29) & 1);
1912 Features["avx512bw"] = HasLeaf7 && ((EBX >> 30) & 1) && HasAVX512Save;
1913 Features["avx512vl"] = HasLeaf7 && ((EBX >> 31) & 1) && HasAVX512Save;
1915 Features["avx512vbmi"] = HasLeaf7 && ((ECX >> 1) & 1) && HasAVX512Save;
1916 Features["pku"] = HasLeaf7 && ((ECX >> 4) & 1);
1917 Features["waitpkg"] = HasLeaf7 && ((ECX >> 5) & 1);
1918 Features["avx512vbmi2"] = HasLeaf7 && ((ECX >> 6) & 1) && HasAVX512Save;
1919 Features["shstk"] = HasLeaf7 && ((ECX >> 7) & 1);
1920 Features["gfni"] = HasLeaf7 && ((ECX >> 8) & 1);
1921 Features["vaes"] = HasLeaf7 && ((ECX >> 9) & 1) && HasAVXSave;
1922 Features["vpclmulqdq"] = HasLeaf7 && ((ECX >> 10) & 1) && HasAVXSave;
1923 Features["avx512vnni"] = HasLeaf7 && ((ECX >> 11) & 1) && HasAVX512Save;
1924 Features["avx512bitalg"] = HasLeaf7 && ((ECX >> 12) & 1) && HasAVX512Save;
1925 Features["avx512vpopcntdq"] = HasLeaf7 && ((ECX >> 14) & 1) && HasAVX512Save;
1926 Features["rdpid"] = HasLeaf7 && ((ECX >> 22) & 1);
1927 Features["kl"] = HasLeaf7 && ((ECX >> 23) & 1); // key locker
1928 Features["cldemote"] = HasLeaf7 && ((ECX >> 25) & 1);
1929 Features["movdiri"] = HasLeaf7 && ((ECX >> 27) & 1);
1930 Features["movdir64b"] = HasLeaf7 && ((ECX >> 28) & 1);
1931 Features["enqcmd"] = HasLeaf7 && ((ECX >> 29) & 1);
1933 Features["uintr"] = HasLeaf7 && ((EDX >> 5) & 1);
1934 Features["avx512vp2intersect"] =
1936 Features["serialize"] = HasLeaf7 && ((EDX >> 14) & 1);
1937 Features["tsxldtrk"] = HasLeaf7 && ((EDX >> 16) & 1);
1946 // detecting features using the "-march=native" flag.
1948 Features["pconfig"] = HasLeaf7 && ((EDX >> 18) & 1);
1949 Features["amx-bf16"] = HasLeaf7 && ((EDX >> 22) & 1) && HasAMXSave;
1950 Features["avx512fp16"] = HasLeaf7 && ((EDX >> 23) & 1) && HasAVX512Save;
1951 Features["amx-tile"] = HasLeaf7 && ((EDX >> 24) & 1) && HasAMXSave;
1952 Features["amx-int8"] = HasLeaf7 && ((EDX >> 25) & 1) && HasAMXSave;
1958 Features["sha512"] = HasLeaf7Subleaf1 && ((EAX >> 0) & 1);
1959 Features["sm3"] = HasLeaf7Subleaf1 && ((EAX >> 1) & 1);
1960 Features["sm4"] = HasLeaf7Subleaf1 && ((EAX >> 2) & 1);
1961 Features["raoint"] = HasLeaf7Subleaf1 && ((EAX >> 3) & 1);
1962 Features["avxvnni"] = HasLeaf7Subleaf1 && ((EAX >> 4) & 1) && HasAVXSave;
1963 Features["avx512bf16"] = HasLeaf7Subleaf1 && ((EAX >> 5) & 1) && HasAVX512Save;
1964 Features["amx-fp16"] = HasLeaf7Subleaf1 && ((EAX >> 21) & 1) && HasAMXSave;
1965 Features["cmpccxadd"] = HasLeaf7Subleaf1 && ((EAX >> 7) & 1);
1966 Features["hreset"] = HasLeaf7Subleaf1 && ((EAX >> 22) & 1);
1967 Features["avxifma"] = HasLeaf7Subleaf1 && ((EAX >> 23) & 1) && HasAVXSave;
1968 Features["movrs"] = HasLeaf7Subleaf1 && ((EAX >> 31) & 1);
1969 Features["avxvnniint8"] = HasLeaf7Subleaf1 && ((EDX >> 4) & 1) && HasAVXSave;
1970 Features["avxneconvert"] = HasLeaf7Subleaf1 && ((EDX >> 5) & 1) && HasAVXSave;
1971 Features["amx-complex"] = HasLeaf7Subleaf1 && ((EDX >> 8) & 1) && HasAMXSave;
1972 Features["avxvnniint16"] = HasLeaf7Subleaf1 && ((EDX >> 10) & 1) && HasAVXSave;
1973 Features["prefetchi"] = HasLeaf7Subleaf1 && ((EDX >> 14) & 1);
1974 Features["usermsr"] = HasLeaf7Subleaf1 && ((EDX >> 15) & 1);
1977 Features["egpr"] = HasAPXF;
1978 Features["push2pop2"] = HasAPXF;
1979 Features["ppx"] = HasAPXF;
1980 Features["ndd"] = HasAPXF;
1981 Features["ccmp"] = HasAPXF;
1982 Features["nf"] = HasAPXF;
1983 Features["cf"] = HasAPXF;
1984 Features["zu"] = HasAPXF;
1990 Features["xsaveopt"] = HasLeafD && ((EAX >> 0) & 1) && HasAVXSave;
1991 Features["xsavec"] = HasLeafD && ((EAX >> 1) & 1) && HasAVXSave;
1992 Features["xsaves"] = HasLeafD && ((EAX >> 3) & 1) && HasAVXSave;
1997 Features["ptwrite"] = HasLeaf14 && ((EBX >> 4) & 1);
2001 Features["widekl"] = HasLeaf7 && HasLeaf19 && ((EBX >> 2) & 1);
2005 Features["amx-fp8"] = HasLeaf1E && ((EAX >> 4) & 1) && HasAMXSave;
2006 Features["amx-transpose"] = HasLeaf1E && ((EAX >> 5) & 1) && HasAMXSave;
2007 Features["amx-tf32"] = HasLeaf1E && ((EAX >> 6) & 1) && HasAMXSave;
2008 Features["amx-avx512"] = HasLeaf1E && ((EAX >> 7) & 1) && HasAMXSave;
2009 Features["amx-movrs"] = HasLeaf1E && ((EAX >> 8) & 1) && HasAMXSave;
2016 Features["avx10.1-256"] = HasAVX10 && AVX10Ver >= 1;
2017 Features["avx10.1-512"] = HasAVX10 && AVX10Ver >= 1 && Has512Len;
2018 Features["avx10.2-256"] = HasAVX10 && AVX10Ver >= 2;
2019 Features["avx10.2-512"] = HasAVX10 && AVX10Ver >= 2 && Has512Len;
2021 return Features;
2025 StringMap<bool> Features;
2028 return Features;
2035 // Look for the CPU features.
2037 if (Lines[I].starts_with("Features")) {
2043 // All of these are "crypto" features, but we must sift out actual features
2083 Features[LLVMFeatureStr] = true;
2092 Features["aes"] = (crypto & Aes) == Aes;
2093 Features["sha2"] = (crypto & Sha2) == Sha2;
2096 return Features;
2100 StringMap<bool> Features;
2103 Features["neon"] =
2105 Features["crc"] =
2111 Features["aes"] = TradCrypto;
2112 Features["sha2"] = TradCrypto;
2114 return Features;
2125 StringMap<bool> Features;
2127 Features["f"] = HasFPU && (cpucfg2 & (1U << 1)); // CPUCFG.2.FP_SP
2128 Features["d"] = HasFPU && (cpucfg2 & (1U << 2)); // CPUCFG.2.FP_DP
2130 Features["lsx"] = hwcap & (1UL << 4); // HWCAP_LOONGARCH_LSX
2131 Features["lasx"] = hwcap & (1UL << 5); // HWCAP_LOONGARCH_LASX
2132 Features["lvz"] = hwcap & (1UL << 9); // HWCAP_LOONGARCH_LVZ
2134 Features["frecipe"] = cpucfg2 & (1U << 25); // CPUCFG.2.FRECIPE
2135 Features["div32"] = cpucfg2 & (1U << 26); // CPUCFG.2.DIV32
2136 Features["lam-bh"] = cpucfg2 & (1U << 27); // CPUCFG.2.LAM_BH
2137 Features["lamcas"] = cpucfg2 & (1U << 28); // CPUCFG.2.LAMCAS
2138 Features["scq"] = cpucfg2 & (1U << 30); // CPUCFG.2.SCQ
2140 Features["ld-seq-sa"] = cpucfg3 & (1U << 23); // CPUCFG.3.LD_SEQ_SA
2143 // Features["llacq-screl"] = cpucfg2 & (1U << 29); // CPUCFG.2.LLACQ_SCREL
2144 return Features;
2162 StringMap<bool> Features;
2166 Features["i"] = true;
2167 Features["m"] = true;
2168 Features["a"] = true;
2172 Features["f"] = ExtMask & (1 << 0); // RISCV_HWPROBE_IMA_FD
2173 Features["d"] = ExtMask & (1 << 0); // RISCV_HWPROBE_IMA_FD
2174 Features["c"] = ExtMask & (1 << 1); // RISCV_HWPROBE_IMA_C
2175 Features["v"] = ExtMask & (1 << 2); // RISCV_HWPROBE_IMA_V
2176 Features["zba"] = ExtMask & (1 << 3); // RISCV_HWPROBE_EXT_ZBA
2177 Features["zbb"] = ExtMask & (1 << 4); // RISCV_HWPROBE_EXT_ZBB
2178 Features["zbs"] = ExtMask & (1 << 5); // RISCV_HWPROBE_EXT_ZBS
2179 Features["zicboz"] = ExtMask & (1 << 6); // RISCV_HWPROBE_EXT_ZICBOZ
2180 Features["zbc"] = ExtMask & (1 << 7); // RISCV_HWPROBE_EXT_ZBC
2181 Features["zbkb"] = ExtMask & (1 << 8); // RISCV_HWPROBE_EXT_ZBKB
2182 Features["zbkc"] = ExtMask & (1 << 9); // RISCV_HWPROBE_EXT_ZBKC
2183 Features["zbkx"] = ExtMask & (1 << 10); // RISCV_HWPROBE_EXT_ZBKX
2184 Features["zknd"] = ExtMask & (1 << 11); // RISCV_HWPROBE_EXT_ZKND
2185 Features["zkne"] = ExtMask & (1 << 12); // RISCV_HWPROBE_EXT_ZKNE
2186 Features["zknh"] = ExtMask & (1 << 13); // RISCV_HWPROBE_EXT_ZKNH
2187 Features["zksed"] = ExtMask & (1 << 14); // RISCV_HWPROBE_EXT_ZKSED
2188 Features["zksh"] = ExtMask & (1 << 15); // RISCV_HWPROBE_EXT_ZKSH
2189 Features["zkt"] = ExtMask & (1 << 16); // RISCV_HWPROBE_EXT_ZKT
2190 Features["zvbb"] = ExtMask & (1 << 17); // RISCV_HWPROBE_EXT_ZVBB
2191 Features["zvbc"] = ExtMask & (1 << 18); // RISCV_HWPROBE_EXT_ZVBC
2192 Features["zvkb"] = ExtMask & (1 << 19); // RISCV_HWPROBE_EXT_ZVKB
2193 Features["zvkg"] = ExtMask & (1 << 20); // RISCV_HWPROBE_EXT_ZVKG
2194 Features["zvkned"] = ExtMask & (1 << 21); // RISCV_HWPROBE_EXT_ZVKNED
2195 Features["zvknha"] = ExtMask & (1 << 22); // RISCV_HWPROBE_EXT_ZVKNHA
2196 Features["zvknhb"] = ExtMask & (1 << 23); // RISCV_HWPROBE_EXT_ZVKNHB
2197 Features["zvksed"] = ExtMask & (1 << 24); // RISCV_HWPROBE_EXT_ZVKSED
2198 Features["zvksh"] = ExtMask & (1 << 25); // RISCV_HWPROBE_EXT_ZVKSH
2199 Features["zvkt"] = ExtMask & (1 << 26); // RISCV_HWPROBE_EXT_ZVKT
2200 Features["zfh"] = ExtMask & (1 << 27); // RISCV_HWPROBE_EXT_ZFH
2201 Features["zfhmin"] = ExtMask & (1 << 28); // RISCV_HWPROBE_EXT_ZFHMIN
2202 Features["zihintntl"] = ExtMask & (1 << 29); // RISCV_HWPROBE_EXT_ZIHINTNTL
2203 Features["zvfh"] = ExtMask & (1 << 30); // RISCV_HWPROBE_EXT_ZVFH
2204 Features["zvfhmin"] = ExtMask & (1ULL << 31); // RISCV_HWPROBE_EXT_ZVFHMIN
2205 Features["zfa"] = ExtMask & (1ULL << 32); // RISCV_HWPROBE_EXT_ZFA
2206 Features["ztso"] = ExtMask & (1ULL << 33); // RISCV_HWPROBE_EXT_ZTSO
2207 Features["zacas"] = ExtMask & (1ULL << 34); // RISCV_HWPROBE_EXT_ZACAS
2208 Features["zicond"] = ExtMask & (1ULL << 35); // RISCV_HWPROBE_EXT_ZICOND
2209 Features["zihintpause"] =
2211 Features["zve32x"] = ExtMask & (1ULL << 37); // RISCV_HWPROBE_EXT_ZVE32X
2212 Features["zve32f"] = ExtMask & (1ULL << 38); // RISCV_HWPROBE_EXT_ZVE32F
2213 Features["zve64x"] = ExtMask & (1ULL << 39); // RISCV_HWPROBE_EXT_ZVE64X
2214 Features["zve64f"] = ExtMask & (1ULL << 40); // RISCV_HWPROBE_EXT_ZVE64F
2215 Features["zve64d"] = ExtMask & (1ULL << 41); // RISCV_HWPROBE_EXT_ZVE64D
2216 Features["zimop"] = ExtMask & (1ULL << 42); // RISCV_HWPROBE_EXT_ZIMOP
2217 Features["zca"] = ExtMask & (1ULL << 43); // RISCV_HWPROBE_EXT_ZCA
2218 Features["zcb"] = ExtMask & (1ULL << 44); // RISCV_HWPROBE_EXT_ZCB
2219 Features["zcd"] = ExtMask & (1ULL << 45); // RISCV_HWPROBE_EXT_ZCD
2220 Features["zcf"] = ExtMask & (1ULL << 46); // RISCV_HWPROBE_EXT_ZCF
2221 Features["zcmop"] = ExtMask & (1ULL << 47); // RISCV_HWPROBE_EXT_ZCMOP
2222 Features["zawrs"] = ExtMask & (1ULL << 48); // RISCV_HWPROBE_EXT_ZAWRS
2230 Features["unaligned-scalar-mem"] = true;
2232 return Features;