[libcxx-commits] [libcxx] [libc++] Optimize num_get integral functions (PR #121795)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Feb 26 07:58:01 PST 2025
================
@@ -116,11 +116,36 @@ template <class _VecT, class _Iter>
}(make_index_sequence<__simd_vector_size_v<_VecT>>{});
}
+// Load the first _Np elements, zero the rest
+_LIBCPP_DIAGNOSTIC_PUSH
+_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wpsabi")
+template <class _VecT, size_t _Np, class _Iter>
+[[__nodiscard__]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _VecT __partial_load(_Iter __iter) noexcept {
+ return [=]<size_t... _LoadIndices, size_t... _ZeroIndices>(
+ index_sequence<_LoadIndices...>, index_sequence<_ZeroIndices...>) _LIBCPP_ALWAYS_INLINE noexcept {
+ return _VecT{__iter[_LoadIndices]...};
----------------
ldionne wrote:
I think it would make sense to zero-out the indices we don't want to load explicitly.
https://github.com/llvm/llvm-project/pull/121795
More information about the libcxx-commits
mailing list