aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-11-08 08:41:26 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-11-08 08:41:26 +0000
commiteee7acb309bae98e17c19b53bbd72cc9b798c281 (patch)
tree963bb61f3b2f85cf4835d9789bf83c5e369b5916
parent9fd0db56f8e755d2be7473891f5645a9994f7ebd (diff)
downloadrspamd-eee7acb309bae98e17c19b53bbd72cc9b798c281.tar.gz
rspamd-eee7acb309bae98e17c19b53bbd72cc9b798c281.zip
[Minor] Limit x86_64 assembly to x86_64
Issue: #3967
-rw-r--r--src/libcryptobox/chacha20/chacha.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcryptobox/chacha20/chacha.c b/src/libcryptobox/chacha20/chacha.c
index e4543d3b8..653c614d9 100644
--- a/src/libcryptobox/chacha20/chacha.c
+++ b/src/libcryptobox/chacha20/chacha.c
@@ -52,15 +52,15 @@ typedef struct chacha_impl_t {
#define CHACHA_IMPL(cpuflags, desc, ext) \
{(cpuflags), desc, chacha_##ext, xchacha_##ext, chacha_blocks_##ext, hchacha_##ext}
-#if defined(HAVE_AVX2)
+#if defined(HAVE_AVX2) && defined(__x86_64__)
CHACHA_DECLARE(avx2)
#define CHACHA_AVX2 CHACHA_IMPL(CPUID_AVX2, "avx2", avx2)
#endif
-#if defined(HAVE_AVX)
+#if defined(HAVE_AVX) && defined(__x86_64__)
CHACHA_DECLARE(avx)
#define CHACHA_AVX CHACHA_IMPL(CPUID_AVX, "avx", avx)
#endif
-#if defined(HAVE_SSE2)
+#if defined(HAVE_SSE2) && defined(__x86_64__)
CHACHA_DECLARE(sse2)
#define CHACHA_SSE2 CHACHA_IMPL(CPUID_SSE2, "sse2", sse2)
#endif
@@ -70,13 +70,13 @@ CHACHA_DECLARE(ref)
static const chacha_impl_t chacha_list[] = {
CHACHA_GENERIC,
-#if defined(CHACHA_AVX2)
+#if defined(CHACHA_AVX2) && defined(__x86_64__)
CHACHA_AVX2,
#endif
-#if defined(CHACHA_AVX)
+#if defined(CHACHA_AVX) && defined(__x86_64__)
CHACHA_AVX,
#endif
-#if defined(CHACHA_SSE2)
+#if defined(CHACHA_SSE2) && defined(__x86_64__)
CHACHA_SSE2
#endif
};