Skip to content

Commit 7634ddf

Browse files
committed
Implement _M_chunk with different _Cx ABI tag
include/ChangeLog: * bits/simd_complex.h:
1 parent c45f291 commit 7634ddf

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

include/bits/simd_complex.h

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -673,17 +673,22 @@ namespace std::simd
673673
constexpr auto
674674
_M_chunk() const noexcept
675675
{
676-
constexpr int __n = _S_size / _Vp::_S_size;
677-
constexpr int __rem = _S_size % _Vp::_S_size;
678-
const auto __chunked = _M_data.template _M_chunk<typename _Vp::_TSimd>();
679-
constexpr auto [...__is] = _IotaArray<__n>;
680-
if constexpr (__rem == 0)
681-
return array<_Vp, __n> {_Vp::_S_init(__chunked[__is])...};
676+
if constexpr (_Vp::abi_type::_S_is_cx_ctgus)
677+
return resize_t<_S_size, _Vp>(*this).template _M_chunk<_Vp>();
682678
else
683679
{
684-
using _Rest = resize_t<__rem, _Vp>;
685-
return tuple(_Vp::_S_init(get<__is>(__chunked))...,
686-
_Rest::_S_init(get<__n>(__chunked)));
680+
constexpr int __n = _S_size / _Vp::_S_size;
681+
constexpr int __rem = _S_size % _Vp::_S_size;
682+
const auto __chunked = _M_data.template _M_chunk<typename _Vp::_TSimd>();
683+
constexpr auto [...__is] = _IotaArray<__n>;
684+
if constexpr (__rem == 0)
685+
return array<_Vp, __n> {_Vp::_S_init(__chunked[__is])...};
686+
else
687+
{
688+
using _Rest = resize_t<__rem, _Vp>;
689+
return tuple(_Vp::_S_init(get<__is>(__chunked))...,
690+
_Rest::_S_init(get<__n>(__chunked)));
691+
}
687692
}
688693
}
689694

0 commit comments

Comments
 (0)