summaryrefslogtreecommitdiff
path: root/functable.c
diff options
context:
space:
mode:
authorNathan Moinvaziri <nathan@nathanm.com>2020-05-07 07:54:37 -0700
committerHans Kristian Rosbach <hk-github@circlestorm.org>2020-05-24 13:53:25 +0200
commit0f34903697be3723f1cb3cee492f892f542e8f14 (patch)
tree6a16129e05f429d085e252c9e227fac7f4e1cadd /functable.c
parent965b452649a6bfb26ff49ef32b98d5d4658f90ba (diff)
Added support for AVX2 intrinsics to compare258.
Diffstat (limited to 'functable.c')
-rw-r--r--functable.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/functable.c b/functable.c
index 943c2b4..a95cfc5 100644
--- a/functable.c
+++ b/functable.c
@@ -72,6 +72,9 @@ extern int32_t compare258_unaligned_64(const unsigned char *src0, const unsigned
#ifdef X86_SSE42_CMP_STR
extern int32_t compare258_unaligned_sse4(const unsigned char *src0, const unsigned char *src1);
#endif
+#if defined(X86_AVX2) && defined(HAVE_BUILTIN_CTZ)
+extern int32_t compare258_unaligned_avx2(const unsigned char *src0, const unsigned char *src1);
+#endif
#endif
/* stub definitions */
@@ -223,6 +226,10 @@ ZLIB_INTERNAL int32_t compare258_stub(const unsigned char *src0, const unsigned
if (x86_cpu_has_sse42)
functable.compare258 = &compare258_unaligned_sse4;
# endif
+# if defined(X86_AVX2) && defined(HAVE_BUILTIN_CTZ)
+ if (x86_cpu_has_avx2)
+ functable.compare258 = &compare258_unaligned_avx2;
+# endif
#endif
return functable.compare258(src0, src1);