aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/fastutf8/fastutf8.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-07-23 10:43:53 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-07-23 10:44:23 +0100
commit80e8a76a31943ee23cec774888b575a69a1360f1 (patch)
tree054e4c4cc2791360082b81018bed4a1b85935b33 /contrib/fastutf8/fastutf8.c
parent1e224376b74993b3ffc1c2ee388c6c7e9ff2747e (diff)
downloadrspamd-80e8a76a31943ee23cec774888b575a69a1360f1.tar.gz
rspamd-80e8a76a31943ee23cec774888b575a69a1360f1.zip
[Minor] Limit sse41 code to sse41 and x86_64
Diffstat (limited to 'contrib/fastutf8/fastutf8.c')
-rw-r--r--contrib/fastutf8/fastutf8.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/fastutf8/fastutf8.c b/contrib/fastutf8/fastutf8.c
index 2a5a9983c..89becaf0a 100644
--- a/contrib/fastutf8/fastutf8.c
+++ b/contrib/fastutf8/fastutf8.c
@@ -23,7 +23,7 @@
*/
#include "fastutf8.h"
-#include "platform_config.h"
+#include "libcryptobox/platform_config.h"
/*
@@ -125,10 +125,10 @@ rspamd_fast_utf8_validate_ref (const unsigned char *data, size_t len)
}
/* Prototypes */
-#ifdef HAVE_SSSE3
+#if defined(HAVE_SSE41) && defined(__x86_64__)
extern off_t rspamd_fast_utf8_validate_sse41 (const unsigned char *data, size_t len);
#endif
-#ifdef HAVE_AVX2
+#if defined(HAVE_AVX2) && defined(__x86_64__)
extern off_t rspamd_fast_utf8_validate_avx2 (const unsigned char *data, size_t len);
#endif
@@ -139,12 +139,12 @@ static off_t (*validate_func) (const unsigned char *data, size_t len) =
void
rspamd_fast_utf8_library_init (unsigned flags)
{
-#ifdef HAVE_SSSE3
+#if defined(HAVE_SSE41) && defined(__x86_64__)
if (flags & RSPAMD_FAST_UTF8_FLAG_SSE41) {
validate_func = rspamd_fast_utf8_validate_sse41;
}
#endif
-#ifdef HAVE_AVX2
+#if defined(HAVE_AVX2) && defined(__x86_64__)
if (flags & RSPAMD_FAST_UTF8_FLAG_AVX2) {
validate_func = rspamd_fast_utf8_validate_avx2;
}