[libcxx-commits] [libcxx] [libc++] <experimental/simd> Add copy functions for class simd/simd_mask (PR #78935)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 5 02:18:32 PDT 2024


================
@@ -70,6 +70,19 @@ class simd {
     _Impl::__load(__s_, _Flags::template __apply<simd>(__mem));
   }
 
+  // copy functions
+  template <class _Up, class _Flags>
+  _LIBCPP_HIDE_FROM_ABI enable_if_t<__is_vectorizable_v<_Up> && is_simd_flag_type_v<_Flags>>
+  copy_from(const _Up* __mem, _Flags) {
+    _Impl::__load(__s_, _Flags::template __apply<simd>(__mem));
+  }
----------------
philnik777 wrote:

```suggestion
  template <class _Up, class _Flags, enable_if_t<__is_vectorizable_v<_Up> && is_simd_flag_type_v<_Flags>, int> = 0>
  _LIBCPP_HIDE_FROM_ABI void
  copy_from(const _Up* __mem, _Flags) {
    _Impl::__load(__s_, _Flags::template __apply<simd>(__mem));
  }
```
Same below.

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


More information about the libcxx-commits mailing list