-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compilation error and warning #26
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2284,7 +2284,8 @@ template <typename _Abi> | |
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 <typename _Abi> | |
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))); | ||
Comment on lines
-2345
to
+2352
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above. |
||
#endif | ||
} | ||
|
||
|
@@ -2837,7 +2840,7 @@ template <typename _Abi> | |
|
||
// smart_reference access {{{2 | ||
template <typename _Tp, size_t _Np> | ||
static constexpr void _S_set(_SimdWrapper<_Tp, _Np>& __k, int __i, | ||
static constexpr void _S_set(_SimdWrapper<_Tp, _Np>& __k, size_t __i, | ||
Comment on lines
-2840
to
+2843
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think about that, but the index will be expected to be a negative value? furthermore, _S_set->_M_set, however, _M_set is used size_t for __i
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, |
||
bool __x) noexcept | ||
{ | ||
if constexpr (is_same_v<_Tp, bool>) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how the compiler is able to reach this code when
_Abi
is_VecBltnBtmsk
. One of theif constexpr
cases in_SimdImplX86::_S_isfinite
should betrue
and therefore the call to_Base::_S_isfinite
not instantiated.In most cases the generic implementation in
simd_builtin.h
should not be expected to return bit masks. Also, how does any_VecBuiltin
code still compile after this change?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as issue #24 happened, I try to bypath the _SimdImplX86::_S_isfinite by call _Base::_S_isfinite directly that leads to the cases.
As far as I understand, the _Base::_S_isfinite works as the fallback case, it should be work as well, Is it?
After this change, other _VecBuiltin code still compiles successfully, because there are some implicit type castings during eval this expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
_SimdImplBuiltin
functions sometimes work for bitmasks and sometimes don't. Since, at this point, only AVX512 (i.e. x86) uses the bitmask ABI, I prefer to keep bitmask code out of the generic implementation. IIRC SVE also uses bitmasks. So once we have a SVE we should revisit how to abstract it best. Having the_SimdImplBuiltin
functions support both may become a maintenance burden, decrease optimization, and increase compile times.I any case, let's figure out why #24 happens and if this is really the proper solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
By the way, have you put SVE support on schedule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's still so much else to do that I can't start on SVE. I don't have a schedule for it, no. 😞