From f0b9c2be5c590d3e8af91f894826e91b4c350c7f Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Thu, 30 Oct 2025 15:02:35 +0100 Subject: [PATCH 1/2] Use default for std::enable_if No need to use void when it's already the default. --- .../arch/common/xsimd_common_arithmetic.hpp | 16 +-- .../arch/common/xsimd_common_logical.hpp | 8 +- .../xsimd/arch/common/xsimd_common_math.hpp | 20 +-- .../xsimd/arch/common/xsimd_common_memory.hpp | 4 +- .../arch/common/xsimd_common_rounding.hpp | 2 +- .../xsimd/arch/common/xsimd_common_trigo.hpp | 2 +- include/xsimd/arch/xsimd_avx.hpp | 114 ++++++++-------- include/xsimd/arch/xsimd_avx2.hpp | 70 +++++----- include/xsimd/arch/xsimd_avx512bw.hpp | 52 ++++---- include/xsimd/arch/xsimd_avx512f.hpp | 112 ++++++++-------- include/xsimd/arch/xsimd_avx512vbmi2.hpp | 8 +- include/xsimd/arch/xsimd_common_fwd.hpp | 20 +-- include/xsimd/arch/xsimd_emulated.hpp | 2 +- include/xsimd/arch/xsimd_neon.hpp | 4 +- include/xsimd/arch/xsimd_scalar.hpp | 14 +- include/xsimd/arch/xsimd_sse2.hpp | 124 +++++++++--------- include/xsimd/arch/xsimd_sse3.hpp | 2 +- include/xsimd/arch/xsimd_sse4_1.hpp | 18 +-- include/xsimd/arch/xsimd_ssse3.hpp | 6 +- include/xsimd/arch/xsimd_vsx.hpp | 104 +++++++-------- include/xsimd/arch/xsimd_wasm.hpp | 84 ++++++------ include/xsimd/types/xsimd_api.hpp | 4 +- test/test_batch.cpp | 2 +- test/test_batch_cast.cpp | 8 +- 24 files changed, 400 insertions(+), 400 deletions(-) diff --git a/include/xsimd/arch/common/xsimd_common_arithmetic.hpp b/include/xsimd/arch/common/xsimd_common_arithmetic.hpp index cdeb9125b..c160670d4 100644 --- a/include/xsimd/arch/common/xsimd_common_arithmetic.hpp +++ b/include/xsimd/arch/common/xsimd_common_arithmetic.hpp @@ -27,14 +27,14 @@ namespace xsimd using namespace types; // bitwise_lshift - template ::value, void>::type*/> + template ::value>::type*/> XSIMD_INLINE batch bitwise_lshift(batch const& self, batch const& other, requires_arch) noexcept { return detail::apply([](T x, T y) noexcept { return x << y; }, self, other); } - template ::value, void>::type*/> + template ::value>::type*/> XSIMD_INLINE batch bitwise_lshift(batch const& self, requires_arch) noexcept { constexpr auto bits = std::numeric_limits::digits + std::numeric_limits::is_signed; @@ -43,14 +43,14 @@ namespace xsimd } // bitwise_rshift - template ::value, void>::type*/> + template ::value>::type*/> XSIMD_INLINE batch bitwise_rshift(batch const& self, batch const& other, requires_arch) noexcept { return detail::apply([](T x, T y) noexcept { return x >> y; }, self, other); } - template ::value, void>::type*/> + template ::value>::type*/> XSIMD_INLINE batch bitwise_rshift(batch const& self, requires_arch) noexcept { constexpr auto bits = std::numeric_limits::digits + std::numeric_limits::is_signed; @@ -73,7 +73,7 @@ namespace xsimd } // div - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch div(batch const& self, batch const& other, requires_arch) noexcept { return detail::apply([](T x, T y) noexcept -> T @@ -168,7 +168,7 @@ namespace xsimd } // mul - template ::value, void>::type*/> + template ::value>::type*/> XSIMD_INLINE batch mul(batch const& self, batch const& other, requires_arch) noexcept { return detail::apply([](T x, T y) noexcept -> T @@ -212,7 +212,7 @@ namespace xsimd { return add(self, other); // no saturated arithmetic on floating point numbers } - template ::value, void>::type*/> + template ::value>::type*/> XSIMD_INLINE batch sadd(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -240,7 +240,7 @@ namespace xsimd { return sub(self, other); // no saturated arithmetic on floating point numbers } - template ::value, void>::type*/> + template ::value>::type*/> XSIMD_INLINE batch ssub(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) diff --git a/include/xsimd/arch/common/xsimd_common_logical.hpp b/include/xsimd/arch/common/xsimd_common_logical.hpp index 6fe242c68..b8128158d 100644 --- a/include/xsimd/arch/common/xsimd_common_logical.hpp +++ b/include/xsimd/arch/common/xsimd_common_logical.hpp @@ -116,7 +116,7 @@ namespace xsimd } // isinf - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool isinf(batch const&, requires_arch) noexcept { return batch_bool(false); @@ -143,7 +143,7 @@ namespace xsimd } // isfinite - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool isfinite(batch const&, requires_arch) noexcept { return batch_bool(true); @@ -160,14 +160,14 @@ namespace xsimd } // isnan - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool isnan(batch const&, requires_arch) noexcept { return batch_bool(false); } // le - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool le(batch const& self, batch const& other, requires_arch) noexcept { return (self < other) || (self == other); diff --git a/include/xsimd/arch/common/xsimd_common_math.hpp b/include/xsimd/arch/common/xsimd_common_math.hpp index e5bc57db9..5ca0a44d6 100644 --- a/include/xsimd/arch/common/xsimd_common_math.hpp +++ b/include/xsimd/arch/common/xsimd_common_math.hpp @@ -286,7 +286,7 @@ namespace xsimd } // copysign - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch copysign(batch const& self, batch const& other, requires_arch) noexcept { return abs(self) | bitofsign(other); @@ -1877,7 +1877,7 @@ namespace xsimd } // mod - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch mod(batch const& self, batch const& other, requires_arch) noexcept { return detail::apply([](T x, T y) noexcept -> T @@ -1886,7 +1886,7 @@ namespace xsimd } // nearbyint - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch nearbyint(batch const& self, requires_arch) noexcept { return self; @@ -1926,7 +1926,7 @@ namespace xsimd } // nearbyint_as_int - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch nearbyint_as_int(batch const& self, requires_arch) noexcept { return self; @@ -2088,7 +2088,7 @@ namespace xsimd } // reciprocal - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch reciprocal(batch const& self, requires_arch) noexcept { @@ -2103,7 +2103,7 @@ namespace xsimd return { reduce_add(self.real()), reduce_add(self.imag()) }; } - template ::value, void>::type*/> + template ::value>::type*/> XSIMD_INLINE T reduce_add(batch const& self, requires_arch) noexcept { alignas(A::alignment()) T buffer[batch::size]; @@ -2175,7 +2175,7 @@ namespace xsimd return res; } - template ::value, void>::type*/> + template ::value>::type*/> XSIMD_INLINE T reduce_mul(batch const& self, requires_arch) noexcept { alignas(A::alignment()) T buffer[batch::size]; @@ -2199,7 +2199,7 @@ namespace xsimd { return fnma(nearbyint(self / other), other, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch remainder(batch const& self, batch const& other, requires_arch) noexcept { auto mod = self % other; @@ -2214,7 +2214,7 @@ namespace xsimd } // sign - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sign(batch const& self, requires_arch) noexcept { using batch_type = batch; @@ -2260,7 +2260,7 @@ namespace xsimd } // signnz - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch signnz(batch const& self, requires_arch) noexcept { using batch_type = batch; diff --git a/include/xsimd/arch/common/xsimd_common_memory.hpp b/include/xsimd/arch/common/xsimd_common_memory.hpp index 4ad148a6f..54bf87eb6 100644 --- a/include/xsimd/arch/common/xsimd_common_memory.hpp +++ b/include/xsimd/arch/common/xsimd_common_memory.hpp @@ -739,7 +739,7 @@ namespace xsimd } // transpose - template ::size == 8, void>::type> + template ::size == 8>::type> XSIMD_INLINE void transpose(batch* matrix_begin, batch* matrix_end, requires_arch) noexcept { assert((matrix_end - matrix_begin == batch::size) && "correctly sized matrix"); @@ -783,7 +783,7 @@ namespace xsimd transpose(reinterpret_cast*>(matrix_begin), reinterpret_cast*>(matrix_end), A {}); } - template ::size == 16, void>::type> + template ::size == 16>::type> XSIMD_INLINE void transpose(batch* matrix_begin, batch* matrix_end, requires_arch) noexcept { assert((matrix_end - matrix_begin == batch::size) && "correctly sized matrix"); diff --git a/include/xsimd/arch/common/xsimd_common_rounding.hpp b/include/xsimd/arch/common/xsimd_common_rounding.hpp index a46c263d0..251a9f819 100644 --- a/include/xsimd/arch/common/xsimd_common_rounding.hpp +++ b/include/xsimd/arch/common/xsimd_common_rounding.hpp @@ -49,7 +49,7 @@ namespace xsimd } // trunc - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch trunc(batch const& self, requires_arch) noexcept { return self; diff --git a/include/xsimd/arch/common/xsimd_common_trigo.hpp b/include/xsimd/arch/common/xsimd_common_trigo.hpp index e15ccdc21..dedfd3982 100644 --- a/include/xsimd/arch/common/xsimd_common_trigo.hpp +++ b/include/xsimd/arch/common/xsimd_common_trigo.hpp @@ -158,7 +158,7 @@ namespace xsimd */ namespace detail { - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch average(const batch& x1, const batch& x2) noexcept { diff --git a/include/xsimd/arch/xsimd_avx.hpp b/include/xsimd/arch/xsimd_avx.hpp index 9d93be071..1a6ed1d8a 100644 --- a/include/xsimd/arch/xsimd_avx.hpp +++ b/include/xsimd/arch/xsimd_avx.hpp @@ -108,7 +108,7 @@ namespace xsimd } // add - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch add(batch const& self, batch const& other, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s, __m128i o) noexcept @@ -137,7 +137,7 @@ namespace xsimd { return _mm256_testc_pd(self, batch_bool(true)) != 0; } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE bool all(batch_bool const& self, requires_arch) noexcept { return _mm256_testc_si256(self, batch_bool(true)) != 0; @@ -154,7 +154,7 @@ namespace xsimd { return !_mm256_testz_pd(self, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE bool any(batch_bool const& self, requires_arch) noexcept { return !_mm256_testz_si256(self, self); @@ -190,14 +190,14 @@ namespace xsimd return _mm256_and_pd(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_and(batch const& self, batch const& other, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s, __m128i o) noexcept { return bitwise_and(batch(s), batch(o)); }, self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_and(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s, __m128i o) noexcept @@ -228,14 +228,14 @@ namespace xsimd return _mm256_andnot_pd(other, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_andnot(batch const& self, batch const& other, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s, __m128i o) noexcept { return bitwise_andnot(batch(s), batch(o)); }, self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_andnot(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s, __m128i o) noexcept @@ -244,7 +244,7 @@ namespace xsimd } // bitwise_lshift - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_lshift(batch const& self, int32_t other, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s, int32_t o) noexcept @@ -253,14 +253,14 @@ namespace xsimd } // bitwise_not - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_not(batch const& self, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s) noexcept { return bitwise_not(batch(s), sse4_2 {}); }, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_not(batch_bool const& self, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s) noexcept @@ -289,14 +289,14 @@ namespace xsimd { return _mm256_or_pd(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_or(batch const& self, batch const& other, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s, __m128i o) noexcept { return bitwise_or(batch(s), batch(o)); }, self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_or(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s, __m128i o) noexcept @@ -305,7 +305,7 @@ namespace xsimd } // bitwise_rshift - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_rshift(batch const& self, int32_t other, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s, int32_t o) noexcept @@ -334,14 +334,14 @@ namespace xsimd { return _mm256_xor_pd(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_xor(batch const& self, batch const& other, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s, __m128i o) noexcept { return bitwise_xor(batch(s), batch(o), sse4_2 {}); }, self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_xor(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s, __m128i o) noexcept @@ -350,17 +350,17 @@ namespace xsimd } // bitwise_cast - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return _mm256_castsi256_ps(self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return _mm256_castsi256_pd(self); } - template ::type>::value, void>::type> + template ::type>::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return batch(self.data); @@ -370,7 +370,7 @@ namespace xsimd { return _mm256_castps_pd(self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return _mm256_castps_si256(self); @@ -380,7 +380,7 @@ namespace xsimd { return _mm256_castpd_ps(self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return _mm256_castpd_si256(self); @@ -409,7 +409,7 @@ namespace xsimd } // broadcast - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch broadcast(T val, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -528,7 +528,7 @@ namespace xsimd } // decr_if - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch decr_if(batch const& self, batch_bool const& mask, requires_arch) noexcept { return self + batch(mask.data); @@ -567,7 +567,7 @@ namespace xsimd { return ~(self != other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool eq(batch const& self, batch const& other, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s, __m128i o) noexcept @@ -575,7 +575,7 @@ namespace xsimd self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool eq(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return ~(self != other); @@ -630,7 +630,7 @@ namespace xsimd assert(!(mask & ~0xFul) && "inbound mask"); return _mm256_castsi256_pd(_mm256_load_si256((const __m256i*)lut64[mask])); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool from_mask(batch_bool const&, uint64_t mask, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -735,14 +735,14 @@ namespace xsimd } // incr_if - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch incr_if(batch const& self, batch_bool const& mask, requires_arch) noexcept { return self - batch(mask.data); } // insert - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch insert(batch const& self, T val, index pos, requires_arch) noexcept { #if !defined(_MSC_VER) || _MSC_VER > 1900 @@ -791,7 +791,7 @@ namespace xsimd } // load_aligned - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch load_aligned(T const* mem, convert, requires_arch) noexcept { return _mm256_load_si256((__m256i const*)mem); @@ -849,7 +849,7 @@ namespace xsimd } // load_unaligned - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch load_unaligned(T const* mem, convert, requires_arch) noexcept { return _mm256_loadu_si256((__m256i const*)mem); @@ -877,7 +877,7 @@ namespace xsimd return _mm256_cmp_pd(self, other, _CMP_LT_OQ); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool lt(batch const& self, batch const& other, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s, __m128i o) noexcept @@ -886,7 +886,7 @@ namespace xsimd } // mask - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE uint64_t mask(batch_bool const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1 || sizeof(T) == 2) @@ -932,7 +932,7 @@ namespace xsimd { return _mm256_max_pd(other, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch max(batch const& self, batch const& other, requires_arch) noexcept { return select(self > other, self, other); @@ -949,7 +949,7 @@ namespace xsimd { return _mm256_min_pd(other, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch min(batch const& self, batch const& other, requires_arch) noexcept { return select(self <= other, self, other); @@ -988,7 +988,7 @@ namespace xsimd } // neg - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch neg(batch const& self, requires_arch) noexcept { return 0 - self; @@ -1015,7 +1015,7 @@ namespace xsimd { return _mm256_cmp_pd(self, other, _CMP_NEQ_UQ); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool neq(batch const& self, batch const& other, requires_arch) noexcept { return ~(self == other); @@ -1031,7 +1031,7 @@ namespace xsimd { return _mm256_xor_pd(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool neq(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return _mm256_castps_si256(_mm256_xor_ps(_mm256_castsi256_ps(self.data), _mm256_castsi256_ps(other.data))); @@ -1046,7 +1046,7 @@ namespace xsimd } // reduce_add - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T reduce_add(batch const& self, requires_arch) noexcept { typename batch::register_type low, high; @@ -1056,7 +1056,7 @@ namespace xsimd } // reduce_max - template ::type> + template ::type> XSIMD_INLINE T reduce_max(batch const& self, requires_arch) noexcept { constexpr auto mask = detail::shuffle(1, 0); @@ -1067,7 +1067,7 @@ namespace xsimd } // reduce_min - template ::type> + template ::type> XSIMD_INLINE T reduce_min(batch const& self, requires_arch) noexcept { constexpr auto mask = detail::shuffle(1, 0); @@ -1078,7 +1078,7 @@ namespace xsimd } // reduce_mul - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T reduce_mul(batch const& self, requires_arch) noexcept { typename batch::register_type low, high; @@ -1100,7 +1100,7 @@ namespace xsimd } // sadd - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sadd(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -1129,7 +1129,7 @@ namespace xsimd { return _mm256_blendv_pd(false_br, true_br, cond); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool const& cond, batch const& true_br, batch const& false_br, requires_arch) noexcept { __m128i cond_low, cond_hi; @@ -1145,7 +1145,7 @@ namespace xsimd __m128i res_hi = select(batch_bool(cond_hi), batch(true_hi), batch(false_hi), sse4_2 {}); return detail::merge_sse(res_low, res_hi); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool_constant const&, batch const& true_br, batch const& false_br, requires_arch) noexcept { return select(batch_bool { Values... }, true_br, false_br, avx2 {}); @@ -1179,29 +1179,29 @@ namespace xsimd static_assert(sizeof...(Values) == batch::size, "consistent init"); return _mm256_setr_pd(values...); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1, T v2, T v3) noexcept { return _mm256_set_epi64x(v3, v2, v1, v0); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7) noexcept { return _mm256_setr_epi32(v0, v1, v2, v3, v4, v5, v6, v7); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15) noexcept { return _mm256_setr_epi16(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15, T v16, T v17, T v18, T v19, T v20, T v21, T v22, T v23, T v24, T v25, T v26, T v27, T v28, T v29, T v30, T v31) noexcept { return _mm256_setr_epi8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool set(batch_bool const&, requires_arch, Values... values) noexcept { return set(batch(), A {}, static_cast(values ? -1LL : 0LL)...).data; @@ -1346,7 +1346,7 @@ namespace xsimd } // ssub - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch ssub(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -1361,12 +1361,12 @@ namespace xsimd } // store_aligned - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_aligned(T* mem, batch const& self, requires_arch) noexcept { return _mm256_store_si256((__m256i*)mem, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_aligned(T* mem, batch_bool const& self, requires_arch) noexcept { return _mm256_store_si256((__m256i*)mem, self); @@ -1383,12 +1383,12 @@ namespace xsimd } // store_unaligned - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_unaligned(T* mem, batch const& self, requires_arch) noexcept { return _mm256_storeu_si256((__m256i*)mem, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_unaligned(T* mem, batch_bool const& self, requires_arch) noexcept { return _mm256_storeu_si256((__m256i*)mem, self); @@ -1405,7 +1405,7 @@ namespace xsimd } // sub - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sub(batch const& self, batch const& other, requires_arch) noexcept { return detail::fwd_to_sse([](__m128i s, __m128i o) noexcept @@ -1753,7 +1753,7 @@ namespace xsimd } // zip_hi - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch zip_hi(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1 || sizeof(T) == 2) @@ -1816,7 +1816,7 @@ namespace xsimd } // zip_lo - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch zip_lo(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1 || sizeof(T) == 2) @@ -1892,7 +1892,7 @@ namespace xsimd return _mm256_cvtsd_f64(self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T first(batch const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) diff --git a/include/xsimd/arch/xsimd_avx2.hpp b/include/xsimd/arch/xsimd_avx2.hpp index cf9669edf..aa974f9ab 100644 --- a/include/xsimd/arch/xsimd_avx2.hpp +++ b/include/xsimd/arch/xsimd_avx2.hpp @@ -27,7 +27,7 @@ namespace xsimd using namespace types; // abs - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch abs(batch const& self, requires_arch) noexcept { if (std::is_signed::value) @@ -53,7 +53,7 @@ namespace xsimd } // add - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch add(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -79,7 +79,7 @@ namespace xsimd } // avgr - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch avgr(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -97,7 +97,7 @@ namespace xsimd } // avg - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch avg(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -117,43 +117,43 @@ namespace xsimd } // bitwise_and - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_and(batch const& self, batch const& other, requires_arch) noexcept { return _mm256_and_si256(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_and(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return _mm256_and_si256(self, other); } // bitwise_andnot - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_andnot(batch const& self, batch const& other, requires_arch) noexcept { return _mm256_andnot_si256(other, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_andnot(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return _mm256_andnot_si256(other, self); } // bitwise_not - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_not(batch const& self, requires_arch) noexcept { return _mm256_xor_si256(self, _mm256_set1_epi32(-1)); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_not(batch_bool const& self, requires_arch) noexcept { return _mm256_xor_si256(self, _mm256_set1_epi32(-1)); } // bitwise_lshift - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_lshift(batch const& self, int32_t other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 2) @@ -174,7 +174,7 @@ namespace xsimd } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_lshift(batch const& self, requires_arch) noexcept { constexpr auto bits = std::numeric_limits::digits + std::numeric_limits::is_signed; @@ -197,7 +197,7 @@ namespace xsimd } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_lshift(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 4) @@ -215,19 +215,19 @@ namespace xsimd } // bitwise_or - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_or(batch const& self, batch const& other, requires_arch) noexcept { return _mm256_or_si256(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_or(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return _mm256_or_si256(self, other); } // bitwise_rshift - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_rshift(batch const& self, int32_t other, requires_arch) noexcept { if (std::is_signed::value) @@ -277,7 +277,7 @@ namespace xsimd } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_rshift(batch const& self, requires_arch) noexcept { constexpr auto bits = std::numeric_limits::digits + std::numeric_limits::is_signed; @@ -336,7 +336,7 @@ namespace xsimd } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_rshift(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -368,12 +368,12 @@ namespace xsimd } // bitwise_xor - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_xor(batch const& self, batch const& other, requires_arch) noexcept { return _mm256_xor_si256(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_xor(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return _mm256_xor_si256(self, other); @@ -432,7 +432,7 @@ namespace xsimd } // eq - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool eq(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -515,7 +515,7 @@ namespace xsimd } // lt - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool lt(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -573,7 +573,7 @@ namespace xsimd // load_unaligned - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool load_unaligned(bool const* mem, batch_bool, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -625,7 +625,7 @@ namespace xsimd } // mask - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE uint64_t mask(batch_bool const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -644,7 +644,7 @@ namespace xsimd } // max - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch max(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -688,7 +688,7 @@ namespace xsimd } // min - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch min(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -732,7 +732,7 @@ namespace xsimd } // mul - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch mul(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -760,7 +760,7 @@ namespace xsimd } // reduce_add - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T reduce_add(batch const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 4) @@ -832,7 +832,7 @@ namespace xsimd } // sadd - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sadd(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -868,7 +868,7 @@ namespace xsimd } // select - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool const& cond, batch const& true_br, batch const& false_br, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -892,7 +892,7 @@ namespace xsimd return select(cond, true_br, false_br, avx {}); } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool_constant const&, batch const& true_br, batch const& false_br, requires_arch) noexcept { // FIXME: for some reason mask here is not considered as an immediate, @@ -1034,7 +1034,7 @@ namespace xsimd } // ssub - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch ssub(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -1070,7 +1070,7 @@ namespace xsimd } // sub - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sub(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -1180,7 +1180,7 @@ namespace xsimd } // zip_hi - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch zip_hi(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -1215,7 +1215,7 @@ namespace xsimd } // zip_lo - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch zip_lo(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) diff --git a/include/xsimd/arch/xsimd_avx512bw.hpp b/include/xsimd/arch/xsimd_avx512bw.hpp index e15e4433a..27c537dcb 100644 --- a/include/xsimd/arch/xsimd_avx512bw.hpp +++ b/include/xsimd/arch/xsimd_avx512bw.hpp @@ -72,7 +72,7 @@ namespace xsimd } // abs - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch abs(batch const& self, requires_arch) noexcept { if (std::is_unsigned::value) @@ -95,7 +95,7 @@ namespace xsimd } // add - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch add(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -113,7 +113,7 @@ namespace xsimd } // avgr - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch avgr(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -131,7 +131,7 @@ namespace xsimd } // avg - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch avg(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -151,7 +151,7 @@ namespace xsimd } // bitwise_lshift - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_lshift(batch const& self, int32_t other, requires_arch) noexcept { #if defined(XSIMD_AVX512_SHIFT_INTRINSICS_IMM_ONLY) @@ -171,7 +171,7 @@ namespace xsimd } // bitwise_rshift - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_rshift(batch const& self, int32_t other, requires_arch) noexcept { if (std::is_signed::value) @@ -225,7 +225,7 @@ namespace xsimd } // decr_if - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch decr_if(batch const& self, batch_bool const& mask, requires_arch) noexcept { @@ -244,28 +244,28 @@ namespace xsimd } // eq - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool eq(batch const& self, batch const& other, requires_arch) noexcept { return detail::compare_int_avx512bw(self, other); } // ge - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool ge(batch const& self, batch const& other, requires_arch) noexcept { return detail::compare_int_avx512bw(self, other); } // gt - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool gt(batch const& self, batch const& other, requires_arch) noexcept { return detail::compare_int_avx512bw(self, other); } // incr_if - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch incr_if(batch const& self, batch_bool const& mask, requires_arch) noexcept { @@ -284,7 +284,7 @@ namespace xsimd } // insert - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch insert(batch const& self, T val, index pos, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -302,21 +302,21 @@ namespace xsimd } // le - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool le(batch const& self, batch const& other, requires_arch) noexcept { return detail::compare_int_avx512bw(self, other); } // lt - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool lt(batch const& self, batch const& other, requires_arch) noexcept { return detail::compare_int_avx512bw(self, other); } // load - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool load_unaligned(bool const* mem, batch_bool, requires_arch) noexcept { using mask_type = typename batch_bool::register_type; @@ -347,7 +347,7 @@ namespace xsimd } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool load_aligned(bool const* mem, batch_bool, requires_arch) noexcept { using mask_type = typename batch_bool::register_type; @@ -379,7 +379,7 @@ namespace xsimd } // max - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch max(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -415,7 +415,7 @@ namespace xsimd } // min - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch min(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -451,7 +451,7 @@ namespace xsimd } // mul - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch mul(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -471,14 +471,14 @@ namespace xsimd } // neq - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool neq(batch const& self, batch const& other, requires_arch) noexcept { return detail::compare_int_avx512bw(self, other); } // sadd - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sadd(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -514,7 +514,7 @@ namespace xsimd } // select - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool const& cond, batch const& true_br, batch const& false_br, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -554,7 +554,7 @@ namespace xsimd } // ssub - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch ssub(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -600,7 +600,7 @@ namespace xsimd } // sub - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sub(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -644,7 +644,7 @@ namespace xsimd } // zip_hi - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch zip_hi(batch const& self, batch const& other, requires_arch) noexcept { __m512i lo, hi; @@ -672,7 +672,7 @@ namespace xsimd } // zip_lo - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch zip_lo(batch const& self, batch const& other, requires_arch) noexcept { __m512i lo, hi; diff --git a/include/xsimd/arch/xsimd_avx512f.hpp b/include/xsimd/arch/xsimd_avx512f.hpp index 4daf0a02f..f710e1ff2 100644 --- a/include/xsimd/arch/xsimd_avx512f.hpp +++ b/include/xsimd/arch/xsimd_avx512f.hpp @@ -247,7 +247,7 @@ namespace xsimd self_asi); return *reinterpret_cast<__m512d*>(&res_asi); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch abs(batch const& self, requires_arch) noexcept { if (std::is_unsigned::value) @@ -283,7 +283,7 @@ namespace xsimd } // add - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch add(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -362,7 +362,7 @@ namespace xsimd return _mm512_castsi512_pd(_mm512_and_si512(_mm512_castpd_si512(self), _mm512_castpd_si512(other))); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_and(batch const& self, batch const& other, requires_arch) noexcept { return _mm512_and_si512(self, other); @@ -387,7 +387,7 @@ namespace xsimd return _mm512_castsi512_pd(_mm512_andnot_si512(_mm512_castpd_si512(other), _mm512_castpd_si512(self))); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_andnot(batch const& self, batch const& other, requires_arch) noexcept { return _mm512_andnot_si512(other, self); @@ -401,7 +401,7 @@ namespace xsimd } // bitwise_lshift - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_lshift(batch const& self, int32_t other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -446,7 +446,7 @@ namespace xsimd } // bitwise_not - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_not(batch const& self, requires_arch) noexcept { return _mm512_xor_si512(self, _mm512_set1_epi32(-1)); @@ -488,14 +488,14 @@ namespace xsimd return register_type(self.data | other.data); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_or(batch const& self, batch const& other, requires_arch) noexcept { return _mm512_or_si512(self, other); } // bitwise_rshift - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_rshift(batch const& self, int32_t other, requires_arch) noexcept { if (std::is_signed::value) @@ -565,7 +565,7 @@ namespace xsimd } // rotl - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch rotl(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 4) @@ -580,12 +580,12 @@ namespace xsimd { return rotl(batch(s), batch(o), avx2 {}); }, self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch rotl(batch const& self, int32_t other, requires_arch) noexcept { return rotl(self, batch(other), A {}); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch rotl(batch const& self, requires_arch) noexcept { constexpr auto bits = std::numeric_limits::digits + std::numeric_limits::is_signed; @@ -605,7 +605,7 @@ namespace xsimd } // rotr - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch rotr(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) < 4) @@ -627,13 +627,13 @@ namespace xsimd } return rotr(self, other, common {}); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch rotr(batch const& self, int32_t other, requires_arch) noexcept { return rotr(self, batch(other), A {}); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch rotr(batch const& self, requires_arch) noexcept { constexpr auto bits = std::numeric_limits::digits + std::numeric_limits::is_signed; @@ -677,24 +677,24 @@ namespace xsimd return register_type(self.data ^ other.data); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_xor(batch const& self, batch const& other, requires_arch) noexcept { return _mm512_xor_si512(self, other); } // bitwise_cast - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return _mm512_castsi512_ps(self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return _mm512_castsi512_pd(self); } - template ::type>::value, void>::type> + template ::type>::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return batch(self.data); @@ -704,7 +704,7 @@ namespace xsimd { return _mm512_castps_pd(self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return _mm512_castps_si512(self); @@ -714,14 +714,14 @@ namespace xsimd { return _mm512_castpd_ps(self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return _mm512_castpd_si512(self); } // broadcast - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch broadcast(T val, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -860,7 +860,7 @@ namespace xsimd } } // incr_if - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch decr_if(batch const& self, batch_bool const& mask, requires_arch) noexcept { @@ -902,7 +902,7 @@ namespace xsimd return _mm512_cmp_pd_mask(self, other, _CMP_EQ_OQ); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool eq(batch const& self, batch const& other, requires_arch) noexcept { return detail::compare_int_avx512f(self, other); @@ -1086,7 +1086,7 @@ namespace xsimd { return _mm512_cmp_pd_mask(self, other, _CMP_GE_OQ); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool ge(batch const& self, batch const& other, requires_arch) noexcept { return detail::compare_int_avx512f(self, other); @@ -1103,7 +1103,7 @@ namespace xsimd { return _mm512_cmp_pd_mask(self, other, _CMP_GT_OQ); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool gt(batch const& self, batch const& other, requires_arch) noexcept { return detail::compare_int_avx512f(self, other); @@ -1206,7 +1206,7 @@ namespace xsimd } // incr_if - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch incr_if(batch const& self, batch_bool const& mask, requires_arch) noexcept { @@ -1239,7 +1239,7 @@ namespace xsimd int64_t tmp = bit_cast(val); return _mm512_castsi512_pd(_mm512_mask_set1_epi64(_mm512_castpd_si512(self), __mmask8(1 << (I & 7)), tmp)); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch insert(batch const& self, T val, index pos, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 4) @@ -1295,7 +1295,7 @@ namespace xsimd { return _mm512_cmp_pd_mask(self, other, _CMP_LE_OQ); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool le(batch const& self, batch const& other, requires_arch) noexcept { return detail::compare_int_avx512f(self, other); @@ -1335,7 +1335,7 @@ namespace xsimd } // load_aligned - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch load_aligned(T const* mem, convert, requires_arch) noexcept { return _mm512_load_si512((__m512i const*)mem); @@ -1375,7 +1375,7 @@ namespace xsimd } // load_unaligned - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch load_unaligned(T const* mem, convert, requires_arch) noexcept { return _mm512_loadu_si512((__m512i const*)mem); @@ -1403,7 +1403,7 @@ namespace xsimd return _mm512_cmp_pd_mask(self, other, _CMP_LT_OQ); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool lt(batch const& self, batch const& other, requires_arch) noexcept { return detail::compare_int_avx512f(self, other); @@ -1427,7 +1427,7 @@ namespace xsimd { return _mm512_max_pd(other, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch max(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -1477,7 +1477,7 @@ namespace xsimd { return _mm512_min_pd(other, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch min(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -1527,7 +1527,7 @@ namespace xsimd { return _mm512_mul_pd(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch mul(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 4) @@ -1580,7 +1580,7 @@ namespace xsimd { return _mm512_cmp_pd_mask(self, other, _CMP_NEQ_UQ); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool neq(batch const& self, batch const& other, requires_arch) noexcept { return ~(self == other); @@ -1621,7 +1621,7 @@ namespace xsimd { return _mm512_reduce_add_pd(rhs); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T reduce_add(batch const& self, requires_arch) noexcept { __m256i low, high; @@ -1631,7 +1631,7 @@ namespace xsimd } // reduce_max - template ::type> + template ::type> XSIMD_INLINE T reduce_max(batch const& self, requires_arch) noexcept { constexpr batch_constant mask; @@ -1642,7 +1642,7 @@ namespace xsimd } // reduce_min - template ::type> + template ::type> XSIMD_INLINE T reduce_min(batch const& self, requires_arch) noexcept { constexpr batch_constant mask; @@ -1663,7 +1663,7 @@ namespace xsimd { return _mm512_reduce_mul_pd(rhs); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T reduce_mul(batch const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 4) @@ -1696,7 +1696,7 @@ namespace xsimd } // sadd - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sadd(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -1716,7 +1716,7 @@ namespace xsimd // scatter template ::value || std::is_same::value, void>::type> + class = typename std::enable_if::value || std::is_same::value>::type> XSIMD_INLINE void scatter(batch const& src, T* dst, batch const& index, kernel::requires_arch) noexcept @@ -1725,7 +1725,7 @@ namespace xsimd } template ::value || std::is_same::value, void>::type> + class = typename std::enable_if::value || std::is_same::value>::type> XSIMD_INLINE void scatter(batch const& src, T* dst, batch const& index, kernel::requires_arch) noexcept @@ -1761,7 +1761,7 @@ namespace xsimd return _mm512_mask_blend_pd(cond, false_br, true_br); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool const& cond, batch const& true_br, batch const& false_br, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -1813,7 +1813,7 @@ namespace xsimd } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool_constant const&, batch const& true_br, batch const& false_br, requires_arch) noexcept { return select(batch_bool { Values... }, true_br, false_br, avx512f {}); @@ -1842,12 +1842,12 @@ namespace xsimd { return _mm512_setr_pd(v0, v1, v2, v3, v4, v5, v6, v7); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7) noexcept { return _mm512_set_epi64(v7, v6, v5, v4, v3, v2, v1, v0); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15) noexcept { @@ -2103,7 +2103,7 @@ namespace xsimd } // ssub - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch ssub(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -2128,12 +2128,12 @@ namespace xsimd } // store_aligned - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_aligned(T* mem, batch const& self, requires_arch) noexcept { return _mm512_store_si512((__m512i*)mem, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_aligned(T* mem, batch_bool const& self, requires_arch) noexcept { return _mm512_store_si512((__m512i*)mem, self); @@ -2150,12 +2150,12 @@ namespace xsimd } // store_unaligned - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_unaligned(T* mem, batch const& self, requires_arch) noexcept { return _mm512_storeu_si512((__m512i*)mem, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_unaligned(T* mem, batch_bool const& self, requires_arch) noexcept { return _mm512_storeu_si512((__m512i*)mem, self); @@ -2172,7 +2172,7 @@ namespace xsimd } // sub - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sub(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -2350,7 +2350,7 @@ namespace xsimd } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch swizzle(batch const& self, batch_constant, requires_arch) noexcept { constexpr typename detail::fold_batch_constant::type mask32; @@ -2469,7 +2469,7 @@ namespace xsimd } // zip_hi - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch zip_hi(batch const& self, batch const& other, requires_arch) noexcept { @@ -2537,7 +2537,7 @@ namespace xsimd } // zip_lo - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch zip_lo(batch const& self, batch const& other, requires_arch) noexcept { @@ -2617,7 +2617,7 @@ namespace xsimd return _mm512_cvtsd_f64(self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T first(batch const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) diff --git a/include/xsimd/arch/xsimd_avx512vbmi2.hpp b/include/xsimd/arch/xsimd_avx512vbmi2.hpp index d6f56307b..229acb28e 100644 --- a/include/xsimd/arch/xsimd_avx512vbmi2.hpp +++ b/include/xsimd/arch/xsimd_avx512vbmi2.hpp @@ -69,7 +69,7 @@ namespace xsimd } // rotl - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch rotl(batch const& self, int32_t other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 2) @@ -82,7 +82,7 @@ namespace xsimd } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch rotl(batch const& self, requires_arch) noexcept { constexpr auto bits = std::numeric_limits::digits + std::numeric_limits::is_signed; @@ -98,7 +98,7 @@ namespace xsimd } // rotr - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch rotr(batch const& self, int32_t other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 2) @@ -111,7 +111,7 @@ namespace xsimd } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch rotr(batch const& self, requires_arch) noexcept { constexpr auto bits = std::numeric_limits::digits + std::numeric_limits::is_signed; diff --git a/include/xsimd/arch/xsimd_common_fwd.hpp b/include/xsimd/arch/xsimd_common_fwd.hpp index ab664da22..cff63e739 100644 --- a/include/xsimd/arch/xsimd_common_fwd.hpp +++ b/include/xsimd/arch/xsimd_common_fwd.hpp @@ -22,27 +22,27 @@ namespace xsimd namespace kernel { // forward declaration - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch abs(batch const& self, requires_arch) noexcept; - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_lshift(batch const& self, batch const& other, requires_arch) noexcept; - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_lshift(batch const& self, requires_arch) noexcept; - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_rshift(batch const& self, batch const& other, requires_arch) noexcept; - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_rshift(batch const& self, requires_arch) noexcept; template XSIMD_INLINE batch_bool gt(batch const& self, batch const& other, requires_arch) noexcept; - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch mul(batch const& self, batch const& other, requires_arch) noexcept; - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sadd(batch const& self, batch const& other, requires_arch) noexcept; - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch ssub(batch const& self, batch const& other, requires_arch) noexcept; - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T reduce_add(batch const& self, requires_arch) noexcept; - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T reduce_mul(batch const& self, requires_arch) noexcept; template XSIMD_INLINE batch rotl(batch const& self, STy other, requires_arch) noexcept; diff --git a/include/xsimd/arch/xsimd_emulated.hpp b/include/xsimd/arch/xsimd_emulated.hpp index 77cf03a8a..639850335 100644 --- a/include/xsimd/arch/xsimd_emulated.hpp +++ b/include/xsimd/arch/xsimd_emulated.hpp @@ -433,7 +433,7 @@ namespace xsimd } // isnan - template ::size, class = typename std::enable_if::value, void>::type> + template ::size, class = typename std::enable_if::value>::type> XSIMD_INLINE batch_bool isnan(batch const& self, requires_arch>) noexcept { return detail::emulated_apply([](T v) diff --git a/include/xsimd/arch/xsimd_neon.hpp b/include/xsimd/arch/xsimd_neon.hpp index 569aabbf1..ad2a25246 100644 --- a/include/xsimd/arch/xsimd_neon.hpp +++ b/include/xsimd/arch/xsimd_neon.hpp @@ -838,7 +838,7 @@ namespace xsimd WRAP_BINARY_UINT_EXCLUDING_64(vhaddq, detail::identity_return_type) - template ::value && sizeof(T) != 8), void>::type> + template ::value && sizeof(T) != 8)>::type> XSIMD_INLINE batch avg(batch const& lhs, batch const& rhs, requires_arch) noexcept { using register_type = typename batch::register_type; @@ -854,7 +854,7 @@ namespace xsimd WRAP_BINARY_UINT_EXCLUDING_64(vrhaddq, detail::identity_return_type) - template ::value && sizeof(T) != 8), void>::type> + template ::value && sizeof(T) != 8)>::type> XSIMD_INLINE batch avgr(batch const& lhs, batch const& rhs, requires_arch) noexcept { using register_type = typename batch::register_type; diff --git a/include/xsimd/arch/xsimd_scalar.hpp b/include/xsimd/arch/xsimd_scalar.hpp index 1e309f149..6052196c9 100644 --- a/include/xsimd/arch/xsimd_scalar.hpp +++ b/include/xsimd/arch/xsimd_scalar.hpp @@ -1144,21 +1144,21 @@ namespace xsimd struct common_sincosf { template - XSIMD_INLINE typename std::enable_if::type + XSIMD_INLINE typename std::enable_if::type operator()(float val, T& s, T& c) { sincosf(val, &s, &c); } template - XSIMD_INLINE typename std::enable_if::type + XSIMD_INLINE typename std::enable_if::type operator()(float val, T& s, T& c) { __sincosf(val, &s, &c); } template - XSIMD_INLINE typename std::enable_if::type + XSIMD_INLINE typename std::enable_if::type operator()(float val, T& s, T& c) { s = std::sin(val); @@ -1169,21 +1169,21 @@ namespace xsimd struct common_sincos { template - XSIMD_INLINE typename std::enable_if::type + XSIMD_INLINE typename std::enable_if::type operator()(double val, T& s, T& c) { sincos(val, &s, &c); } template - XSIMD_INLINE typename std::enable_if::type + XSIMD_INLINE typename std::enable_if::type operator()(double val, T& s, T& c) { __sincos(val, &s, &c); } template - XSIMD_INLINE typename std::enable_if::type + XSIMD_INLINE typename std::enable_if::type operator()(double val, T& s, T& c) { s = std::sin(val); @@ -1224,7 +1224,7 @@ namespace xsimd } #endif - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T frexp(T const& val, int& exp) noexcept { return std::frexp(val, &exp); diff --git a/include/xsimd/arch/xsimd_sse2.hpp b/include/xsimd/arch/xsimd_sse2.hpp index 22f3cdf99..28f371720 100644 --- a/include/xsimd/arch/xsimd_sse2.hpp +++ b/include/xsimd/arch/xsimd_sse2.hpp @@ -80,7 +80,7 @@ namespace xsimd } // add - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch add(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -129,7 +129,7 @@ namespace xsimd { return _mm_movemask_pd(self) == 0x03; } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE bool all(batch_bool const& self, requires_arch) noexcept { return _mm_movemask_epi8(self) == 0xFFFF; @@ -146,14 +146,14 @@ namespace xsimd { return _mm_movemask_pd(self) != 0; } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE bool any(batch_bool const& self, requires_arch) noexcept { return _mm_movemask_epi8(self) != 0; } // avgr - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch avgr(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -171,7 +171,7 @@ namespace xsimd } // avg - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch avg(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -208,12 +208,12 @@ namespace xsimd { return _mm_and_ps(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_and(batch const& self, batch const& other, requires_arch) noexcept { return _mm_and_si128(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_and(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return _mm_and_si128(self, other); @@ -243,12 +243,12 @@ namespace xsimd { return _mm_andnot_ps(other, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_andnot(batch const& self, batch const& other, requires_arch) noexcept { return _mm_andnot_si128(other, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_andnot(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return _mm_andnot_si128(other, self); @@ -267,7 +267,7 @@ namespace xsimd } // bitwise_lshift - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_lshift(batch const& self, int32_t other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -292,7 +292,7 @@ namespace xsimd return {}; } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_lshift(batch const& self, requires_arch) noexcept { constexpr auto bits = std::numeric_limits::digits + std::numeric_limits::is_signed; @@ -334,12 +334,12 @@ namespace xsimd { return _mm_xor_ps(self, _mm_castsi128_ps(_mm_set1_epi32(-1))); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_not(batch const& self, requires_arch) noexcept { return _mm_xor_si128(self, _mm_set1_epi32(-1)); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_not(batch_bool const& self, requires_arch) noexcept { return _mm_xor_si128(self, _mm_set1_epi32(-1)); @@ -366,12 +366,12 @@ namespace xsimd { return _mm_or_ps(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_or(batch const& self, batch const& other, requires_arch) noexcept { return _mm_or_si128(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_or(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return _mm_or_si128(self, other); @@ -390,7 +390,7 @@ namespace xsimd } // bitwise_rshift - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_rshift(batch const& self, int32_t other, requires_arch) noexcept { if (std::is_signed::value) @@ -450,7 +450,7 @@ namespace xsimd } } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_rshift(batch const& self, requires_arch) noexcept { constexpr auto bits = std::numeric_limits::digits + std::numeric_limits::is_signed; @@ -519,7 +519,7 @@ namespace xsimd { return _mm_xor_ps(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_xor(batch const& self, batch const& other, requires_arch) noexcept { return _mm_xor_si128(self, other); @@ -534,29 +534,29 @@ namespace xsimd { return _mm_xor_pd(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_xor(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return _mm_xor_si128(self, other); } // bitwise_cast - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return _mm_castsi128_ps(self); } - template ::type>::value, void>::type> + template ::type>::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return batch(self.data); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return _mm_castps_si128(self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return _mm_castsi128_pd(self); @@ -571,7 +571,7 @@ namespace xsimd { return _mm_castpd_ps(self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_cast(batch const& self, batch const&, requires_arch) noexcept { return _mm_castpd_si128(self); @@ -583,7 +583,7 @@ namespace xsimd { return _mm_set1_ps(val); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch broadcast(T val, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -643,7 +643,7 @@ namespace xsimd } // decr_if - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch decr_if(batch const& self, batch_bool const& mask, requires_arch) noexcept { return self + batch(mask.data); @@ -715,7 +715,7 @@ namespace xsimd { return _mm_castsi128_ps(_mm_cmpeq_epi32(_mm_castps_si128(self), _mm_castps_si128(other))); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool eq(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -744,7 +744,7 @@ namespace xsimd return {}; } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool eq(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return ~(self != other); @@ -773,7 +773,7 @@ namespace xsimd return _mm_cvtsd_f64(self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T first(batch const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -844,7 +844,7 @@ namespace xsimd assert(!(mask & ~0x3ul) && "inbound mask"); return _mm_castsi128_pd(_mm_load_si128((const __m128i*)lut[mask])); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool from_mask(batch_bool const&, uint64_t mask, requires_arch) noexcept { alignas(A::alignment()) static const uint64_t lut64[] = { @@ -921,7 +921,7 @@ namespace xsimd { return _mm_cmpgt_ps(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool gt(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -977,14 +977,14 @@ namespace xsimd } // incr_if - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch incr_if(batch const& self, batch_bool const& mask, requires_arch) noexcept { return self - batch(mask.data); } // insert - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch insert(batch const& self, T val, index pos, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 2) @@ -1015,7 +1015,7 @@ namespace xsimd { return _mm_load_ps(mem); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch load_aligned(T const* mem, convert, requires_arch) noexcept { return _mm_load_si128((__m128i const*)mem); @@ -1032,7 +1032,7 @@ namespace xsimd { return _mm_loadu_ps(mem); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch load_unaligned(T const* mem, convert, requires_arch) noexcept { return _mm_loadu_si128((__m128i const*)mem); @@ -1097,7 +1097,7 @@ namespace xsimd { return _mm_cmplt_ps(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool lt(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -1202,7 +1202,7 @@ namespace xsimd } // mask - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE uint64_t mask(batch_bool const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -1246,7 +1246,7 @@ namespace xsimd { return _mm_max_ps(other, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch max(batch const& self, batch const& other, requires_arch) noexcept { return select(self > other, self, other); @@ -1263,7 +1263,7 @@ namespace xsimd { return _mm_min_ps(other, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch min(batch const& self, batch const& other, requires_arch) noexcept { return select(self <= other, self, other); @@ -1302,7 +1302,7 @@ namespace xsimd } // neg - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch neg(batch const& self, requires_arch) noexcept { return 0 - self; @@ -1326,7 +1326,7 @@ namespace xsimd { return _mm_cmpneq_ps(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool neq(batch const& self, batch const& other, requires_arch) noexcept { return ~(self == other); @@ -1336,7 +1336,7 @@ namespace xsimd { return _mm_xor_ps(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool neq(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return _mm_castps_si128(_mm_xor_ps(_mm_castsi128_ps(self.data), _mm_castsi128_ps(other.data))); @@ -1370,7 +1370,7 @@ namespace xsimd return _mm_cvtss_f32(tmp1); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T reduce_add(batch const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 4) @@ -1408,7 +1408,7 @@ namespace xsimd } // reduce_max - template ::type> + template ::type> XSIMD_INLINE T reduce_max(batch const& self, requires_arch) noexcept { constexpr auto mask0 = detail::shuffle(2, 3, 0, 0); @@ -1430,7 +1430,7 @@ namespace xsimd } // reduce_min - template ::type> + template ::type> XSIMD_INLINE T reduce_min(batch const& self, requires_arch) noexcept { constexpr auto mask0 = detail::shuffle(2, 3, 0, 0); @@ -1466,7 +1466,7 @@ namespace xsimd return _mm_cvtsd_f64(_mm_mul_sd(self, _mm_unpackhi_pd(self, self))); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T reduce_mul(batch const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 4) @@ -1516,12 +1516,12 @@ namespace xsimd return _mm_or_ps(_mm_and_ps(cond, true_br), _mm_andnot_ps(cond, false_br)); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool const& cond, batch const& true_br, batch const& false_br, requires_arch) noexcept { return _mm_or_si128(_mm_and_si128(cond, true_br), _mm_andnot_si128(cond, false_br)); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool_constant const&, batch const& true_br, batch const& false_br, requires_arch) noexcept { return select(batch_bool { Values... }, true_br, false_br, sse2 {}); @@ -1589,7 +1589,7 @@ namespace xsimd // sadd - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sadd(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -1632,22 +1632,22 @@ namespace xsimd return _mm_setr_ps(values...); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1) noexcept { return _mm_set_epi64x(v1, v0); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1, T v2, T v3) noexcept { return _mm_setr_epi32(v0, v1, v2, v3); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7) noexcept { return _mm_setr_epi16(v0, v1, v2, v3, v4, v5, v6, v7); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15) noexcept { return _mm_setr_epi8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); @@ -1660,7 +1660,7 @@ namespace xsimd return _mm_setr_pd(values...); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool set(batch_bool const&, requires_arch, Values... values) noexcept { return set(batch(), A {}, static_cast(values ? -1LL : 0LL)...).data; @@ -1682,7 +1682,7 @@ namespace xsimd // ssub - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch ssub(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -1777,12 +1777,12 @@ namespace xsimd { return _mm_store_ps(mem, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_aligned(T* mem, batch const& self, requires_arch) noexcept { return _mm_store_si128((__m128i*)mem, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_aligned(T* mem, batch_bool const& self, requires_arch) noexcept { return _mm_store_si128((__m128i*)mem, self); @@ -1799,12 +1799,12 @@ namespace xsimd { return _mm_storeu_ps(mem, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_unaligned(T* mem, batch const& self, requires_arch) noexcept { return _mm_storeu_si128((__m128i*)mem, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_unaligned(T* mem, batch_bool const& self, requires_arch) noexcept { return _mm_storeu_si128((__m128i*)mem, self); @@ -1821,7 +1821,7 @@ namespace xsimd { return _mm_sub_ps(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sub(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -2025,7 +2025,7 @@ namespace xsimd { return _mm_unpackhi_ps(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch zip_hi(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -2062,7 +2062,7 @@ namespace xsimd { return _mm_unpacklo_ps(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch zip_lo(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) diff --git a/include/xsimd/arch/xsimd_sse3.hpp b/include/xsimd/arch/xsimd_sse3.hpp index 5ad7575b3..3e7cf9619 100644 --- a/include/xsimd/arch/xsimd_sse3.hpp +++ b/include/xsimd/arch/xsimd_sse3.hpp @@ -36,7 +36,7 @@ namespace xsimd } // load_unaligned - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch load_unaligned(T const* mem, convert, requires_arch) noexcept { return _mm_lddqu_si128((__m128i const*)mem); diff --git a/include/xsimd/arch/xsimd_sse4_1.hpp b/include/xsimd/arch/xsimd_sse4_1.hpp index b453d57cb..92330ef3c 100644 --- a/include/xsimd/arch/xsimd_sse4_1.hpp +++ b/include/xsimd/arch/xsimd_sse4_1.hpp @@ -23,7 +23,7 @@ namespace xsimd { using namespace types; // any - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE bool any(batch const& self, requires_arch) noexcept { return !_mm_testz_si128(self, self); @@ -68,7 +68,7 @@ namespace xsimd } // eq - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool eq(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 8) @@ -94,7 +94,7 @@ namespace xsimd } // insert - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch insert(batch const& self, T val, index pos, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -124,7 +124,7 @@ namespace xsimd // load_unaligned - template ::value && sizeof(T) > 1), void>::type> + template ::value && sizeof(T) > 1)>::type> XSIMD_INLINE batch_bool load_unaligned(bool const* mem, batch_bool, requires_arch) noexcept { // GCC <12 have missing or buggy unaligned load intrinsics; use memcpy to work around this. @@ -173,7 +173,7 @@ namespace xsimd } // max - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch max(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -217,7 +217,7 @@ namespace xsimd } // min - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch min(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -261,7 +261,7 @@ namespace xsimd } // mul - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch mul(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -317,7 +317,7 @@ namespace xsimd } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool const& cond, batch const& true_br, batch const& false_br, requires_arch) noexcept { return _mm_blendv_epi8(false_br, true_br, cond); @@ -333,7 +333,7 @@ namespace xsimd return _mm_blendv_pd(false_br, true_br, cond); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool_constant const&, batch const& true_br, batch const& false_br, requires_arch) noexcept { constexpr int mask = batch_bool_constant::mask(); diff --git a/include/xsimd/arch/xsimd_ssse3.hpp b/include/xsimd/arch/xsimd_ssse3.hpp index b612d438e..c6eff660d 100644 --- a/include/xsimd/arch/xsimd_ssse3.hpp +++ b/include/xsimd/arch/xsimd_ssse3.hpp @@ -26,7 +26,7 @@ namespace xsimd using namespace types; // abs - template ::value && std::is_signed::value, void>::type> + template ::value && std::is_signed::value>::type> XSIMD_INLINE batch abs(batch const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -74,7 +74,7 @@ namespace xsimd } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch extract_pair(batch const& self, batch const& other, std::size_t i, requires_arch) noexcept { constexpr std::size_t size = batch::size; @@ -83,7 +83,7 @@ namespace xsimd } // reduce_add - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T reduce_add(batch const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 2) diff --git a/include/xsimd/arch/xsimd_vsx.hpp b/include/xsimd/arch/xsimd_vsx.hpp index 0e7d74a3b..593346d4c 100644 --- a/include/xsimd/arch/xsimd_vsx.hpp +++ b/include/xsimd/arch/xsimd_vsx.hpp @@ -52,28 +52,28 @@ namespace xsimd } // add - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch add(batch const& self, batch const& other, requires_arch) noexcept { return vec_add(self.data, other.data); } // all - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE bool all(batch_bool const& self, requires_arch) noexcept { return vec_all_ne(self.data, vec_xor(self.data, self.data)); } // any - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE bool any(batch_bool const& self, requires_arch) noexcept { return vec_any_ne(self.data, vec_xor(self.data, self.data)); } // avgr - template ::value && sizeof(T) < 8, void>::type> + template ::value && sizeof(T) < 8>::type> XSIMD_INLINE batch avgr(batch const& self, batch const& other, requires_arch) noexcept { return vec_avg(self.data, other.data); @@ -90,7 +90,7 @@ namespace xsimd } // avg - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch avg(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) < 8) @@ -123,31 +123,31 @@ namespace xsimd } // bitwise_and - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_and(batch const& self, batch const& other, requires_arch) noexcept { return vec_and(self.data, other.data); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_and(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return vec_and(self.data, other.data); } // bitwise_andnot - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_andnot(batch const& self, batch const& other, requires_arch) noexcept { return vec_and(self.data, vec_nor(other.data, other.data)); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_andnot(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return self.data & ~other.data; } // bitwise_lshift - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_lshift(batch const& self, int32_t other, requires_arch) noexcept { using shift_type = as_unsigned_integer_t; @@ -156,31 +156,31 @@ namespace xsimd } // bitwise_not - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_not(batch const& self, requires_arch) noexcept { return vec_nor(self.data, self.data); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_not(batch_bool const& self, requires_arch) noexcept { return vec_nor(self.data, self.data); } // bitwise_or - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_or(batch const& self, batch const& other, requires_arch) noexcept { return vec_or(self.data, other.data); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_or(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return vec_or(self.data, other.data); } // bitwise_rshift - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_rshift(batch const& self, int32_t other, requires_arch) noexcept { using shift_type = as_unsigned_integer_t; @@ -196,12 +196,12 @@ namespace xsimd } // bitwise_xor - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_xor(batch const& self, batch const& other, requires_arch) noexcept { return vec_xor(self.data, other.data); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool bitwise_xor(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return vec_xor(self.data, other.data); @@ -215,14 +215,14 @@ namespace xsimd } // broadcast - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch broadcast(T val, requires_arch) noexcept { return vec_splats(val); } // ceil - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch ceil(batch const& self, requires_arch) noexcept { return vec_ceil(self.data); @@ -256,7 +256,7 @@ namespace xsimd } // decr_if - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch decr_if(batch const& self, batch_bool const& mask, requires_arch) noexcept { return self + batch((typename batch::register_type)mask.data); @@ -328,13 +328,13 @@ namespace xsimd } // eq - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool eq(batch const& self, batch const& other, requires_arch) noexcept { auto res = vec_cmpeq(self.data, other.data); return *reinterpret_cast::register_type*>(&res); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool eq(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { auto res = vec_cmpeq(self.data, other.data); @@ -342,28 +342,28 @@ namespace xsimd } // first - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T first(batch const& self, requires_arch) noexcept { return vec_extract(self.data, 0); } // floor - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch floor(batch const& self, requires_arch) noexcept { return vec_floor(self.data); } // ge - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool ge(batch const& self, batch const& other, requires_arch) noexcept { return vec_cmpge(self.data, other.data); } // gt - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool gt(batch const& self, batch const& other, requires_arch) noexcept { return vec_cmpgt(self.data, other.data); @@ -396,14 +396,14 @@ namespace xsimd } // incr_if - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch incr_if(batch const& self, batch_bool const& mask, requires_arch) noexcept { return self - batch((typename batch::register_type)mask.data); } // insert - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch insert(batch const& self, T val, index, requires_arch) noexcept { return vec_insert(val, self.data, I); @@ -422,14 +422,14 @@ namespace xsimd } // load_aligned - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch load_aligned(T const* mem, convert, requires_arch) noexcept { return vec_ld(0, reinterpret_cast::register_type*>(mem)); } // load_unaligned - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch load_unaligned(T const* mem, convert, requires_arch) noexcept { return vec_vsx_ld(0, (typename batch::register_type const*)mem); @@ -453,54 +453,54 @@ namespace xsimd } // le - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool le(batch const& self, batch const& other, requires_arch) noexcept { return vec_cmple(self.data, other.data); } // lt - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool lt(batch const& self, batch const& other, requires_arch) noexcept { return vec_cmplt(self.data, other.data); } // max - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch max(batch const& self, batch const& other, requires_arch) noexcept { return vec_max(self.data, other.data); } // min - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch min(batch const& self, batch const& other, requires_arch) noexcept { return vec_min(self.data, other.data); } // mul - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch mul(batch const& self, batch const& other, requires_arch) noexcept { return self.data * other.data; } // neg - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch neg(batch const& self, requires_arch) noexcept { return -(self.data); } // neq - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool neq(batch const& self, batch const& other, requires_arch) noexcept { return ~vec_cmpeq(self.data, other.data); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool neq(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return ~vec_cmpeq(self.data, other.data); @@ -556,7 +556,7 @@ namespace xsimd auto tmp1 = vec_add(self.data, tmp0); // v0 + v1, v1 + v0 return vec_extract(tmp1, 0); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T reduce_add(batch const& self, requires_arch) noexcept { return reduce_add(self, common {}); @@ -598,14 +598,14 @@ namespace xsimd auto tmp1 = vec_mul(self.data, tmp0); // v0 * v1, v1 * v0 return vec_extract(tmp1, 0); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T reduce_mul(batch const& self, requires_arch) noexcept { return reduce_mul(self, common {}); } // round - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch round(batch const& self, requires_arch) noexcept { return vec_round(self.data); @@ -624,12 +624,12 @@ namespace xsimd } // select - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool const& cond, batch const& true_br, batch const& false_br, requires_arch) noexcept { return vec_sel(false_br.data, true_br.data, cond.data); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool_constant const&, batch const& true_br, batch const& false_br, requires_arch) noexcept { return select(batch_bool { Values... }, true_br, false_br, vsx {}); @@ -715,7 +715,7 @@ namespace xsimd } // sadd - template ::value && sizeof(T) != 8, void>::type> + template ::value && sizeof(T) != 8>::type> XSIMD_INLINE batch sadd(batch const& self, batch const& other, requires_arch) noexcept { return vec_adds(self.data, other.data); @@ -729,7 +729,7 @@ namespace xsimd return typename batch::register_type { values... }; } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool set(batch_bool const&, requires_arch, Values... values) noexcept { static_assert(sizeof...(Values) == batch_bool::size, "consistent init"); @@ -738,28 +738,28 @@ namespace xsimd // ssub - template ::value && sizeof(T) == 1, void>::type> + template ::value && sizeof(T) == 1>::type> XSIMD_INLINE batch ssub(batch const& self, batch const& other, requires_arch) noexcept { return vec_subs(self.data, other.data); } // store_aligned - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_aligned(T* mem, batch const& self, requires_arch) noexcept { return vec_st(self.data, 0, reinterpret_cast::register_type*>(mem)); } // store_unaligned - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_unaligned(T* mem, batch const& self, requires_arch) noexcept { return vec_vsx_st(self.data, 0, reinterpret_cast::register_type*>(mem)); } // sub - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sub(batch const& self, batch const& other, requires_arch) noexcept { return vec_sub(self.data, other.data); @@ -867,21 +867,21 @@ namespace xsimd } // trunc - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch trunc(batch const& self, requires_arch) noexcept { return vec_trunc(self.data); } // zip_hi - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch zip_hi(batch const& self, batch const& other, requires_arch) noexcept { return vec_mergel(self.data, other.data); } // zip_lo - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch zip_lo(batch const& self, batch const& other, requires_arch) noexcept { return vec_mergeh(self.data, other.data); diff --git a/include/xsimd/arch/xsimd_wasm.hpp b/include/xsimd/arch/xsimd_wasm.hpp index ad0867c5b..57f1ac931 100644 --- a/include/xsimd/arch/xsimd_wasm.hpp +++ b/include/xsimd/arch/xsimd_wasm.hpp @@ -43,7 +43,7 @@ namespace xsimd XSIMD_INLINE void transpose(batch* matrix_begin, batch* matrix_end, requires_arch) noexcept; // abs - template ::value && std::is_signed::value, void>::type> + template ::value && std::is_signed::value>::type> XSIMD_INLINE batch abs(batch const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -82,7 +82,7 @@ namespace xsimd } // add - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch add(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -121,7 +121,7 @@ namespace xsimd } // avgr - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch avgr(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -139,7 +139,7 @@ namespace xsimd } // avg - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch avg(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -169,7 +169,7 @@ namespace xsimd { return wasm_i64x2_bitmask(self) == 0x03; } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE bool all(batch_bool const& self, requires_arch) noexcept { return wasm_i8x16_bitmask(self) == 0xFFFF; @@ -186,7 +186,7 @@ namespace xsimd { return wasm_i64x2_bitmask(self) != 0; } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE bool any(batch_bool const& self, requires_arch) noexcept { return wasm_i8x16_bitmask(self) != 0; @@ -246,7 +246,7 @@ namespace xsimd } // bitwise_lshift - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_lshift(batch const& self, int32_t other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -273,7 +273,7 @@ namespace xsimd } // bitwise_rshift - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch bitwise_rshift(batch const& self, int32_t other, requires_arch) noexcept { if (std::is_signed::value) @@ -358,7 +358,7 @@ namespace xsimd { return wasm_f32x4_splat(val); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch broadcast(T val, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -424,7 +424,7 @@ namespace xsimd { return wasm_i32x4_eq(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool eq(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -449,7 +449,7 @@ namespace xsimd return {}; } } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool eq(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -537,7 +537,7 @@ namespace xsimd { return wasm_f32x4_extract_lane(self, 0); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T first(batch const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -618,7 +618,7 @@ namespace xsimd assert(!(mask & ~0x3ul) && "inbound mask"); return wasm_v128_load((const v128_t*)lut[mask]); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool from_mask(batch_bool const&, uint64_t mask, requires_arch) noexcept { alignas(A::alignment()) static const uint64_t lut64[] = { @@ -721,7 +721,7 @@ namespace xsimd { return wasm_f32x4_gt(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool gt(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -802,7 +802,7 @@ namespace xsimd { return wasm_f32x4_replace_lane(self, pos, val); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch insert(batch const& self, T val, index pos, requires_arch) noexcept { if (std::is_signed::value) @@ -891,7 +891,7 @@ namespace xsimd { return wasm_v128_load(mem); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch load_aligned(T const* mem, convert, requires_arch) noexcept { return wasm_v128_load((v128_t const*)mem); @@ -923,7 +923,7 @@ namespace xsimd { return wasm_v128_load(mem); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch load_unaligned(T const* mem, convert, requires_arch) noexcept { return wasm_v128_load((v128_t const*)mem); @@ -940,7 +940,7 @@ namespace xsimd { return wasm_f32x4_lt(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool lt(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -1008,7 +1008,7 @@ namespace xsimd } // mask - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE uint64_t mask(batch_bool const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -1051,7 +1051,7 @@ namespace xsimd { return wasm_f32x4_pmax(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch max(batch const& self, batch const& other, requires_arch) noexcept { return select(self > other, self, other); @@ -1068,7 +1068,7 @@ namespace xsimd { return wasm_f32x4_pmin(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch min(batch const& self, batch const& other, requires_arch) noexcept { return select(self <= other, self, other); @@ -1092,7 +1092,7 @@ namespace xsimd } // neg - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch neg(batch const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -1136,7 +1136,7 @@ namespace xsimd { return wasm_f32x4_ne(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool neq(batch const& self, batch const& other, requires_arch) noexcept { return ~(self == other); @@ -1146,7 +1146,7 @@ namespace xsimd { return wasm_f32x4_ne(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool neq(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return ~(self == other); @@ -1187,7 +1187,7 @@ namespace xsimd v128_t tmp3 = wasm_i32x4_shuffle(tmp0, tmp2, 4, 1, 2, 3); return wasm_f32x4_extract_lane(tmp3, 0); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T reduce_add(batch const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 4) @@ -1228,7 +1228,7 @@ namespace xsimd v128_t tmp3 = wasm_i32x4_shuffle(tmp0, tmp2, 4, 1, 2, 3); return wasm_f32x4_extract_lane(tmp3, 0); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE T reduce_mul(batch const& self, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 4) @@ -1306,7 +1306,7 @@ namespace xsimd } // sadd - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sadd(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -1348,12 +1348,12 @@ namespace xsimd return wasm_v128_or(wasm_v128_and(cond, true_br), wasm_v128_andnot(false_br, cond)); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool const& cond, batch const& true_br, batch const& false_br, requires_arch) noexcept { return wasm_v128_or(wasm_v128_and(cond, true_br), wasm_v128_andnot(false_br, cond)); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch select(batch_bool_constant const&, batch const& true_br, batch const& false_br, requires_arch) noexcept { return select(batch_bool { Values... }, true_br, false_br, wasm {}); @@ -1385,25 +1385,25 @@ namespace xsimd return wasm_f32x4_make(values...); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1) noexcept { return wasm_i64x2_make(v0, v1); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1, T v2, T v3) noexcept { return wasm_i32x4_make(v0, v1, v2, v3); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7) noexcept { return wasm_i16x8_make(v0, v1, v2, v3, v4, v5, v6, v7); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15) noexcept { return wasm_i8x16_make(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); @@ -1416,7 +1416,7 @@ namespace xsimd return wasm_f64x2_make(values...); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch_bool set(batch_bool const&, requires_arch, Values... values) noexcept { return set(batch(), A {}, static_cast(values ? -1LL : 0LL)...).data; @@ -1437,7 +1437,7 @@ namespace xsimd } // ssub - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch ssub(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed::value) @@ -1478,12 +1478,12 @@ namespace xsimd { return wasm_v128_store(mem, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_aligned(T* mem, batch const& self, requires_arch) noexcept { return wasm_v128_store((v128_t*)mem, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_aligned(T* mem, batch_bool const& self, requires_arch) noexcept { return wasm_v128_store((v128_t*)mem, self); @@ -1527,12 +1527,12 @@ namespace xsimd { return wasm_v128_store(mem, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_unaligned(T* mem, batch const& self, requires_arch) noexcept { return wasm_v128_store((v128_t*)mem, self); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE void store_unaligned(T* mem, batch_bool const& self, requires_arch) noexcept { return wasm_v128_store((v128_t*)mem, self); @@ -1549,7 +1549,7 @@ namespace xsimd { return wasm_f32x4_sub(self, other); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch sub(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -1707,7 +1707,7 @@ namespace xsimd { return wasm_i32x4_shuffle(self, other, 2, 6, 3, 7); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch zip_hi(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) @@ -1744,7 +1744,7 @@ namespace xsimd { return wasm_i32x4_shuffle(self, other, 0, 4, 1, 5); } - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch zip_lo(batch const& self, batch const& other, requires_arch) noexcept { XSIMD_IF_CONSTEXPR(sizeof(T) == 1) diff --git a/include/xsimd/types/xsimd_api.hpp b/include/xsimd/types/xsimd_api.hpp index afaf2cdf1..efa50c28e 100644 --- a/include/xsimd/types/xsimd_api.hpp +++ b/include/xsimd/types/xsimd_api.hpp @@ -1783,7 +1783,7 @@ namespace xsimd * @param y batch of integral values. * @return \c x raised to the power \c y. */ - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch pow(batch const& x, ITy y) noexcept { detail::static_check_supported_config(); @@ -1827,7 +1827,7 @@ namespace xsimd * @param x batch of floating point numbers. * @return the reciprocal. */ - template ::value, void>::type> + template ::value>::type> XSIMD_INLINE batch reciprocal(batch const& x) noexcept { detail::static_check_supported_config(); diff --git a/test/test_batch.cpp b/test/test_batch.cpp index b301a5bea..744fdc15b 100644 --- a/test/test_batch.cpp +++ b/test/test_batch.cpp @@ -850,7 +850,7 @@ struct batch_test } template - typename std::enable_if<4 <= N, void>::type test_common_horizontal_operations(std::integral_constant) const + typename std::enable_if<4 <= N>::type test_common_horizontal_operations(std::integral_constant) const { // reduce common { diff --git a/test/test_batch_cast.cpp b/test/test_batch_cast.cpp index 8a638ed24..9605fe5b1 100644 --- a/test/test_batch_cast.cpp +++ b/test/test_batch_cast.cpp @@ -207,7 +207,7 @@ struct batch_cast_test #if 0 && XSIMD_X86_INSTR_SET >= XSIMD_X86_AVX_VERSION template - typename std::enable_if= 32, void>::type test_cast_sizeshift1() const + typename std::enable_if= 32>::type test_cast_sizeshift1() const { for (const auto& test_value : int_test_values) { @@ -264,14 +264,14 @@ struct batch_cast_test } template - typename std::enable_if::type test_cast_sizeshift1() const + typename std::enable_if::type test_cast_sizeshift1() const { } #endif #if 0 && XSIMD_X86_INSTR_SET >= XSIMD_X86_AVX512_VERSION template - typename std::enable_if= 64, void>::type test_cast_sizeshift2() const + typename std::enable_if= 64>::type test_cast_sizeshift2() const { for (const auto& test_value : int_test_values) { @@ -314,7 +314,7 @@ struct batch_cast_test } template - typename std::enable_if::type test_cast_sizeshift2() const + typename std::enable_if::type test_cast_sizeshift2() const { } #endif From 63122b04241dad1ef1fc6cbf43f6ca0bc751e1ce Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Thu, 30 Oct 2025 15:05:14 +0100 Subject: [PATCH 2/2] Omit unused class name for template parameters --- include/xsimd/arch/common/xsimd_common_details.hpp | 4 ++-- include/xsimd/arch/common/xsimd_common_math.hpp | 2 +- include/xsimd/arch/xsimd_avx.hpp | 4 ++-- include/xsimd/arch/xsimd_avx512f.hpp | 6 +++--- include/xsimd/arch/xsimd_scalar.hpp | 2 +- include/xsimd/arch/xsimd_sse2.hpp | 4 ++-- include/xsimd/arch/xsimd_ssse3.hpp | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/xsimd/arch/common/xsimd_common_details.hpp b/include/xsimd/arch/common/xsimd_common_details.hpp index 28590ce99..2c8adc97d 100644 --- a/include/xsimd/arch/common/xsimd_common_details.hpp +++ b/include/xsimd/arch/common/xsimd_common_details.hpp @@ -190,7 +190,7 @@ namespace xsimd // Provide a common uint32_t -> float cast only if we have a // non-common int32_t -> float fast_cast - template const&>(), std::declval const&>(), A {}))> + template const&>(), std::declval const&>(), A {}))> XSIMD_INLINE batch fast_cast(batch const& v, batch const&, requires_arch) noexcept { // see https://stackoverflow.com/questions/34066228/how-to-perform-uint32-float-conversion-with-sse @@ -207,7 +207,7 @@ namespace xsimd // Provide a common float -> uint32_t cast only if we have a // non-common float -> int32_t fast_cast - template const&>(), std::declval const&>(), A {}))> + template const&>(), std::declval const&>(), A {}))> XSIMD_INLINE batch fast_cast(batch const& v, batch const&, requires_arch) noexcept { auto is_large = v >= batch(1u << 31); diff --git a/include/xsimd/arch/common/xsimd_common_math.hpp b/include/xsimd/arch/common/xsimd_common_math.hpp index 5ca0a44d6..75d4f1096 100644 --- a/include/xsimd/arch/common/xsimd_common_math.hpp +++ b/include/xsimd/arch/common/xsimd_common_math.hpp @@ -286,7 +286,7 @@ namespace xsimd } // copysign - template ::value>::type> + template ::value>::type> XSIMD_INLINE batch copysign(batch const& self, batch const& other, requires_arch) noexcept { return abs(self) | bitofsign(other); diff --git a/include/xsimd/arch/xsimd_avx.hpp b/include/xsimd/arch/xsimd_avx.hpp index 1a6ed1d8a..35c66594a 100644 --- a/include/xsimd/arch/xsimd_avx.hpp +++ b/include/xsimd/arch/xsimd_avx.hpp @@ -1056,7 +1056,7 @@ namespace xsimd } // reduce_max - template ::type> + template ::type> XSIMD_INLINE T reduce_max(batch const& self, requires_arch) noexcept { constexpr auto mask = detail::shuffle(1, 0); @@ -1067,7 +1067,7 @@ namespace xsimd } // reduce_min - template ::type> + template ::type> XSIMD_INLINE T reduce_min(batch const& self, requires_arch) noexcept { constexpr auto mask = detail::shuffle(1, 0); diff --git a/include/xsimd/arch/xsimd_avx512f.hpp b/include/xsimd/arch/xsimd_avx512f.hpp index f710e1ff2..bc4881cdb 100644 --- a/include/xsimd/arch/xsimd_avx512f.hpp +++ b/include/xsimd/arch/xsimd_avx512f.hpp @@ -1631,7 +1631,7 @@ namespace xsimd } // reduce_max - template ::type> + template ::type> XSIMD_INLINE T reduce_max(batch const& self, requires_arch) noexcept { constexpr batch_constant mask; @@ -1642,7 +1642,7 @@ namespace xsimd } // reduce_min - template ::type> + template ::type> XSIMD_INLINE T reduce_min(batch const& self, requires_arch) noexcept { constexpr batch_constant mask; @@ -2350,7 +2350,7 @@ namespace xsimd } - template ::value>::type> + template ::value>::type> XSIMD_INLINE batch swizzle(batch const& self, batch_constant, requires_arch) noexcept { constexpr typename detail::fold_batch_constant::type mask32; diff --git a/include/xsimd/arch/xsimd_scalar.hpp b/include/xsimd/arch/xsimd_scalar.hpp index 6052196c9..762eac684 100644 --- a/include/xsimd/arch/xsimd_scalar.hpp +++ b/include/xsimd/arch/xsimd_scalar.hpp @@ -1224,7 +1224,7 @@ namespace xsimd } #endif - template ::value>::type> + template ::value>::type> XSIMD_INLINE T frexp(T const& val, int& exp) noexcept { return std::frexp(val, &exp); diff --git a/include/xsimd/arch/xsimd_sse2.hpp b/include/xsimd/arch/xsimd_sse2.hpp index 28f371720..deb1af542 100644 --- a/include/xsimd/arch/xsimd_sse2.hpp +++ b/include/xsimd/arch/xsimd_sse2.hpp @@ -1408,7 +1408,7 @@ namespace xsimd } // reduce_max - template ::type> + template ::type> XSIMD_INLINE T reduce_max(batch const& self, requires_arch) noexcept { constexpr auto mask0 = detail::shuffle(2, 3, 0, 0); @@ -1430,7 +1430,7 @@ namespace xsimd } // reduce_min - template ::type> + template ::type> XSIMD_INLINE T reduce_min(batch const& self, requires_arch) noexcept { constexpr auto mask0 = detail::shuffle(2, 3, 0, 0); diff --git a/include/xsimd/arch/xsimd_ssse3.hpp b/include/xsimd/arch/xsimd_ssse3.hpp index c6eff660d..b86f08a2c 100644 --- a/include/xsimd/arch/xsimd_ssse3.hpp +++ b/include/xsimd/arch/xsimd_ssse3.hpp @@ -74,7 +74,7 @@ namespace xsimd } } - template ::value>::type> + template ::value>::type> XSIMD_INLINE batch extract_pair(batch const& self, batch const& other, std::size_t i, requires_arch) noexcept { constexpr std::size_t size = batch::size;