@@ -116,11 +116,36 @@ template <class _VecT, class _Iter>
116116 }(make_index_sequence<__simd_vector_size_v<_VecT>>{});
117117}
118118
119+ // Load the first _Np elements, zero the rest
120+ _LIBCPP_DIAGNOSTIC_PUSH
121+ _LIBCPP_CLANG_DIAGNOSTIC_IGNORED (" -Wpsabi" )
122+ template <class _VecT, size_t _Np, class _Iter>
123+ [[__nodiscard__]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _VecT __partial_load(_Iter __iter) noexcept {
124+ return [=]<size_t ... _LoadIndices, size_t ... _ZeroIndices>(
125+ index_sequence<_LoadIndices...>, index_sequence<_ZeroIndices...>) _LIBCPP_ALWAYS_INLINE noexcept {
126+ return _VecT{__iter[_LoadIndices]...};
127+ }(make_index_sequence<_Np>{}, make_index_sequence<__simd_vector_size_v<_VecT> - _Np>{});
128+ }
129+
130+ template <class _VecT >
131+ [[__nodiscard__]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _VecT
132+ __broadcast (__simd_vector_underlying_type_t <_VecT> __val) {
133+ return [&]<std::size_t ... _Indices>(index_sequence<_Indices...>) {
134+ return _VecT{((void )_Indices, __val)...};
135+ }(make_index_sequence<__simd_vector_size_v<_VecT>>());
136+ }
137+ _LIBCPP_DIAGNOSTIC_POP
138+
119139template <size_t _Np>
120140[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool __all_of (__simd_vector<bool , _Np> __vec) noexcept {
121141 return __builtin_reduce_and (__vec);
122142}
123143
144+ template <size_t _Np>
145+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool __none_of (__simd_vector<bool , _Np> __vec) noexcept {
146+ return !__builtin_reduce_or (__vec);
147+ }
148+
124149template <class _Tp , size_t _Np>
125150[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI auto __as_mask (__simd_vector<_Tp, _Np> __vec) noexcept {
126151 static_assert (!is_same<_Tp, bool >::value, " vector type should not be a bool!" );
0 commit comments