23 #if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
27 #define HWCAP_AARCH64_ASIMDDP (1 << 20)
28 #define HWCAP_AARCH64_SVE (1 << 22)
29 #define HWCAP2_AARCH64_SVE2 (1 << 1)
30 #define HWCAP2_AARCH64_I8MM (1 << 13)
39 if (hwcap & HWCAP_AARCH64_ASIMDDP)
41 if (hwcap & HWCAP_AARCH64_SVE)
43 if (hwcap2 & HWCAP2_AARCH64_SVE2)
45 if (hwcap2 & HWCAP2_AARCH64_I8MM)
51 #elif defined(__APPLE__) && HAVE_SYSCTLBYNAME
52 #include <sys/sysctl.h>
54 static int have_feature(
const char *feature) {
66 if (have_feature(
"hw.optional.arm.FEAT_DotProd"))
68 if (have_feature(
"hw.optional.arm.FEAT_I8MM"))
74 #elif defined(__OpenBSD__)
75 #include <machine/armreg.h>
76 #include <machine/cpu.h>
77 #include <sys/types.h>
78 #include <sys/sysctl.h>
84 #ifdef CPU_ID_AA64ISAR0
91 mib[1] = CPU_ID_AA64ISAR0;
93 if (sysctl(mib, 2, &isar0, &
len,
NULL, 0) != -1) {
94 if (ID_AA64ISAR0_DP(isar0) >= ID_AA64ISAR0_DP_IMPL)
99 mib[1] = CPU_ID_AA64ISAR1;
101 if (sysctl(mib, 2, &isar1, &
len,
NULL, 0) != -1) {
102 #ifdef ID_AA64ISAR1_I8MM_IMPL
103 if (ID_AA64ISAR1_I8MM(isar1) >= ID_AA64ISAR1_I8MM_IMPL)
112 #elif defined(_WIN32)
118 #ifdef PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE
119 if (IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE))
122 #ifdef PF_ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE
126 if (IsProcessorFeaturePresent(PF_ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE))
129 #ifdef PF_ARM_SVE_INSTRUCTIONS_AVAILABLE
130 if (IsProcessorFeaturePresent(PF_ARM_SVE_INSTRUCTIONS_AVAILABLE))
133 #ifdef PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE
134 if (IsProcessorFeaturePresent(PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE))
153 #ifdef __ARM_FEATURE_DOTPROD
156 #ifdef __ARM_FEATURE_MATMUL_INT8
159 #ifdef __ARM_FEATURE_SVE
162 #ifdef __ARM_FEATURE_SVE2