Skip to content

Commit e55dee3

Browse files
committed
[libc++] <experimental/simd> Add explicit conversion from and to implementation-defined types
1 parent 00def06 commit e55dee3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

libcxx/include/experimental/__simd/simd.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ class simd {
4444

4545
_LIBCPP_HIDE_FROM_ABI simd() noexcept = default;
4646

47+
// explicit conversion from and to implementation-defined types
48+
explicit _LIBCPP_HIDE_FROM_ABI operator _Storage() const;
49+
explicit _LIBCPP_HIDE_FROM_ABI simd(const _Storage& __s) : __s_(__s) {}
50+
4751
// broadcast constructor
4852
template <class _Up, enable_if_t<__can_broadcast_v<value_type, __remove_cvref_t<_Up>>, int> = 0>
4953
_LIBCPP_HIDE_FROM_ABI simd(_Up&& __v) noexcept : __s_(_Impl::__broadcast(static_cast<value_type>(__v))) {}

libcxx/include/experimental/__simd/simd_mask.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ class simd_mask {
4141

4242
_LIBCPP_HIDE_FROM_ABI simd_mask() noexcept = default;
4343

44+
// explicit conversion from and to implementation-defined types
45+
explicit _LIBCPP_HIDE_FROM_ABI operator _Storage() const;
46+
explicit _LIBCPP_HIDE_FROM_ABI simd_mask(const _Storage& __s) : __s_(__s) {}
47+
4448
// broadcast constructor
4549
_LIBCPP_HIDE_FROM_ABI explicit simd_mask(value_type __v) noexcept : __s_(_Impl::__broadcast(__v)) {}
4650

0 commit comments

Comments
 (0)