diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-06-29 23:15:30 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-06-29 23:15:30 +0200 |
commit | ad901c597deea9ea88d26614833ecedf3a23f808 (patch) | |
tree | 8e3f5ac3ade3ebafc316941ffe25c58a09268abb | |
parent | device: remove updating of trans_start (diff) | |
download | wireguard-monolithic-historical-ad901c597deea9ea88d26614833ecedf3a23f808.tar.xz wireguard-monolithic-historical-ad901c597deea9ea88d26614833ecedf3a23f808.zip |
chacha20poly1305: use more standard way of testing FPU features
-rw-r--r-- | src/crypto/chacha20poly1305.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/crypto/chacha20poly1305.c b/src/crypto/chacha20poly1305.c index e4d2e0a..9f21060 100644 --- a/src/crypto/chacha20poly1305.c +++ b/src/crypto/chacha20poly1305.c @@ -37,14 +37,9 @@ static bool chacha20poly1305_use_ssse3 = false; static bool chacha20poly1305_use_sse2 = false; void chacha20poly1305_init(void) { - chacha20poly1305_use_sse2 = cpu_has_xmm2; + chacha20poly1305_use_sse2 = boot_cpu_has(X86_FEATURE_XMM2); chacha20poly1305_use_ssse3 = boot_cpu_has(X86_FEATURE_SSSE3); - chacha20poly1305_use_avx2 = cpu_has_avx && cpu_has_avx2 && -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) - cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL); -#else - cpu_has_xfeatures(XSTATE_SSE | XSTATE_YMM, NULL); -#endif + chacha20poly1305_use_avx2 = boot_cpu_has(X86_FEATURE_AVX2); } #else void chacha20poly1305_init(void) { } |