Commit 0024d462 authored by Adam Edward Barton's avatar Adam Edward Barton
Browse files

Merge branch 'convertvector_available_gcc9' into 'master'

gcc seems to support __builtin_convertvector already in version 9. We should be compiling master with clang>=10 anyhow so no need to check for clang support for the ternary operator for vectorized types

See merge request atlas/athena!46268
parents 19fbdd84 5c21a9dd
......@@ -67,19 +67,10 @@
# define HAVE_VECTOR_SIZE_ATTRIBUTE 0
#endif
// Do we additionally support the ternary operator for vectorizes types.
// GCC and llvm clang >=10
#if HAVE_VECTOR_SIZE_ATTRIBUTE && \
!(defined(__clang__) && ((__clang_major__ < 10) || defined(__APPLE__)))
#define HAVE_VECTOR_TERNARY_OPERATOR 1
#else
#define HAVE_VECTOR_TERNARY_OPERATOR 0
#endif
// Do we additionally support the clang
// __builtin_convertvector
// GCC>11 does
#if HAVE_VECTOR_SIZE_ATTRIBUTE && (defined(__clang__) || (__GNUC__ >= 11))
// GCC>=9 does
#if HAVE_VECTOR_SIZE_ATTRIBUTE && (defined(__clang__) || (__GNUC__ >= 9))
#define HAVE_CONVERT_VECTOR 1
#else
#define HAVE_CONVERT_VECTOR 0
......
......@@ -31,7 +31,7 @@
* ++, --, +,-,*,/,%, =, &,|,^,~, >>,<<, !, &&, ||,
* ==, !=, >, <, >=, <=, =, sizeof and Initialization from brace-enclosed lists
*
* Furthemore the GCC and clang>=10 vector types support the ternary operator.
* Furthemore the GCC and clang (>=10) vector types support the ternary operator.
*
* We also support some additional operations.
*
......@@ -465,7 +465,7 @@ template<typename VEC>
inline void
vselect(VEC& dst, const VEC& a, const VEC& b, const mask_type_t<VEC>& mask)
{
#if !HAVE_VECTOR_TERNARY_OPERATOR || WANT_VECTOR_FALLBACK
#if !HAVE_VECTOR_SIZE_ATTRIBUTE || WANT_VECTOR_FALLBACK
constexpr size_t N = vec_size<VEC>();
for (size_t i = 0; i < N; ++i) {
dst[i] = mask[i] ? a[i] : b[i];
......@@ -483,7 +483,7 @@ template<typename VEC>
inline void
vmin(VEC& dst, const VEC& a, const VEC& b)
{
#if !HAVE_VECTOR_TERNARY_OPERATOR || WANT_VECTOR_FALLBACK
#if !HAVE_VECTOR_SIZE_ATTRIBUTE || WANT_VECTOR_FALLBACK
constexpr size_t N = vec_size<VEC>();
for (size_t i = 0; i < N; ++i) {
dst[i] = a[i] < b[i] ? a[i] : b[i];
......@@ -501,7 +501,7 @@ template<typename VEC>
inline void
vmax(VEC& dst, const VEC& a, const VEC& b)
{
#if !HAVE_VECTOR_TERNARY_OPERATOR || WANT_VECTOR_FALLBACK
#if !HAVE_VECTOR_SIZE_ATTRIBUTE || WANT_VECTOR_FALLBACK
constexpr size_t N = vec_size<VEC>();
for (size_t i = 0; i < N; ++i) {
dst[i] = a[i] > b[i] ? a[i] : b[i];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment