[libcxx-commits] [libcxx] [libc++] Enable algorithm vectorization on arm neon (PR #128873)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 26 05:18:40 PST 2025


https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/128873

Previously the wrong detection macro has been used to check whether arm NEON is available. This fixes it, and removes a few unnecessary includes from `__algorithm/simd_utils.h` as a drive-by.


>From 91e324d69fd1a191653de63d99b990391a6cdd02 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Wed, 26 Feb 2025 14:17:26 +0100
Subject: [PATCH] [libc++] Enable algorithm vectorization on arm neon

---
 libcxx/include/__algorithm/simd_utils.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libcxx/include/__algorithm/simd_utils.h b/libcxx/include/__algorithm/simd_utils.h
index 4e03723a32854..e3c790998e902 100644
--- a/libcxx/include/__algorithm/simd_utils.h
+++ b/libcxx/include/__algorithm/simd_utils.h
@@ -15,8 +15,6 @@
 #include <__bit/countr.h>
 #include <__config>
 #include <__cstddef/size_t.h>
-#include <__type_traits/is_arithmetic.h>
-#include <__type_traits/is_same.h>
 #include <__utility/integer_sequence.h>
 #include <cstdint>
 
@@ -78,7 +76,7 @@ using __get_as_integer_type_t _LIBCPP_NODEBUG = typename __get_as_integer_type_i
 #  if defined(__AVX__) || defined(__MVS__)
 template <class _Tp>
 inline constexpr size_t __native_vector_size = 32 / sizeof(_Tp);
-#  elif defined(__SSE__) || defined(__ARM_NEON__)
+#  elif defined(__SSE__) || defined(__ARM_NEON)
 template <class _Tp>
 inline constexpr size_t __native_vector_size = 16 / sizeof(_Tp);
 #  elif defined(__MMX__)



More information about the libcxx-commits mailing list