~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
base/asm-common.h: Add include guards.
[catacomb]
/
base
/
dispatch.c
diff --git
a/base/dispatch.c
b/base/dispatch.c
index
50c9438
..
9ba6a7c
100644
(file)
--- a/
base/dispatch.c
+++ b/
base/dispatch.c
@@
-47,6
+47,7
@@
# define CPUID1D_SSE2 (1u << 26)
# define CPUID1D_FXSR (1u << 24)
# define CPUID1C_AESNI (1u << 25)
# define CPUID1D_SSE2 (1u << 26)
# define CPUID1D_FXSR (1u << 24)
# define CPUID1C_AESNI (1u << 25)
+# define CPUID1C_AVX (1u << 28)
# define CPUID1C_RDRAND (1u << 30)
struct cpuid { unsigned a, b, c, d; };
# define CPUID1C_RDRAND (1u << 30)
struct cpuid { unsigned a, b, c, d; };
@@
-229,6
+230,11
@@
struct auxentry { unsigned long type; union auxval value; };
# define WANT_AT_HWCAP(_) _(AT_HWCAP, u, hwcap)
#endif
# define WANT_AT_HWCAP(_) _(AT_HWCAP, u, hwcap)
#endif
+#if defined(AT_HWCAP) && CPUFAM_ARM64
+# define WANT_ANY 1
+# define WANT_AT_HWCAP(_) _(AT_HWCAP, u, hwcap)
+#endif
+
#if defined(AT_HWCAP2) && CPUFAM_ARMEL
# define WANT_ANY 1
# define WANT_AT_HWCAP2(_) _(AT_HWCAP2, u, hwcap2)
#if defined(AT_HWCAP2) && CPUFAM_ARMEL
# define WANT_ANY 1
# define WANT_AT_HWCAP2(_) _(AT_HWCAP2, u, hwcap2)
@@
-278,6
+284,12
@@
static unsigned hwcaps = 0;
_(ARM_D32, "arm:d32") \
_(ARM_AES, "arm:aes")
#endif
_(ARM_D32, "arm:d32") \
_(ARM_AES, "arm:aes")
#endif
+#if CPUFAM_ARM64
+# define WANTAUX(_) \
+ WANT_AT_HWCAP(_)
+# define CAPMAP(_) \
+ _(ARM_AES, "arm:aes")
+#endif
/* Build the bitmask for `hwcaps' from the `CAPMAP' list. */
enum {
/* Build the bitmask for `hwcaps' from the `CAPMAP' list. */
enum {
@@
-391,6
+403,9
@@
static void probe_hwcaps(void)
if (probed.hwcap2 & HWCAP2_AES) hw |= HF_ARM_AES;
# endif
#endif
if (probed.hwcap2 & HWCAP2_AES) hw |= HF_ARM_AES;
# endif
#endif
+#if CPUFAM_ARM64
+ if (probed.hwcap & HWCAP_AES) hw |= HF_ARM_AES;
+#endif
/* Store the bitmask of features we probed for everyone to see. */
DISPATCH_STORE(hwcaps, hw);
/* Store the bitmask of features we probed for everyone to see. */
DISPATCH_STORE(hwcaps, hw);
@@
-531,6
+546,9
@@
int cpu_feature_p(int feat)
cpuid_features_p(CPUID1D_SSE2, CPUID1C_AESNI));
CASE_CPUFEAT(X86_RDRAND, "x86:rdrand",
cpuid_features_p(0, CPUID1C_RDRAND));
cpuid_features_p(CPUID1D_SSE2, CPUID1C_AESNI));
CASE_CPUFEAT(X86_RDRAND, "x86:rdrand",
cpuid_features_p(0, CPUID1C_RDRAND));
+ CASE_CPUFEAT(X86_AVX, "x86:avx",
+ xmm_registers_available_p() &&
+ cpuid_features_p(0, CPUID1C_AVX));
#endif
#ifdef CAPMAP
# define FEATP__CASE(feat, tok) \
#endif
#ifdef CAPMAP
# define FEATP__CASE(feat, tok) \