[libc-commits] [libc] [libc] Fix op_tests Memcmp guard to require SSE4.1 (PR #196572)

via libc-commits libc-commits at lists.llvm.org
Fri May 8 09:38:25 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Jeff Bailey (kaladron)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/196572.diff


1 Files Affected:

- (modified) libc/test/src/string/memory_utils/op_tests.cpp (+1-1) 


``````````diff
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__

``````````

</details>


https://github.com/llvm/llvm-project/pull/196572


More information about the libc-commits mailing list