[libc-commits] [libc] [libc] suppress string warning in case intrinsics are defined as macros (PR #117640)

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Mon Nov 25 14:53:43 PST 2024


https://github.com/SchrodingerZhu created https://github.com/llvm/llvm-project/pull/117640

None

>From fb8b8eba896bfd9e034dd36e97dae0b010a33490 Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <i at zhuyi.fan>
Date: Mon, 25 Nov 2024 14:53:15 -0800
Subject: [PATCH] [libc] suppress string warning in case intrinsics are defined
 as macros

---
 libc/src/string/memory_utils/op_x86.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libc/src/string/memory_utils/op_x86.h b/libc/src/string/memory_utils/op_x86.h
index ab694e25fe0fe1..309610e4ad6307 100644
--- a/libc/src/string/memory_utils/op_x86.h
+++ b/libc/src/string/memory_utils/op_x86.h
@@ -29,12 +29,15 @@
 // Define fake functions to prevent the compiler from failing on undefined
 // functions in case the CPU extension is not present.
 #if !defined(__AVX512BW__) && (defined(_MSC_VER) || defined(__SCE__))
+#undef _mm512_cmpneq_epi8_mask
 #define _mm512_cmpneq_epi8_mask(A, B) 0
 #endif
 #if !defined(__AVX2__) && (defined(_MSC_VER) || defined(__SCE__))
+#undef _mm256_movemask_epi8
 #define _mm256_movemask_epi8(A) 0
 #endif
 #if !defined(__SSE2__) && (defined(_MSC_VER) || defined(__SCE__))
+#undef _mm_movemask_epi8
 #define _mm_movemask_epi8(A) 0
 #endif
 



More information about the libc-commits mailing list