[libc-commits] [libc] 003846b - [libc] Fix op_tests Memcmp guard to require SSE4.1 (#196572)
via libc-commits
libc-commits at lists.llvm.org
Fri May 8 09:44:10 PDT 2026
Author: Jeff Bailey
Date: 2026-05-08T16:44:05Z
New Revision: 003846bf173a7ea78395f57f134d4a0500016fe1
URL: https://github.com/llvm/llvm-project/commit/003846bf173a7ea78395f57f134d4a0500016fe1
DIFF: https://github.com/llvm/llvm-project/commit/003846bf173a7ea78395f57f134d4a0500016fe1.diff
LOG: [libc] Fix op_tests Memcmp guard to require SSE4.1 (#196572)
The is_vector<__m128i> specialisation in op_x86.h is gated on
__SSE4_1__, but op_tests.cpp included generic::Memcmp<__m128i> under the
weaker __SSE2__ guard. On baseline x86-64 (where __SSE2__ is always
defined but __SSE4_1__ may not be), this caused a static_assert failure
in is_element_type_v.
Changed the guard from __SSE2__ to __SSE4_1__ to match the
specialisation requirement, consistent with how BcmpImplementations
already guards its __m128i entry.
Assisted-by: Automated tooling, human reviewed.
Added:
Modified:
libc/test/src/string/memory_utils/op_tests.cpp
Removed:
################################################################################
diff --git a/libc/test/src/string/memory_utils/op_tests.cpp b/libc/test/src/string/memory_utils/op_tests.cpp
index 06089a89d9aac..9d26056a720f3 100644
--- a/libc/test/src/string/memory_utils/op_tests.cpp
+++ b/libc/test/src/string/memory_utils/op_tests.cpp
@@ -299,7 +299,7 @@ TYPED_TEST(LlvmLibcOpTest, Bcmp, BcmpImplementations) {
using MemcmpImplementations = testing::TypeList<
#if defined(LIBC_TARGET_ARCH_IS_X86_64) && !defined(LIBC_TARGET_OS_IS_WINDOWS)
-#ifdef __SSE2__
+#ifdef __SSE4_1__
generic::Memcmp<__m128i>, //
#endif
#ifdef __AVX2__
More information about the libc-commits
mailing list