Skip to content
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

WIP: clang build fixes and workarounds #16

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
6 changes: 3 additions & 3 deletions experimental/bits/simd_builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
_GLIBCXX_SIMD_BEGIN_NAMESPACE
// _S_allbits{{{
template <typename _V>
static inline constexpr _V _S_allbits
static inline _GLIBCXX_CONSTEXPR_SIMD _V _S_allbits
= reinterpret_cast<_V>(~__vector_type_t<char, sizeof(_V) / sizeof(char)>());

// }}}
// _S_signmask, _S_absmask{{{
template <typename _V, typename = _VectorTraits<_V>>
static inline constexpr _V _S_signmask = __xor(_V() + 1, _V() - 1);
static inline _GLIBCXX_CONSTEXPR_SIMD _V _S_signmask = __xor(_V() + 1, _V() - 1);
template <typename _V, typename = _VectorTraits<_V>>
static inline constexpr _V _S_absmask
static inline _GLIBCXX_CONSTEXPR_SIMD _V _S_absmask
= __andnot(_S_signmask<_V>, _S_allbits<_V>);

//}}}
Expand Down
6 changes: 6 additions & 0 deletions experimental/bits/simd_detail.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@
#define _GLIBCXX_SIMD_FIX_P2TS_ISSUE66 1
// }}}

#if __clang__
#define _GLIBCXX_CONSTEXPR_SIMD
#else
#define _GLIBCXX_CONSTEXPR_SIMD constexpr
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My naming convention has been to prefix everything with _GLIBCXX_SIMD_. I understand naming the macro "constexpr simd" is trying to explain the purpose of the macro. SIMD_CONSTEXPR_SIMD is just confusing again, though.
<bits/c++config> has _GLIBCXX_USE_CONSTEXPR which seems like a good fit here. I.e. name it _GLIBCXX_SIMD_USE_CONSTEXPR.
And define the __clang__ branch to const.


#endif // __cplusplus >= 201703L
#endif // _GLIBCXX_EXPERIMENTAL_SIMD_DETAIL_H_

Expand Down