Skip to content

Commit 2fc7a6e

Browse files
committed
Enable AVX2 optimization for simd_search4 function
1 parent 6765db1 commit 2fc7a6e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/simd_search.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ inline bool simd_search4(std::string_view haystack, std::string_view needle) {
5353
}
5454
return false;
5555
}
56-
#elif defined(__x86_64__)
56+
#elif defined(__AVX2__)
57+
__attribute__((target("avx2")))
5758
inline bool simd_search4(std::string_view haystack, std::string_view needle) {
5859
if (haystack.size() < 4) {
5960
return false;

0 commit comments

Comments
 (0)