commit eee7acb: [Minor] Limit x86_64 assembly to x86_64

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Nov 8 08:42:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-11-08 08:41:26 +0000
URL: https://github.com/rspamd/rspamd/commit/eee7acb309bae98e17c19b53bbd72cc9b798c281 (HEAD -> master)

[Minor] Limit x86_64 assembly to x86_64
Issue: #3967

---
 src/libcryptobox/chacha20/chacha.c | 12 ++++++------
 1 file 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
 };


More information about the Commits mailing list