From 27f73b8995eaa9eb0079718206090d4c96e9a99f Mon Sep 17 00:00:00 2001 From: "zhongxiao.yzx" Date: Tue, 2 Feb 2021 10:15:37 +0800 Subject: [PATCH] Fix compilation error and warning fix the building error from _SimdImplBuiltin::_S_isfinite and building warning from _MaskImplBuiltin::_S_set --- experimental/bits/simd_builtin.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/experimental/bits/simd_builtin.h b/experimental/bits/simd_builtin.h index f048c07e6..e670b2c35 100644 --- a/experimental/bits/simd_builtin.h +++ b/experimental/bits/simd_builtin.h @@ -2284,7 +2284,8 @@ template const auto __absn = __vector_bitcast<_Ip>(_SuperImpl::_S_abs(__x)); const auto __maxn = __vector_bitcast<_Ip>(__vector_broadcast<_Np>(__finite_max_v<_Tp>)); - return __absn <= __maxn; + return _MaskImpl::template _S_convert<_Tp>( + _MaskImpl::_S_to_bits(__as_wrapper<_Np>(__absn <= __maxn))); #endif } @@ -2342,11 +2343,13 @@ template const auto __minn = __vector_bitcast<_Ip>(__vector_broadcast<_Np>(__norm_min_v<_Tp>)); #if __FINITE_MATH_ONLY__ - return __absn >= __minn; + return _MaskImpl::template _S_convert<_Tp>( + _MaskImpl::_S_to_bits(__as_wrapper<_Np>(__absn >= __minn))); #else const auto __maxn = __vector_bitcast<_Ip>(__vector_broadcast<_Np>(__finite_max_v<_Tp>)); - return __minn <= __absn && __absn <= __maxn; + return _MaskImpl::template _S_convert<_Tp>(_MaskImpl::_S_to_bits( + __as_wrapper<_Np>(__minn <= __absn && __absn <= __maxn))); #endif } @@ -2837,7 +2840,7 @@ template // smart_reference access {{{2 template - static constexpr void _S_set(_SimdWrapper<_Tp, _Np>& __k, int __i, + static constexpr void _S_set(_SimdWrapper<_Tp, _Np>& __k, size_t __i, bool __x) noexcept { if constexpr (is_same_v<_Tp, bool>)