# endif
# endif
+
+// Select generic implementation for longest_match, longest_match_slow, longest_match_slow functions.
+#if defined(UNALIGNED_OK) && BYTE_ORDER == LITTLE_ENDIAN
+# if defined(UNALIGNED64_OK) && defined(HAVE_BUILTIN_CTZLL)
+# define longest_match_generic longest_match_unaligned_64
+# define longest_match_slow_generic longest_match_slow_unaligned_64
+# define compare256_generic compare256_unaligned_64
+# elif defined(HAVE_BUILTIN_CTZ)
+# define longest_match_generic longest_match_unaligned_32
+# define longest_match_slow_generic longest_match_slow_unaligned_32
+# define compare256_generic compare256_unaligned_32
+# else
+# define longest_match_generic longest_match_unaligned_16
+# define longest_match_slow_generic longest_match_slow_unaligned_16
+# define compare256_generic compare256_unaligned_16
+# endif
+#else
+# define longest_match_generic longest_match_c
+# define longest_match_slow_generic longest_match_slow_c
+# define compare256_generic compare256_c
+#endif
+
#endif
*/
#include "zbuild.h"
-#include "zendian.h"
#include "functable.h"
#include "cpu_features.h"
#include "cpu_functions.h"
ft.quick_insert_string = &quick_insert_string_c;
ft.slide_hash = &slide_hash_c;
ft.update_hash = &update_hash_c;
-
-#if defined(UNALIGNED_OK) && BYTE_ORDER == LITTLE_ENDIAN
-# if defined(UNALIGNED64_OK) && defined(HAVE_BUILTIN_CTZLL)
- ft.longest_match = &longest_match_unaligned_64;
- ft.longest_match_slow = &longest_match_slow_unaligned_64;
- ft.compare256 = &compare256_unaligned_64;
-# elif defined(HAVE_BUILTIN_CTZ)
- ft.longest_match = &longest_match_unaligned_32;
- ft.longest_match_slow = &longest_match_slow_unaligned_32;
- ft.compare256 = &compare256_unaligned_32;
-# else
- ft.longest_match = &longest_match_unaligned_16;
- ft.longest_match_slow = &longest_match_slow_unaligned_16;
- ft.compare256 = &compare256_unaligned_16;
-# endif
-#else
- ft.longest_match = &longest_match_c;
- ft.longest_match_slow = &longest_match_slow_c;
- ft.compare256 = &compare256_c;
-#endif
-
+ ft.longest_match = &longest_match_generic;
+ ft.longest_match_slow = &longest_match_slow_generic;
+ ft.compare256 = &compare256_generic;
// Select arch-optimized functions