From 39fe9e11948f0ed982d1cc02f65424477a91fe45 Mon Sep 17 00:00:00 2001 From: AntoinePrv Date: Mon, 27 Jul 2026 15:06:15 +0200 Subject: [PATCH] Fix clang-tidy warnings --- examples/pico_bench.hpp | 4 +- .../arch/common/xsimd_common_arithmetic.hpp | 18 +- .../arch/common/xsimd_common_logical.hpp | 6 +- .../xsimd/arch/common/xsimd_common_math.hpp | 4 +- .../xsimd/arch/common/xsimd_common_memory.hpp | 2 +- include/xsimd/arch/xsimd_avx.hpp | 10 +- include/xsimd/arch/xsimd_avx512f.hpp | 5 +- include/xsimd/arch/xsimd_common_fwd.hpp | 3 + include/xsimd/arch/xsimd_emulated.hpp | 2 +- include/xsimd/arch/xsimd_neon.hpp | 506 +++++++++--------- include/xsimd/arch/xsimd_neon64.hpp | 105 ++-- include/xsimd/arch/xsimd_rvv.hpp | 6 +- include/xsimd/arch/xsimd_scalar.hpp | 14 +- include/xsimd/arch/xsimd_sve.hpp | 8 +- include/xsimd/arch/xsimd_vsx.hpp | 108 ++-- include/xsimd/arch/xsimd_vxe.hpp | 52 +- include/xsimd/arch/xsimd_wasm.hpp | 96 ++-- include/xsimd/types/xsimd_batch.hpp | 4 +- include/xsimd/types/xsimd_neon_register.hpp | 4 +- include/xsimd/types/xsimd_rvv_register.hpp | 10 +- include/xsimd/types/xsimd_sve_register.hpp | 12 +- include/xsimd/types/xsimd_traits.hpp | 42 +- include/xsimd/types/xsimd_utils.hpp | 7 +- test/test_batch.cpp | 4 +- test/test_custom_default_arch.cpp | 2 +- 25 files changed, 524 insertions(+), 510 deletions(-) diff --git a/examples/pico_bench.hpp b/examples/pico_bench.hpp index 727f5e35e..b0c58c92c 100644 --- a/examples/pico_bench.hpp +++ b/examples/pico_bench.hpp @@ -202,14 +202,14 @@ namespace pico_bench } template - std::enable_if_t()())>::value, stats_type> + std::enable_if_t()())>, stats_type> operator()(Fn fn) const { return (*this)(BenchWrapper { fn }); } template - std::enable_if_t()()), T>::value, stats_type> + std::enable_if_t()()), T>, stats_type> operator()(Fn fn) const { // Do a single un-timed warm up run diff --git a/include/xsimd/arch/common/xsimd_common_arithmetic.hpp b/include/xsimd/arch/common/xsimd_common_arithmetic.hpp index fcca73a4e..6e2b41812 100644 --- a/include/xsimd/arch/common/xsimd_common_arithmetic.hpp +++ b/include/xsimd/arch/common/xsimd_common_arithmetic.hpp @@ -29,14 +29,14 @@ namespace xsimd using namespace types; // bitwise_lshift - template ::value>*/> + template >*/> 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>*/> + template >*/> XSIMD_INLINE batch bitwise_lshift(batch const& self, requires_arch) noexcept { constexpr auto bits = std::numeric_limits::digits + std::numeric_limits::is_signed; @@ -45,14 +45,14 @@ namespace xsimd } // bitwise_rshift - template ::value>*/> + template >*/> 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>*/> + template >*/> XSIMD_INLINE batch bitwise_rshift(batch const& self, requires_arch) noexcept { constexpr auto bits = std::numeric_limits::digits + std::numeric_limits::is_signed; @@ -170,7 +170,7 @@ namespace xsimd } // mul - template ::value>*/> + template >*/> XSIMD_INLINE batch mul(batch const& self, batch const& other, requires_arch) noexcept { return detail::apply([](T x, T y) noexcept -> T @@ -298,7 +298,7 @@ namespace xsimd } } - template ::value>*/> + template >*/> XSIMD_INLINE batch mul_hi(batch const& self, batch const& other, requires_arch) noexcept { return detail::apply([](T x, T y) noexcept -> T @@ -307,7 +307,7 @@ namespace xsimd } // mul_hilo - template ::value>*/> + template >*/> XSIMD_INLINE std::pair, batch> mul_hilo(batch const& self, batch const& other, requires_arch) noexcept { @@ -365,7 +365,7 @@ namespace xsimd { return add(self, other); // no saturated arithmetic on floating point numbers } - template ::value>*/> + template >*/> XSIMD_INLINE batch sadd(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed_v) @@ -393,7 +393,7 @@ namespace xsimd { return sub(self, other); // no saturated arithmetic on floating point numbers } - template ::value>*/> + template >*/> XSIMD_INLINE batch ssub(batch const& self, batch const& other, requires_arch) noexcept { if (std::is_signed_v) diff --git a/include/xsimd/arch/common/xsimd_common_logical.hpp b/include/xsimd/arch/common/xsimd_common_logical.hpp index 7fab24de9..b6aed9c96 100644 --- a/include/xsimd/arch/common/xsimd_common_logical.hpp +++ b/include/xsimd/arch/common/xsimd_common_logical.hpp @@ -210,10 +210,10 @@ namespace xsimd namespace detail { template - using is_batch_bool_register_same = std::is_same::register_type, typename batch::register_type>; + constexpr bool is_batch_bool_register_same_v = std::is_same_v::register_type, typename batch::register_type>; } - template ::value, int> = 3> + template , int> = 3> XSIMD_INLINE batch_bool select(batch_bool const& cond, batch_bool const& true_br, batch_bool const& false_br, requires_arch) { using register_type = typename batch_bool::register_type; @@ -223,7 +223,7 @@ namespace xsimd return batch_bool { select(cond, true_v, false_v) }; } - template ::value, int> = 3> + template , int> = 3> XSIMD_INLINE batch_bool select(batch_bool const& cond, batch_bool const& true_br, batch_bool const& false_br, requires_arch) { return (true_br & cond) | (bitwise_andnot(false_br, cond)); diff --git a/include/xsimd/arch/common/xsimd_common_math.hpp b/include/xsimd/arch/common/xsimd_common_math.hpp index c7bad2df3..570a1da89 100644 --- a/include/xsimd/arch/common/xsimd_common_math.hpp +++ b/include/xsimd/arch/common/xsimd_common_math.hpp @@ -2117,7 +2117,7 @@ namespace xsimd return { reduce_add(self.real()), reduce_add(self.imag()) }; } - template ::value>*/> + template >*/> XSIMD_INLINE T reduce_add(batch const& self, requires_arch) noexcept { alignas(A::alignment()) T buffer[batch::size]; @@ -2189,7 +2189,7 @@ namespace xsimd return res; } - template ::value>*/> + template >*/> XSIMD_INLINE T reduce_mul(batch const& self, requires_arch) noexcept { alignas(A::alignment()) T buffer[batch::size]; diff --git a/include/xsimd/arch/common/xsimd_common_memory.hpp b/include/xsimd/arch/common/xsimd_common_memory.hpp index 9f10d54a3..046faafad 100644 --- a/include/xsimd/arch/common/xsimd_common_memory.hpp +++ b/include/xsimd/arch/common/xsimd_common_memory.hpp @@ -379,7 +379,7 @@ namespace xsimd std::is_same_v && std::is_integral_v && !std::is_void_v> - && types::has_simd_register, A>::value>; + && types::has_simd_register_v, A>>; // Scalar-buffer fallback: materialize masked-off lanes as zero, then load. template diff --git a/include/xsimd/arch/xsimd_avx.hpp b/include/xsimd/arch/xsimd_avx.hpp index ce6093605..814452cea 100644 --- a/include/xsimd/arch/xsimd_avx.hpp +++ b/include/xsimd/arch/xsimd_avx.hpp @@ -1100,16 +1100,16 @@ namespace xsimd // True when batch_bool shares the data register (__m256/__m256d) rather // than an EVEX k-register; the _mm256_cast*_si256 path below needs the former. template - using uses_vector_mask = std::is_same::register_type, - typename batch::register_type>; + inline constexpr bool uses_vector_mask_v = std::is_same_v::register_type, + typename batch::register_type>; - template ::value>> + template >> XSIMD_INLINE void maskstore(float* mem, batch_bool const& mask, batch const& src) noexcept { _mm256_maskstore_ps(mem, _mm256_castps_si256(mask), src); } - template ::value>> + template >> XSIMD_INLINE void maskstore(double* mem, batch_bool const& mask, batch const& src) noexcept { _mm256_maskstore_pd(mem, _mm256_castpd_si256(mask), src); @@ -1117,7 +1117,7 @@ namespace xsimd } template && detail::uses_vector_mask::value>> + typename = std::enable_if_t && detail::uses_vector_mask_v>> XSIMD_INLINE void store_masked(T* mem, batch const& src, batch_bool_constant mask, Mode, requires_arch) noexcept { constexpr size_t half_size = batch::size / 2; diff --git a/include/xsimd/arch/xsimd_avx512f.hpp b/include/xsimd/arch/xsimd_avx512f.hpp index 97e1a4049..658b7d448 100644 --- a/include/xsimd/arch/xsimd_avx512f.hpp +++ b/include/xsimd/arch/xsimd_avx512f.hpp @@ -2669,6 +2669,9 @@ namespace xsimd { }; + template + inline constexpr bool is_pair_of_contiguous_indices_v = is_pair_of_contiguous_indices::value; + template XSIMD_INLINE batch swizzle(batch const& self, batch_constant mask, requires_arch) noexcept { - if constexpr (detail::is_pair_of_contiguous_indices::value) + if constexpr (detail::is_pair_of_contiguous_indices_v) { constexpr typename detail::fold_batch_constant::type mask32; return _mm512_permutexvar_epi32(static_cast>(mask32), self); diff --git a/include/xsimd/arch/xsimd_common_fwd.hpp b/include/xsimd/arch/xsimd_common_fwd.hpp index 795319f1e..b247b2bd6 100644 --- a/include/xsimd/arch/xsimd_common_fwd.hpp +++ b/include/xsimd/arch/xsimd_common_fwd.hpp @@ -42,6 +42,9 @@ namespace xsimd { template struct has_simd_register; + + template + inline constexpr bool has_simd_register_v = has_simd_register::value; } namespace kernel diff --git a/include/xsimd/arch/xsimd_emulated.hpp b/include/xsimd/arch/xsimd_emulated.hpp index 4426c543f..e2cd04c91 100644 --- a/include/xsimd/arch/xsimd_emulated.hpp +++ b/include/xsimd/arch/xsimd_emulated.hpp @@ -431,7 +431,7 @@ namespace xsimd } // isnan - template ::size, class = std::enable_if_t::value>> + template ::size, class = std::enable_if_t>> 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 4c25e9c8a..c0aff00bb 100644 --- a/include/xsimd/arch/xsimd_neon.hpp +++ b/include/xsimd/arch/xsimd_neon.hpp @@ -39,12 +39,12 @@ namespace xsimd **************************************/ template - using enable_neon_type_t = std::enable_if_t::value || std::is_same::value, + using enable_neon_type_t = std::enable_if_t || std::is_same_v, int>; template using exclude_int64_neon_t - = std::enable_if_t<(std::is_integral::value && sizeof(T) != 8) || std::is_same::value, int>; + = std::enable_if_t<(std::is_integral_v && sizeof(T) != 8) || std::is_same_v, int>; } /**************** @@ -56,199 +56,199 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint8x16_t x_vreinterpretq(uint8x16_t a) noexcept { return a; } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint8x16_t x_vreinterpretq(int8x16_t a) noexcept { return vreinterpretq_u8_s8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint8x16_t x_vreinterpretq(uint16x8_t a) noexcept { return vreinterpretq_u8_u16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint8x16_t x_vreinterpretq(int16x8_t a) noexcept { return vreinterpretq_u8_s16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint8x16_t x_vreinterpretq(uint32x4_t a) noexcept { return vreinterpretq_u8_u32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint8x16_t x_vreinterpretq(int32x4_t a) noexcept { return vreinterpretq_u8_s32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint8x16_t x_vreinterpretq(uint64x2_t a) noexcept { return vreinterpretq_u8_u64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint8x16_t x_vreinterpretq(int64x2_t a) noexcept { return vreinterpretq_u8_s64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint8x16_t x_vreinterpretq(float32x4_t a) noexcept { return vreinterpretq_u8_f32(a); } // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int8x16_t x_vreinterpretq(uint8x16_t a) noexcept { return vreinterpretq_s8_u8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int8x16_t x_vreinterpretq(int8x16_t a) noexcept { return a; } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int8x16_t x_vreinterpretq(uint16x8_t a) noexcept { return vreinterpretq_s8_u16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int8x16_t x_vreinterpretq(int16x8_t a) noexcept { return vreinterpretq_s8_s16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int8x16_t x_vreinterpretq(uint32x4_t a) noexcept { return vreinterpretq_s8_u32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int8x16_t x_vreinterpretq(int32x4_t a) noexcept { return vreinterpretq_s8_s32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int8x16_t x_vreinterpretq(uint64x2_t a) noexcept { return vreinterpretq_s8_u64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int8x16_t x_vreinterpretq(int64x2_t a) noexcept { return vreinterpretq_s8_s64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int8x16_t x_vreinterpretq(float32x4_t a) noexcept { return vreinterpretq_s8_f32(a); } // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint16x8_t x_vreinterpretq(uint8x16_t a) noexcept { return vreinterpretq_u16_u8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint16x8_t x_vreinterpretq(int8x16_t a) noexcept { return vreinterpretq_u16_s8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint16x8_t x_vreinterpretq(uint16x8_t a) noexcept { return a; } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint16x8_t x_vreinterpretq(int16x8_t a) noexcept { return vreinterpretq_u16_s16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint16x8_t x_vreinterpretq(uint32x4_t a) noexcept { return vreinterpretq_u16_u32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint16x8_t x_vreinterpretq(int32x4_t a) noexcept { return vreinterpretq_u16_s32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint16x8_t x_vreinterpretq(uint64x2_t a) noexcept { return vreinterpretq_u16_u64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint16x8_t x_vreinterpretq(int64x2_t a) noexcept { return vreinterpretq_u16_s64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint16x8_t x_vreinterpretq(float32x4_t a) noexcept { return vreinterpretq_u16_f32(a); } // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int16x8_t x_vreinterpretq(uint8x16_t a) noexcept { return vreinterpretq_s16_u8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int16x8_t x_vreinterpretq(int8x16_t a) noexcept { return vreinterpretq_s16_s8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int16x8_t x_vreinterpretq(uint16x8_t a) noexcept { return vreinterpretq_s16_u16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int16x8_t x_vreinterpretq(int16x8_t a) noexcept { return a; } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int16x8_t x_vreinterpretq(uint32x4_t a) noexcept { return vreinterpretq_s16_u32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int16x8_t x_vreinterpretq(int32x4_t a) noexcept { return vreinterpretq_s16_s32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int16x8_t x_vreinterpretq(uint64x2_t a) noexcept { return vreinterpretq_s16_u64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int16x8_t x_vreinterpretq(int64x2_t a) noexcept { return vreinterpretq_s16_s64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int16x8_t x_vreinterpretq(float32x4_t a) noexcept { return vreinterpretq_s16_f32(a); } // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint32x4_t x_vreinterpretq(uint8x16_t a) noexcept { return vreinterpretq_u32_u8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint32x4_t x_vreinterpretq(int8x16_t a) noexcept { return vreinterpretq_u32_s8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint32x4_t x_vreinterpretq(uint16x8_t a) noexcept { return vreinterpretq_u32_u16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint32x4_t x_vreinterpretq(int16x8_t a) noexcept { return vreinterpretq_u32_s16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint32x4_t x_vreinterpretq(uint32x4_t a) noexcept { return a; } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint32x4_t x_vreinterpretq(int32x4_t a) noexcept { return vreinterpretq_u32_s32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint32x4_t x_vreinterpretq(uint64x2_t a) noexcept { return vreinterpretq_u32_u64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint32x4_t x_vreinterpretq(int64x2_t a) noexcept { return vreinterpretq_u32_s64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint32x4_t x_vreinterpretq(float32x4_t a) noexcept { return vreinterpretq_u32_f32(a); } // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int32x4_t x_vreinterpretq(uint8x16_t a) noexcept { return vreinterpretq_s32_u8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int32x4_t x_vreinterpretq(int8x16_t a) noexcept { return vreinterpretq_s32_s8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int32x4_t x_vreinterpretq(uint16x8_t a) noexcept { return vreinterpretq_s32_u16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int32x4_t x_vreinterpretq(int16x8_t a) noexcept { return vreinterpretq_s32_s16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int32x4_t x_vreinterpretq(uint32x4_t a) noexcept { return vreinterpretq_s32_u32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int32x4_t x_vreinterpretq(int32x4_t a) noexcept { return a; } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int32x4_t x_vreinterpretq(uint64x2_t a) noexcept { return vreinterpretq_s32_u64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int32x4_t x_vreinterpretq(int64x2_t a) noexcept { return vreinterpretq_s32_s64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int32x4_t x_vreinterpretq(float32x4_t a) noexcept { return vreinterpretq_s32_f32(a); } // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint64x2_t x_vreinterpretq(uint8x16_t a) noexcept { return vreinterpretq_u64_u8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint64x2_t x_vreinterpretq(int8x16_t a) noexcept { return vreinterpretq_u64_s8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint64x2_t x_vreinterpretq(uint16x8_t a) noexcept { return vreinterpretq_u64_u16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint64x2_t x_vreinterpretq(int16x8_t a) noexcept { return vreinterpretq_u64_s16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint64x2_t x_vreinterpretq(uint32x4_t a) noexcept { return vreinterpretq_u64_u32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint64x2_t x_vreinterpretq(int32x4_t a) noexcept { return vreinterpretq_u64_s32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint64x2_t x_vreinterpretq(uint64x2_t a) noexcept { return a; } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint64x2_t x_vreinterpretq(int64x2_t a) noexcept { return vreinterpretq_u64_s64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint64x2_t x_vreinterpretq(float32x4_t a) noexcept { return vreinterpretq_u64_f32(a); } // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int64x2_t x_vreinterpretq(uint8x16_t a) noexcept { return vreinterpretq_s64_u8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int64x2_t x_vreinterpretq(int8x16_t a) noexcept { return vreinterpretq_s64_s8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int64x2_t x_vreinterpretq(uint16x8_t a) noexcept { return vreinterpretq_s64_u16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int64x2_t x_vreinterpretq(int16x8_t a) noexcept { return vreinterpretq_s64_s16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int64x2_t x_vreinterpretq(uint32x4_t a) noexcept { return vreinterpretq_s64_u32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int64x2_t x_vreinterpretq(int32x4_t a) noexcept { return vreinterpretq_s64_s32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int64x2_t x_vreinterpretq(uint64x2_t a) noexcept { return vreinterpretq_s64_u64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int64x2_t x_vreinterpretq(int64x2_t a) noexcept { return a; } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int64x2_t x_vreinterpretq(float32x4_t a) noexcept { return vreinterpretq_s64_f32(a); } // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float32x4_t x_vreinterpretq(uint8x16_t a) noexcept { return vreinterpretq_f32_u8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float32x4_t x_vreinterpretq(int8x16_t a) noexcept { return vreinterpretq_f32_s8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float32x4_t x_vreinterpretq(uint16x8_t a) noexcept { return vreinterpretq_f32_u16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float32x4_t x_vreinterpretq(int16x8_t a) noexcept { return vreinterpretq_f32_s16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float32x4_t x_vreinterpretq(uint32x4_t a) noexcept { return vreinterpretq_f32_u32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float32x4_t x_vreinterpretq(int32x4_t a) noexcept { return vreinterpretq_f32_s32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float32x4_t x_vreinterpretq(uint64x2_t a) noexcept { return vreinterpretq_f32_u64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float32x4_t x_vreinterpretq(int64x2_t a) noexcept { return vreinterpretq_f32_s64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float32x4_t x_vreinterpretq(float32x4_t a) noexcept { return a; } } @@ -820,23 +820,23 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vaddq(uint8x16_t a, uint8x16_t b) noexcept { return vaddq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_vaddq(int8x16_t a, int8x16_t b) noexcept { return vaddq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vaddq(uint16x8_t a, uint16x8_t b) noexcept { return vaddq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_vaddq(int16x8_t a, int16x8_t b) noexcept { return vaddq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vaddq(uint32x4_t a, uint32x4_t b) noexcept { return vaddq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_vaddq(int32x4_t a, int32x4_t b) noexcept { return vaddq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint64x2_t x_vaddq(uint64x2_t a, uint64x2_t b) noexcept { return vaddq_u64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int64x2_t x_vaddq(int64x2_t a, int64x2_t b) noexcept { return vaddq_s64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_vaddq(float32x4_t a, float32x4_t b) noexcept { return vaddq_f32(a, b); } } @@ -856,15 +856,15 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vhaddq(uint8x16_t a, uint8x16_t b) noexcept { return vhaddq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vhaddq(uint16x8_t a, uint16x8_t b) noexcept { return vhaddq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vhaddq(uint32x4_t a, uint32x4_t b) noexcept { return vhaddq_u32(a, b); } } - template ::value && sizeof(T) != 8)>> + template && sizeof(T) != 8)>> XSIMD_INLINE batch avg(batch const& lhs, batch const& rhs, requires_arch) noexcept { using register_type = typename batch::register_type; @@ -880,15 +880,15 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vrhaddq(uint8x16_t a, uint8x16_t b) noexcept { return vrhaddq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vrhaddq(uint16x8_t a, uint16x8_t b) noexcept { return vrhaddq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vrhaddq(uint32x4_t a, uint32x4_t b) noexcept { return vrhaddq_u32(a, b); } } - template ::value && sizeof(T) != 8)>> + template && sizeof(T) != 8)>> XSIMD_INLINE batch avgr(batch const& lhs, batch const& rhs, requires_arch) noexcept { using register_type = typename batch::register_type; @@ -904,23 +904,23 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vqaddq(uint8x16_t a, uint8x16_t b) noexcept { return vqaddq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_vqaddq(int8x16_t a, int8x16_t b) noexcept { return vqaddq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vqaddq(uint16x8_t a, uint16x8_t b) noexcept { return vqaddq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_vqaddq(int16x8_t a, int16x8_t b) noexcept { return vqaddq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vqaddq(uint32x4_t a, uint32x4_t b) noexcept { return vqaddq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_vqaddq(int32x4_t a, int32x4_t b) noexcept { return vqaddq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint64x2_t x_vqaddq(uint64x2_t a, uint64x2_t b) noexcept { return vqaddq_u64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int64x2_t x_vqaddq(int64x2_t a, int64x2_t b) noexcept { return vqaddq_s64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_vqaddq(float32x4_t a, float32x4_t b) noexcept { return vaddq_f32(a, b); } } @@ -940,23 +940,23 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vsubq(uint8x16_t a, uint8x16_t b) noexcept { return vsubq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_vsubq(int8x16_t a, int8x16_t b) noexcept { return vsubq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vsubq(uint16x8_t a, uint16x8_t b) noexcept { return vsubq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_vsubq(int16x8_t a, int16x8_t b) noexcept { return vsubq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vsubq(uint32x4_t a, uint32x4_t b) noexcept { return vsubq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_vsubq(int32x4_t a, int32x4_t b) noexcept { return vsubq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint64x2_t x_vsubq(uint64x2_t a, uint64x2_t b) noexcept { return vsubq_u64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int64x2_t x_vsubq(int64x2_t a, int64x2_t b) noexcept { return vsubq_s64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_vsubq(float32x4_t a, float32x4_t b) noexcept { return vsubq_f32(a, b); } } @@ -976,23 +976,23 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vqsubq(uint8x16_t a, uint8x16_t b) noexcept { return vqsubq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_vqsubq(int8x16_t a, int8x16_t b) noexcept { return vqsubq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vqsubq(uint16x8_t a, uint16x8_t b) noexcept { return vqsubq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_vqsubq(int16x8_t a, int16x8_t b) noexcept { return vqsubq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vqsubq(uint32x4_t a, uint32x4_t b) noexcept { return vqsubq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_vqsubq(int32x4_t a, int32x4_t b) noexcept { return vqsubq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint64x2_t x_vqsubq(uint64x2_t a, uint64x2_t b) noexcept { return vqsubq_u64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int64x2_t x_vqsubq(int64x2_t a, int64x2_t b) noexcept { return vqsubq_s64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_vqsubq(float32x4_t a, float32x4_t b) noexcept { return vsubq_f32(a, b); } } @@ -1012,19 +1012,19 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vmulq(uint8x16_t a, uint8x16_t b) noexcept { return vmulq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_vmulq(int8x16_t a, int8x16_t b) noexcept { return vmulq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vmulq(uint16x8_t a, uint16x8_t b) noexcept { return vmulq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_vmulq(int16x8_t a, int16x8_t b) noexcept { return vmulq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vmulq(uint32x4_t a, uint32x4_t b) noexcept { return vmulq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_vmulq(int32x4_t a, int32x4_t b) noexcept { return vmulq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_vmulq(float32x4_t a, float32x4_t b) noexcept { return vmulq_f32(a, b); } } @@ -1186,19 +1186,19 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vceqq(uint8x16_t a, uint8x16_t b) noexcept { return vceqq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vceqq(int8x16_t a, int8x16_t b) noexcept { return vceqq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vceqq(uint16x8_t a, uint16x8_t b) noexcept { return vceqq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vceqq(int16x8_t a, int16x8_t b) noexcept { return vceqq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vceqq(uint32x4_t a, uint32x4_t b) noexcept { return vceqq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vceqq(int32x4_t a, int32x4_t b) noexcept { return vceqq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vceqq(float32x4_t a, float32x4_t b) noexcept { return vceqq_f32(a, b); } } @@ -1281,19 +1281,19 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vcltq(uint8x16_t a, uint8x16_t b) noexcept { return vcltq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vcltq(int8x16_t a, int8x16_t b) noexcept { return vcltq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vcltq(uint16x8_t a, uint16x8_t b) noexcept { return vcltq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vcltq(int16x8_t a, int16x8_t b) noexcept { return vcltq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vcltq(uint32x4_t a, uint32x4_t b) noexcept { return vcltq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vcltq(int32x4_t a, int32x4_t b) noexcept { return vcltq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vcltq(float32x4_t a, float32x4_t b) noexcept { return vcltq_f32(a, b); } } @@ -1328,19 +1328,19 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vcleq(uint8x16_t a, uint8x16_t b) noexcept { return vcleq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vcleq(int8x16_t a, int8x16_t b) noexcept { return vcleq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vcleq(uint16x8_t a, uint16x8_t b) noexcept { return vcleq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vcleq(int16x8_t a, int16x8_t b) noexcept { return vcleq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vcleq(uint32x4_t a, uint32x4_t b) noexcept { return vcleq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vcleq(int32x4_t a, int32x4_t b) noexcept { return vcleq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vcleq(float32x4_t a, float32x4_t b) noexcept { return vcleq_f32(a, b); } } @@ -1366,19 +1366,19 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vcgtq(uint8x16_t a, uint8x16_t b) noexcept { return vcgtq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vcgtq(int8x16_t a, int8x16_t b) noexcept { return vcgtq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vcgtq(uint16x8_t a, uint16x8_t b) noexcept { return vcgtq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vcgtq(int16x8_t a, int16x8_t b) noexcept { return vcgtq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vcgtq(uint32x4_t a, uint32x4_t b) noexcept { return vcgtq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vcgtq(int32x4_t a, int32x4_t b) noexcept { return vcgtq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vcgtq(float32x4_t a, float32x4_t b) noexcept { return vcgtq_f32(a, b); } } @@ -1413,19 +1413,19 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vcgeq(uint8x16_t a, uint8x16_t b) noexcept { return vcgeq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vcgeq(int8x16_t a, int8x16_t b) noexcept { return vcgeq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vcgeq(uint16x8_t a, uint16x8_t b) noexcept { return vcgeq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vcgeq(int16x8_t a, int16x8_t b) noexcept { return vcgeq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vcgeq(uint32x4_t a, uint32x4_t b) noexcept { return vcgeq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vcgeq(int32x4_t a, int32x4_t b) noexcept { return vcgeq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vcgeq(float32x4_t a, float32x4_t b) noexcept { return vcgeq_f32(a, b); } } @@ -1462,23 +1462,23 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vandq(uint8x16_t a, uint8x16_t b) noexcept { return vandq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_vandq(int8x16_t a, int8x16_t b) noexcept { return vandq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vandq(uint16x8_t a, uint16x8_t b) noexcept { return vandq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_vandq(int16x8_t a, int16x8_t b) noexcept { return vandq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vandq(uint32x4_t a, uint32x4_t b) noexcept { return vandq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_vandq(int32x4_t a, int32x4_t b) noexcept { return vandq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint64x2_t x_vandq(uint64x2_t a, uint64x2_t b) noexcept { return vandq_u64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int64x2_t x_vandq(int64x2_t a, int64x2_t b) noexcept { return vandq_s64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_vandq(float32x4_t a, float32x4_t b) noexcept { return vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(a), @@ -1509,23 +1509,23 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vorrq(uint8x16_t a, uint8x16_t b) noexcept { return vorrq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_vorrq(int8x16_t a, int8x16_t b) noexcept { return vorrq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vorrq(uint16x8_t a, uint16x8_t b) noexcept { return vorrq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_vorrq(int16x8_t a, int16x8_t b) noexcept { return vorrq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vorrq(uint32x4_t a, uint32x4_t b) noexcept { return vorrq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_vorrq(int32x4_t a, int32x4_t b) noexcept { return vorrq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint64x2_t x_vorrq(uint64x2_t a, uint64x2_t b) noexcept { return vorrq_u64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int64x2_t x_vorrq(int64x2_t a, int64x2_t b) noexcept { return vorrq_s64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_vorrq(float32x4_t a, float32x4_t b) noexcept { return vreinterpretq_f32_u32(vorrq_u32(vreinterpretq_u32_f32(a), @@ -1556,23 +1556,23 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_veorq(uint8x16_t a, uint8x16_t b) noexcept { return veorq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_veorq(int8x16_t a, int8x16_t b) noexcept { return veorq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_veorq(uint16x8_t a, uint16x8_t b) noexcept { return veorq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_veorq(int16x8_t a, int16x8_t b) noexcept { return veorq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_veorq(uint32x4_t a, uint32x4_t b) noexcept { return veorq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_veorq(int32x4_t a, int32x4_t b) noexcept { return veorq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint64x2_t x_veorq(uint64x2_t a, uint64x2_t b) noexcept { return veorq_u64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int64x2_t x_veorq(int64x2_t a, int64x2_t b) noexcept { return veorq_s64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_veorq(float32x4_t a, float32x4_t b) noexcept { return vreinterpretq_f32_u32(veorq_u32(vreinterpretq_u32_f32(a), @@ -1613,29 +1613,29 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vmvnq(uint8x16_t a) noexcept { return vmvnq_u8(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_vmvnq(int8x16_t a) noexcept { return vmvnq_s8(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vmvnq(uint16x8_t a) noexcept { return vmvnq_u16(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_vmvnq(int16x8_t a) noexcept { return vmvnq_s16(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vmvnq(uint32x4_t a) noexcept { return vmvnq_u32(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_vmvnq(int32x4_t a) noexcept { return vmvnq_s32(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint64x2_t x_vmvnq(uint64x2_t a) noexcept { return vreinterpretq_u64_u32(vmvnq_u32(vreinterpretq_u32_u64(a))); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int64x2_t x_vmvnq(int64x2_t a) noexcept { return vreinterpretq_s64_s32(vmvnq_s32(vreinterpretq_s32_s64(a))); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_vmvnq(float32x4_t a) noexcept { return vreinterpretq_f32_u32(vmvnq_u32(vreinterpretq_u32_f32(a))); @@ -1665,23 +1665,23 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vbicq(uint8x16_t a, uint8x16_t b) noexcept { return vbicq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_vbicq(int8x16_t a, int8x16_t b) noexcept { return vbicq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vbicq(uint16x8_t a, uint16x8_t b) noexcept { return vbicq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_vbicq(int16x8_t a, int16x8_t b) noexcept { return vbicq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vbicq(uint32x4_t a, uint32x4_t b) noexcept { return vbicq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_vbicq(int32x4_t a, int32x4_t b) noexcept { return vbicq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint64x2_t x_vbicq(uint64x2_t a, uint64x2_t b) noexcept { return vbicq_u64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int64x2_t x_vbicq(int64x2_t a, int64x2_t b) noexcept { return vbicq_s64(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_vbicq(float32x4_t a, float32x4_t b) noexcept { return vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(a), vreinterpretq_u32_f32(b))); @@ -1711,19 +1711,19 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vminq(uint8x16_t a, uint8x16_t b) noexcept { return vminq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_vminq(int8x16_t a, int8x16_t b) noexcept { return vminq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vminq(uint16x8_t a, uint16x8_t b) noexcept { return vminq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_vminq(int16x8_t a, int16x8_t b) noexcept { return vminq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vminq(uint32x4_t a, uint32x4_t b) noexcept { return vminq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_vminq(int32x4_t a, int32x4_t b) noexcept { return vminq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_vminq(float32x4_t a, float32x4_t b) noexcept { return vminq_f32(a, b); } } @@ -1749,19 +1749,19 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vmaxq(uint8x16_t a, uint8x16_t b) noexcept { return vmaxq_u8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_vmaxq(int8x16_t a, int8x16_t b) noexcept { return vmaxq_s8(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vmaxq(uint16x8_t a, uint16x8_t b) noexcept { return vmaxq_u16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_vmaxq(int16x8_t a, int16x8_t b) noexcept { return vmaxq_s16(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vmaxq(uint32x4_t a, uint32x4_t b) noexcept { return vmaxq_u32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_vmaxq(int32x4_t a, int32x4_t b) noexcept { return vmaxq_s32(a, b); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_vmaxq(float32x4_t a, float32x4_t b) noexcept { return vmaxq_f32(a, b); } } @@ -1787,19 +1787,19 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vabsq(uint8x16_t a) noexcept { return a; } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_vabsq(int8x16_t a) noexcept { return vabsq_s8(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vabsq(uint16x8_t a) noexcept { return a; } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_vabsq(int16x8_t a) noexcept { return vabsq_s16(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vabsq(uint32x4_t a) noexcept { return a; } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_vabsq(int32x4_t a) noexcept { return vabsq_s32(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_vabsq(float32x4_t a) noexcept { return vabsq_f32(a); } } @@ -2132,23 +2132,23 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_vbslq(uint8x16_t a, uint8x16_t b, uint8x16_t c) noexcept { return vbslq_u8(a, b, c); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_vbslq(uint8x16_t a, int8x16_t b, int8x16_t c) noexcept { return vbslq_s8(a, b, c); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_vbslq(uint16x8_t a, uint16x8_t b, uint16x8_t c) noexcept { return vbslq_u16(a, b, c); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_vbslq(uint16x8_t a, int16x8_t b, int16x8_t c) noexcept { return vbslq_s16(a, b, c); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_vbslq(uint32x4_t a, uint32x4_t b, uint32x4_t c) noexcept { return vbslq_u32(a, b, c); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_vbslq(uint32x4_t a, int32x4_t b, int32x4_t c) noexcept { return vbslq_s32(a, b, c); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint64x2_t x_vbslq(uint64x2_t a, uint64x2_t b, uint64x2_t c) noexcept { return vbslq_u64(a, b, c); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int64x2_t x_vbslq(uint64x2_t a, int64x2_t b, int64x2_t c) noexcept { return vbslq_s64(a, b, c); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_vbslq(uint32x4_t a, float32x4_t b, float32x4_t c) noexcept { return vbslq_f32(a, b, c); } } @@ -3263,23 +3263,23 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8x16_t x_rotate_left(uint8x16_t a, uint8x16_t b) noexcept { return vextq_u8(a, b, N); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8x16_t x_rotate_left(int8x16_t a, int8x16_t b) noexcept { return vextq_s8(a, b, N); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16x8_t x_rotate_left(uint16x8_t a, uint16x8_t b) noexcept { return vextq_u16(a, b, N % 8); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16x8_t x_rotate_left(int16x8_t a, int16x8_t b) noexcept { return vextq_s16(a, b, N % 8); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32x4_t x_rotate_left(uint32x4_t a, uint32x4_t b) noexcept { return vextq_u32(a, b, N % 4); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32x4_t x_rotate_left(int32x4_t a, int32x4_t b) noexcept { return vextq_s32(a, b, N % 4); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint64x2_t x_rotate_left(uint64x2_t a, uint64x2_t b) noexcept { return vextq_u64(a, b, N % 2); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int64x2_t x_rotate_left(int64x2_t a, int64x2_t b) noexcept { return vextq_s64(a, b, N % 2); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float32x4_t x_rotate_left(float32x4_t a, float32x4_t b) noexcept { return vextq_f32(a, b, N % 4); } } diff --git a/include/xsimd/arch/xsimd_neon64.hpp b/include/xsimd/arch/xsimd_neon64.hpp index 3238cad5f..809ef8fa5 100644 --- a/include/xsimd/arch/xsimd_neon64.hpp +++ b/include/xsimd/arch/xsimd_neon64.hpp @@ -35,7 +35,7 @@ namespace xsimd { template - using enable_neon64_type_t = std::enable_if_t::value || std::is_same::value || std::is_same::value, + using enable_neon64_type_t = std::enable_if_t || std::is_same_v || std::is_same_v, int>; } @@ -201,7 +201,7 @@ namespace xsimd : "memory"); } - template ::value, void>::type> + template , void>> XSIMD_INLINE void store_stream(T* mem, batch const& val, requires_arch) noexcept { uint64x2_t u64; @@ -242,7 +242,7 @@ namespace xsimd return vcombine_f64(lo, hi); } - template ::value, void>::type> + template , void>> XSIMD_INLINE batch load_stream(T const* mem, convert, requires_arch) noexcept { uint64x1_t lo, hi; @@ -897,25 +897,25 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8_t x_vaddvq(uint8x16_t a) noexcept { return vaddvq_u8(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8_t x_vaddvq(int8x16_t a) noexcept { return vaddvq_s8(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16_t x_vaddvq(uint16x8_t a) noexcept { return vaddvq_u16(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16_t x_vaddvq(int16x8_t a) noexcept { return vaddvq_s16(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32_t x_vaddvq(uint32x4_t a) noexcept { return vaddvq_u32(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32_t x_vaddvq(int32x4_t a) noexcept { return vaddvq_s32(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint64_t x_vaddvq(uint64x2_t a) noexcept { return vaddvq_u64(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int64_t x_vaddvq(int64x2_t a) noexcept { return vaddvq_s64(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float x_vaddvq(float32x4_t a) noexcept { return vaddvq_f32(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE double x_vaddvq(float64x2_t a) noexcept { return vaddvq_f64(a); } } @@ -935,29 +935,29 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8_t x_vmaxvq(uint8x16_t a) noexcept { return vmaxvq_u8(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8_t x_vmaxvq(int8x16_t a) noexcept { return vmaxvq_s8(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16_t x_vmaxvq(uint16x8_t a) noexcept { return vmaxvq_u16(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16_t x_vmaxvq(int16x8_t a) noexcept { return vmaxvq_s16(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32_t x_vmaxvq(uint32x4_t a) noexcept { return vmaxvq_u32(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32_t x_vmaxvq(int32x4_t a) noexcept { return vmaxvq_s32(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float x_vmaxvq(float32x4_t a) noexcept { return vmaxvq_f32(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE double x_vmaxvq(float64x2_t a) noexcept { return vmaxvq_f64(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint64_t x_vmaxvq(uint64x2_t a) noexcept { return std::max(vdupd_laneq_u64(a, 0), vdupd_laneq_u64(a, 1)); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int64_t x_vmaxvq(int64x2_t a) noexcept { return std::max(vdupd_laneq_s64(a, 0), vdupd_laneq_s64(a, 1)); @@ -980,29 +980,29 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint8_t x_vminvq(uint8x16_t a) noexcept { return vminvq_u8(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int8_t x_vminvq(int8x16_t a) noexcept { return vminvq_s8(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint16_t x_vminvq(uint16x8_t a) noexcept { return vminvq_u16(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int16_t x_vminvq(int16x8_t a) noexcept { return vminvq_s16(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint32_t x_vminvq(uint32x4_t a) noexcept { return vminvq_u32(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int32_t x_vminvq(int32x4_t a) noexcept { return vminvq_s32(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE float x_vminvq(float32x4_t a) noexcept { return vminvq_f32(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE double x_vminvq(float64x2_t a) noexcept { return vminvq_f64(a); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE uint64_t x_vminvq(uint64x2_t a) noexcept { return std::min(vdupd_laneq_u64(a, 0), vdupd_laneq_u64(a, 1)); } - template ::value, int> = 0> + template , int> = 0> XSIMD_INLINE int64_t x_vminvq(int64x2_t a) noexcept { return std::min(vdupd_laneq_s64(a, 0), vdupd_laneq_s64(a, 1)); @@ -1260,49 +1260,48 @@ namespace xsimd // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float64x2_t x_vreinterpretq(uint8x16_t a) noexcept { return vreinterpretq_f64_u8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float64x2_t x_vreinterpretq(int8x16_t a) noexcept { return vreinterpretq_f64_s8(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float64x2_t x_vreinterpretq(uint16x8_t a) noexcept { return vreinterpretq_f64_u16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float64x2_t x_vreinterpretq(int16x8_t a) noexcept { return vreinterpretq_f64_s16(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float64x2_t x_vreinterpretq(uint32x4_t a) noexcept { return vreinterpretq_f64_u32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float64x2_t x_vreinterpretq(int32x4_t a) noexcept { return vreinterpretq_f64_s32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float64x2_t x_vreinterpretq(uint64x2_t a) noexcept { return vreinterpretq_f64_u64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float64x2_t x_vreinterpretq(int64x2_t a) noexcept { return vreinterpretq_f64_s64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float64x2_t x_vreinterpretq(float32x4_t a) noexcept { return vreinterpretq_f64_f32(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float64x2_t x_vreinterpretq(float64x2_t a) noexcept { return a; } // TODO(c++17): Make a single function with if constexpr switch // Templating on the scalar type `T` is required because in some compilers (e.g. MSVC) // the vector types are all aliases of the same type. - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint8x16_t x_vreinterpretq(float64x2_t a) noexcept { return vreinterpretq_u8_f64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int8x16_t x_vreinterpretq(float64x2_t a) noexcept { return vreinterpretq_s8_f64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint16x8_t x_vreinterpretq(float64x2_t a) noexcept { return vreinterpretq_u16_f64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int16x8_t x_vreinterpretq(float64x2_t a) noexcept { return vreinterpretq_s16_f64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint32x4_t x_vreinterpretq(float64x2_t a) noexcept { return vreinterpretq_u32_f64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int32x4_t x_vreinterpretq(float64x2_t a) noexcept { return vreinterpretq_s32_f64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE uint64x2_t x_vreinterpretq(float64x2_t a) noexcept { return vreinterpretq_u64_f64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE int64x2_t x_vreinterpretq(float64x2_t a) noexcept { return vreinterpretq_s64_f64(a); } - template ::value && std::is_same::value, int> = 0> + template && std::is_same_v, int> = 0> XSIMD_INLINE float32x4_t x_vreinterpretq(float64x2_t a) noexcept { return vreinterpretq_f32_f64(a); } - } template diff --git a/include/xsimd/arch/xsimd_rvv.hpp b/include/xsimd/arch/xsimd_rvv.hpp index 3f6419187..01304b1f5 100644 --- a/include/xsimd/arch/xsimd_rvv.hpp +++ b/include/xsimd/arch/xsimd_rvv.hpp @@ -687,7 +687,7 @@ namespace xsimd } // mul_hi - template ::value, int>::type = 0> + template , int>::type = 0> XSIMD_INLINE batch mul_hi(batch const& lhs, batch const& rhs, requires_arch) noexcept { return detail_rvv::rvvmulh(lhs, rhs); @@ -1251,9 +1251,9 @@ namespace xsimd XSIMD_RVV_OVERLOAD_INTS(rvvfcvt_f, (__riscv_vfcvt_f), , fvec(vec)) template - using rvv_enable_ftoi_t = std::enable_if_t<(sizeof(T) == sizeof(U) && std::is_floating_point::value && !std::is_floating_point::value), int>; + using rvv_enable_ftoi_t = std::enable_if_t<(sizeof(T) == sizeof(U) && std::is_floating_point_v && !std::is_floating_point_v), int>; template - using rvv_enable_itof_t = std::enable_if_t<(sizeof(T) == sizeof(U) && !std::is_floating_point::value && std::is_floating_point::value), int>; + using rvv_enable_itof_t = std::enable_if_t<(sizeof(T) == sizeof(U) && !std::is_floating_point_v && std::is_floating_point_v), int>; template = 0> XSIMD_INLINE batch fast_cast(batch const& arg, batch const&, requires_arch) noexcept diff --git a/include/xsimd/arch/xsimd_scalar.hpp b/include/xsimd/arch/xsimd_scalar.hpp index e3c18bb0d..4802cb4eb 100644 --- a/include/xsimd/arch/xsimd_scalar.hpp +++ b/include/xsimd/arch/xsimd_scalar.hpp @@ -105,42 +105,42 @@ namespace xsimd // Windows defines catch all templates template - XSIMD_INLINE std::enable_if_t::value, bool> + XSIMD_INLINE std::enable_if_t, bool> isfinite(T var) noexcept { return std::isfinite(var); } template - XSIMD_INLINE std::enable_if_t::value, bool> + XSIMD_INLINE std::enable_if_t, bool> isfinite(T var) noexcept { return isfinite(double(var)); } template - XSIMD_INLINE std::enable_if_t::value, bool> + XSIMD_INLINE std::enable_if_t, bool> isinf(T var) noexcept { return std::isinf(var); } template - XSIMD_INLINE std::enable_if_t::value, bool> + XSIMD_INLINE std::enable_if_t, bool> isinf(T var) noexcept { return isinf(double(var)); } template - XSIMD_INLINE std::enable_if_t::value, bool> + XSIMD_INLINE std::enable_if_t, bool> isnan(T var) noexcept { return std::isnan(var); } template - XSIMD_INLINE std::enable_if_t::value, bool> + XSIMD_INLINE std::enable_if_t, bool> isnan(T var) noexcept { return isnan(double(var)); @@ -606,7 +606,7 @@ namespace xsimd return __builtin_exp10(x); } #elif defined(_WIN32) - template ::value>> + template >> XSIMD_INLINE T exp10(const T& x) noexcept { // Very inefficient but other implementations give incorrect results diff --git a/include/xsimd/arch/xsimd_sve.hpp b/include/xsimd/arch/xsimd_sve.hpp index d486c7e36..d47525c8e 100644 --- a/include/xsimd/arch/xsimd_sve.hpp +++ b/include/xsimd/arch/xsimd_sve.hpp @@ -60,7 +60,7 @@ namespace xsimd // enable for signed integers or floating points template - using enable_signed_int_or_floating_point_t = std::enable_if_t::value, int>; + using enable_signed_int_or_floating_point_t = std::enable_if_t, int>; // `sizeless` is the matching sizeless SVE type. xsimd stores SVE // vectors as fixed-size attributed types (arm_sve_vector_bits), @@ -96,7 +96,7 @@ namespace xsimd // partial ordering (else ambiguous with requires_arch). template = 0, - std::enable_if_t::value && (sizeof(T) == 4 || sizeof(T) == 8)), int> = 0> + std::enable_if_t && (sizeof(T) == 4 || sizeof(T) == 8)), int> = 0> XSIMD_INLINE batch load_masked(T const* mem, batch_bool_constant mask, convert, Mode m, requires_arch) noexcept { return load_masked(mem, mask.as_batch_bool(), convert {}, m, sve {}); @@ -147,7 +147,7 @@ namespace xsimd // 32/64-bit integers to defer to the common dispatchers. template = 0, - std::enable_if_t::value && (sizeof(T) == 4 || sizeof(T) == 8)), int> = 0> + std::enable_if_t && (sizeof(T) == 4 || sizeof(T) == 8)), int> = 0> XSIMD_INLINE void store_masked(T* mem, batch const& src, batch_bool_constant mask, Mode m, requires_arch) noexcept { store_masked(mem, src, mask.as_batch_bool(), m, sve {}); @@ -313,7 +313,7 @@ namespace xsimd } // mul_hi - template ::value, int>::type = 0> + template , int>::type = 0> XSIMD_INLINE batch mul_hi(batch const& lhs, batch const& rhs, requires_arch) noexcept { return svmulh_x(detail_sve::ptrue(), lhs, rhs); diff --git a/include/xsimd/arch/xsimd_vsx.hpp b/include/xsimd/arch/xsimd_vsx.hpp index 202cd6be5..6fb8a2ef7 100644 --- a/include/xsimd/arch/xsimd_vsx.hpp +++ b/include/xsimd/arch/xsimd_vsx.hpp @@ -59,7 +59,7 @@ namespace xsimd template <> struct builtin_scalar { - using type = typename std::conditional::value, signed char, unsigned char>::type; + using type = typename std::conditional, signed char, unsigned char>::type; }; template @@ -84,28 +84,28 @@ namespace xsimd } // add - template ::value>> + template >> XSIMD_INLINE batch add(batch const& self, batch const& other, requires_arch) noexcept { return vec_add(self.data, other.data); } // all - template ::value>> + template >> 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>> + template >> 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>> + template && sizeof(T) < 8>> XSIMD_INLINE batch avgr(batch const& self, batch const& other, requires_arch) noexcept { return vec_avg(self.data, other.data); @@ -122,7 +122,7 @@ namespace xsimd } // avg - template ::value>> + template >> XSIMD_INLINE batch avg(batch const& self, batch const& other, requires_arch) noexcept { if constexpr (sizeof(T) < 8) @@ -155,31 +155,31 @@ namespace xsimd } // bitwise_and - template ::value>> + template >> XSIMD_INLINE batch bitwise_and(batch const& self, batch const& other, requires_arch) noexcept { return vec_and(self.data, other.data); } - template ::value>> + template >> 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>> + template >> 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>> + template >> 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>> + template >> XSIMD_INLINE batch bitwise_lshift(batch const& self, int32_t other, requires_arch) noexcept { using shift_type = as_unsigned_integer_t; @@ -188,36 +188,36 @@ namespace xsimd } // bitwise_not - template ::value>> + template >> XSIMD_INLINE batch bitwise_not(batch const& self, requires_arch) noexcept { return vec_nor(self.data, self.data); } - template ::value>> + template >> XSIMD_INLINE batch_bool bitwise_not(batch_bool const& self, requires_arch) noexcept { return vec_nor(self.data, self.data); } // bitwise_or - template ::value>> + template >> XSIMD_INLINE batch bitwise_or(batch const& self, batch const& other, requires_arch) noexcept { return vec_or(self.data, other.data); } - template ::value>> + template >> 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>> + template >> XSIMD_INLINE batch bitwise_rshift(batch const& self, int32_t other, requires_arch) noexcept { using shift_type = as_unsigned_integer_t; batch shift(static_cast(other)); - if constexpr (std::is_signed::value) + if constexpr (std::is_signed_v) { return vec_sra(self.data, shift.data); } @@ -228,12 +228,12 @@ namespace xsimd } // bitwise_xor - template ::value>> + template >> XSIMD_INLINE batch bitwise_xor(batch const& self, batch const& other, requires_arch) noexcept { return vec_xor(self.data, other.data); } - template ::value>> + template >> XSIMD_INLINE batch_bool bitwise_xor(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return vec_xor(self.data, other.data); @@ -247,14 +247,14 @@ namespace xsimd } // broadcast - template ::value>> + template >> XSIMD_INLINE batch broadcast(T val, requires_arch) noexcept { return vec_splats(static_cast>(val)); } // ceil - template ::value>> + template >> XSIMD_INLINE batch ceil(batch const& self, requires_arch) noexcept { return vec_ceil(self.data); @@ -288,7 +288,7 @@ namespace xsimd } // decr_if - template ::value>> + template >> XSIMD_INLINE batch decr_if(batch const& self, batch_bool const& mask, requires_arch) noexcept { return self + batch((typename batch::register_type)mask.data); @@ -360,13 +360,13 @@ namespace xsimd } // eq - template ::value>> + template >> 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>> + template >> XSIMD_INLINE batch_bool eq(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { auto res = vec_cmpeq(self.data, other.data); @@ -374,28 +374,28 @@ namespace xsimd } // first - template ::value>> + template >> XSIMD_INLINE T first(batch const& self, requires_arch) noexcept { return vec_extract(self.data, 0); } // floor - template ::value>> + template >> XSIMD_INLINE batch floor(batch const& self, requires_arch) noexcept { return vec_floor(self.data); } // ge - template ::value>> + template >> XSIMD_INLINE batch_bool ge(batch const& self, batch const& other, requires_arch) noexcept { return vec_cmpge(self.data, other.data); } // gt - template ::value>> + template >> XSIMD_INLINE batch_bool gt(batch const& self, batch const& other, requires_arch) noexcept { return vec_cmpgt(self.data, other.data); @@ -428,14 +428,14 @@ namespace xsimd } // incr_if - template ::value>> + template >> 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>> + template >> XSIMD_INLINE batch insert(batch const& self, T val, index, requires_arch) noexcept { return vec_insert(val, self.data, I); @@ -454,14 +454,14 @@ namespace xsimd } // load_unaligned - template ::value>> + template >> XSIMD_INLINE batch load_unaligned(T const* mem, convert, requires_arch) noexcept { return (typename batch::register_type)vec_xl(0, (builtin_t*)mem); } // load_aligned - template ::value>> + template >> XSIMD_INLINE batch load_aligned(T const* mem, convert, requires_arch) noexcept { return load_unaligned(mem, kernel::convert {}, vsx {}); @@ -485,54 +485,54 @@ namespace xsimd } // le - template ::value>> + template >> XSIMD_INLINE batch_bool le(batch const& self, batch const& other, requires_arch) noexcept { return vec_cmple(self.data, other.data); } // lt - template ::value>> + template >> XSIMD_INLINE batch_bool lt(batch const& self, batch const& other, requires_arch) noexcept { return vec_cmplt(self.data, other.data); } // max - template ::value>> + template >> XSIMD_INLINE batch max(batch const& self, batch const& other, requires_arch) noexcept { return vec_max(self.data, other.data); } // min - template ::value>> + template >> XSIMD_INLINE batch min(batch const& self, batch const& other, requires_arch) noexcept { return vec_min(self.data, other.data); } // mul - template ::value>> + template >> XSIMD_INLINE batch mul(batch const& self, batch const& other, requires_arch) noexcept { return self.data * other.data; } // neg - template ::value>> + template >> XSIMD_INLINE batch neg(batch const& self, requires_arch) noexcept { return -(self.data); } // neq - template ::value>> + template >> XSIMD_INLINE batch_bool neq(batch const& self, batch const& other, requires_arch) noexcept { return ~vec_cmpeq(self.data, other.data); } - template ::value>> + template >> XSIMD_INLINE batch_bool neq(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return ~vec_cmpeq(self.data, other.data); @@ -588,7 +588,7 @@ namespace xsimd auto tmp1 = vec_add(self.data, tmp0); // v0 + v1, v1 + v0 return vec_extract(tmp1, 0); } - template ::value>> + template >> XSIMD_INLINE T reduce_add(batch const& self, requires_arch) noexcept { return reduce_add(self, common {}); @@ -630,7 +630,7 @@ namespace xsimd auto tmp1 = vec_mul(self.data, tmp0); // v0 * v1, v1 * v0 return vec_extract(tmp1, 0); } - template ::value>> + template >> XSIMD_INLINE T reduce_mul(batch const& self, requires_arch) noexcept { return reduce_mul(self, common {}); @@ -666,12 +666,12 @@ namespace xsimd } // select - template ::value>> + template >> 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>> + template >> 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 {}); @@ -757,7 +757,7 @@ namespace xsimd } // sadd - template ::value && sizeof(T) != 8>> + template && sizeof(T) != 8>> XSIMD_INLINE batch sadd(batch const& self, batch const& other, requires_arch) noexcept { return vec_adds(self.data, other.data); @@ -771,7 +771,7 @@ namespace xsimd return typename batch::register_type { values... }; } - template ::value>> + template >> XSIMD_INLINE batch_bool set(batch_bool const&, requires_arch, Values... values) noexcept { static_assert(sizeof...(Values) == batch_bool::size, "consistent init"); @@ -780,28 +780,28 @@ namespace xsimd // ssub - template ::value && sizeof(T) == 1>> + template && sizeof(T) == 1>> XSIMD_INLINE batch ssub(batch const& self, batch const& other, requires_arch) noexcept { return vec_subs(self.data, other.data); } // store_aligned - template ::value>> + template >> XSIMD_INLINE void store_aligned(T* mem, batch const& self, requires_arch) noexcept { vec_xst((typename batch::register_type)self.data, 0, (builtin_t*)mem); } // store_unaligned - template ::value>> + template >> XSIMD_INLINE void store_unaligned(T* mem, batch const& self, requires_arch) noexcept { store_aligned(mem, self, vsx {}); } // sub - template ::value>> + template >> XSIMD_INLINE batch sub(batch const& self, batch const& other, requires_arch) noexcept { return vec_sub(self.data, other.data); @@ -909,7 +909,7 @@ namespace xsimd } // trunc - template ::value>> + template >> XSIMD_INLINE batch trunc(batch const& self, requires_arch) noexcept { return vec_trunc(self.data); @@ -921,7 +921,7 @@ namespace xsimd { return { batch(vec_doublel(x.data)), batch(vec_doubleh(x.data)) }; } - template ::value>> + template >> XSIMD_INLINE std::array, A>, 2> widen(batch const& x, requires_arch) noexcept { auto even = vec_mule(x.data, vec_splats(T(1))); // x0, x2, x4, x6 @@ -930,14 +930,14 @@ namespace xsimd } // zip_hi - template ::value>> + template >> 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>> + template >> 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_vxe.hpp b/include/xsimd/arch/xsimd_vxe.hpp index b1c58730c..e0d342691 100644 --- a/include/xsimd/arch/xsimd_vxe.hpp +++ b/include/xsimd/arch/xsimd_vxe.hpp @@ -60,7 +60,7 @@ namespace xsimd template <> struct builtin_scalar { - using type = typename std::conditional::value, signed char, unsigned char>::type; + using type = typename std::conditional, signed char, unsigned char>::type; }; template @@ -83,14 +83,14 @@ namespace xsimd // load // load_unaligned - template ::value>> + template >> XSIMD_INLINE batch load_unaligned(T const* mem, convert, requires_arch) noexcept { return (typename batch::register_type)vec_xl(0, (builtin_t*)mem); } // load_aligned - template ::value>> + template >> XSIMD_INLINE batch load_aligned(T const* mem, convert, requires_arch) noexcept { return load_unaligned(mem, kernel::convert {}, vxe {}); @@ -176,20 +176,20 @@ namespace xsimd return typename batch::register_type { values... }; } - template ::value>> + template >> XSIMD_INLINE batch_bool set(batch_bool const&, requires_arch, Values... values) noexcept { static_assert(sizeof...(Values) == batch_bool::size, "consistent init"); return typename batch_bool::register_type { static_cast::register_type>()[0])>(values ? -1LL : 0LL)... }; } // first - template ::value>> + template >> XSIMD_INLINE T first(batch const& self, requires_arch) noexcept { return self.data[0]; } // insert - template ::value>> + template >> XSIMD_INLINE batch insert(batch const& self, T val, index, requires_arch) noexcept { // vec_insert on float is broken with clang @@ -242,14 +242,14 @@ namespace xsimd } // broadcast - template ::value>> + template >> XSIMD_INLINE batch broadcast(T val, requires_arch) noexcept { return vec_splats(static_cast>(val)); } // abs - template ::value, void>::type> + template , void>::type> XSIMD_INLINE batch abs(batch const& self, requires_arch) noexcept { return vec_abs(self.data); @@ -316,7 +316,7 @@ namespace xsimd } // div - template ::value>> + template >> XSIMD_INLINE batch div(batch const& self, batch const& other, requires_arch) noexcept { return self.data / other.data; @@ -350,7 +350,7 @@ namespace xsimd return ((v1ti)self.data)[0] != 0; } // avgr - template ::value>> + template >> XSIMD_INLINE batch avgr(batch const& self, batch const& other, requires_arch) noexcept { return vec_avg(self.data, other.data); @@ -369,20 +369,20 @@ namespace xsimd return vec_min(self.data, other.data); } // fma - template ::value>> + template >> XSIMD_INLINE batch fma(batch const& x, batch const& y, batch const& z, requires_arch) noexcept { return vec_madd(x.data, y.data, z.data); } // fms - template ::value>> + template >> XSIMD_INLINE batch fms(batch const& x, batch const& y, batch const& z, requires_arch) noexcept { return vec_msub(x.data, y.data, z.data); } // mul - template ::value>> + template >> XSIMD_INLINE batch mul(batch const& self, batch const& other, requires_arch) noexcept { return self.data * other.data; @@ -438,7 +438,7 @@ namespace xsimd v2di sum = (v2di)self.data + shifted; return (int64_t)sum[0]; } - template ::value, void>::type> + template , void>::type> XSIMD_INLINE T reduce_add(batch const& self, requires_arch) noexcept { if constexpr (sizeof(T) == 4) @@ -479,7 +479,7 @@ namespace xsimd { return vec_sel(false_br.data, true_br.data, cond.data); } - template ::value>> + template >> 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, vxe {}); @@ -516,14 +516,14 @@ namespace xsimd } // sqrt - template ::value>> + template >> XSIMD_INLINE batch sqrt(batch const& val, requires_arch) noexcept { return vec_sqrt(val.data); } // rsqrt - template ::value>> + template >> XSIMD_INLINE batch rsqrt(batch const& val, requires_arch) noexcept { return batch(T(1)) / sqrt(val, vxe {}); @@ -722,47 +722,47 @@ namespace xsimd return vec_perm(self.data, self.data, perm); } // zip_hi - template ::value>> + template >> 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>> + template >> XSIMD_INLINE batch zip_lo(batch const& self, batch const& other, requires_arch) noexcept { return vec_mergeh(self.data, other.data); } // bitwise_rshift - template ::value, void>::type> + template , void>::type> XSIMD_INLINE batch bitwise_rshift(batch const& self, int32_t other, requires_arch) noexcept { return self.data >> other; } // bitwise_lshift - template ::value, void>::type> + template , void>::type> XSIMD_INLINE batch bitwise_lshift(batch const& self, int32_t other, requires_arch) noexcept { return self.data << other; } // isnan - template ::value>> + template >> XSIMD_INLINE batch_bool isnan(batch const& self, requires_arch) noexcept { return ~vec_cmpeq(self.data, self.data); } // ceil - template ::value>> + template >> XSIMD_INLINE batch ceil(batch const& self, requires_arch) noexcept { return vec_ceil(self.data); } // floor - template ::value>> + template >> XSIMD_INLINE batch floor(batch const& self, requires_arch) noexcept { return vec_floor(self.data); @@ -770,14 +770,14 @@ namespace xsimd // round // vec_round rounds ties to even instead of zero #if defined __has_builtin && __has_builtin(__builtin_s390_vfi) - template ::value>> + template >> XSIMD_INLINE batch round(batch const& self, requires_arch) noexcept { return __builtin_s390_vfi(self.data, 4, 1); } #endif // trunc - template ::value>> + template >> XSIMD_INLINE batch trunc(batch const& self, requires_arch) noexcept { return vec_trunc(self.data); diff --git a/include/xsimd/arch/xsimd_wasm.hpp b/include/xsimd/arch/xsimd_wasm.hpp index 1271b77fa..87120e307 100644 --- a/include/xsimd/arch/xsimd_wasm.hpp +++ b/include/xsimd/arch/xsimd_wasm.hpp @@ -44,7 +44,7 @@ namespace xsimd XSIMD_INLINE void transpose(batch* matrix_begin, batch* matrix_end, requires_arch) noexcept; // abs - template ::value && std::is_signed::value>> + template && std::is_signed_v>> XSIMD_INLINE batch abs(batch const& self, requires_arch) noexcept { if constexpr (sizeof(T) == 1) @@ -83,7 +83,7 @@ namespace xsimd } // add - template ::value>> + template >> XSIMD_INLINE batch add(batch const& self, batch const& other, requires_arch) noexcept { if constexpr (sizeof(T) == 1) @@ -122,7 +122,7 @@ namespace xsimd } // avgr - template ::value>> + template >> XSIMD_INLINE batch avgr(batch const& self, batch const& other, requires_arch) noexcept { if constexpr (sizeof(T) == 1) @@ -140,7 +140,7 @@ namespace xsimd } // avg - template ::value>> + template >> XSIMD_INLINE batch avg(batch const& self, batch const& other, requires_arch) noexcept { if constexpr (sizeof(T) == 1) @@ -170,7 +170,7 @@ namespace xsimd { return wasm_i64x2_bitmask(self) == 0x03; } - template ::value>> + template >> XSIMD_INLINE bool all(batch_bool const& self, requires_arch) noexcept { return wasm_i8x16_bitmask(self) == 0xFFFF; @@ -187,7 +187,7 @@ namespace xsimd { return wasm_i64x2_bitmask(self) != 0; } - template ::value>> + template >> XSIMD_INLINE bool any(batch_bool const& self, requires_arch) noexcept { return wasm_i8x16_bitmask(self) != 0; @@ -247,7 +247,7 @@ namespace xsimd } // bitwise_lshift - template ::value>> + template >> XSIMD_INLINE batch bitwise_lshift(batch const& self, int32_t other, requires_arch) noexcept { if constexpr (sizeof(T) == 1) @@ -274,10 +274,10 @@ namespace xsimd } // bitwise_rshift - template ::value>> + template >> XSIMD_INLINE batch bitwise_rshift(batch const& self, int32_t other, requires_arch) noexcept { - if (std::is_signed::value) + if (std::is_signed_v) { if constexpr (sizeof(T) == 1) { @@ -359,7 +359,7 @@ namespace xsimd { return wasm_f32x4_splat(val); } - template ::value>> + template >> XSIMD_INLINE batch broadcast(T val, requires_arch) noexcept { if constexpr (sizeof(T) == 1) @@ -425,7 +425,7 @@ namespace xsimd { return wasm_i32x4_eq(self, other); } - template ::value>> + template >> XSIMD_INLINE batch_bool eq(batch const& self, batch const& other, requires_arch) noexcept { if constexpr (sizeof(T) == 1) @@ -450,7 +450,7 @@ namespace xsimd return {}; } } - template ::value>> + template >> XSIMD_INLINE batch_bool eq(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { if constexpr (sizeof(T) == 1) @@ -538,7 +538,7 @@ namespace xsimd { return wasm_f32x4_extract_lane(self, 0); } - template ::value>> + template >> XSIMD_INLINE T first(batch const& self, requires_arch) noexcept { if constexpr (sizeof(T) == 1) @@ -619,7 +619,7 @@ namespace xsimd assert(!(mask & ~0x3ul) && "inbound mask"); return wasm_v128_load((const v128_t*)lut[mask]); } - template ::value>> + template >> XSIMD_INLINE batch_bool from_mask(batch_bool const&, uint64_t mask, requires_arch) noexcept { alignas(A::alignment()) static const uint64_t lut64[] = { @@ -722,10 +722,10 @@ namespace xsimd { return wasm_f32x4_gt(self, other); } - template ::value>> + template >> XSIMD_INLINE batch_bool gt(batch const& self, batch const& other, requires_arch) noexcept { - if (std::is_signed::value) + if (std::is_signed_v) { if constexpr (sizeof(T) == 1) { @@ -803,10 +803,10 @@ namespace xsimd { return wasm_f32x4_replace_lane(self, pos, val); } - template ::value>> + template >> XSIMD_INLINE batch insert(batch const& self, T val, index pos, requires_arch) noexcept { - if (std::is_signed::value) + if (std::is_signed_v) { if constexpr (sizeof(T) == 1) { @@ -892,7 +892,7 @@ namespace xsimd { return wasm_v128_load(mem); } - template ::value>> + template >> XSIMD_INLINE batch load_aligned(T const* mem, convert, requires_arch) noexcept { return wasm_v128_load((v128_t const*)mem); @@ -924,7 +924,7 @@ namespace xsimd { return wasm_v128_load(mem); } - template ::value>> + template >> XSIMD_INLINE batch load_unaligned(T const* mem, convert, requires_arch) noexcept { return wasm_v128_load((v128_t const*)mem); @@ -941,10 +941,10 @@ namespace xsimd { return wasm_f32x4_lt(self, other); } - template ::value>> + template >> XSIMD_INLINE batch_bool lt(batch const& self, batch const& other, requires_arch) noexcept { - if (std::is_signed::value) + if (std::is_signed_v) { if constexpr (sizeof(T) == 1) { @@ -1009,7 +1009,7 @@ namespace xsimd } // mask - template ::value>> + template >> XSIMD_INLINE uint64_t mask(batch_bool const& self, requires_arch) noexcept { if constexpr (sizeof(T) == 1) @@ -1052,7 +1052,7 @@ namespace xsimd { return wasm_f32x4_pmax(self, other); } - template ::value>> + template >> XSIMD_INLINE batch max(batch const& self, batch const& other, requires_arch) noexcept { return select(self > other, self, other); @@ -1069,7 +1069,7 @@ namespace xsimd { return wasm_f32x4_pmin(self, other); } - template ::value>> + template >> XSIMD_INLINE batch min(batch const& self, batch const& other, requires_arch) noexcept { return select(self <= other, self, other); @@ -1093,7 +1093,7 @@ namespace xsimd } // neg - template ::value>> + template >> XSIMD_INLINE batch neg(batch const& self, requires_arch) noexcept { if constexpr (sizeof(T) == 1) @@ -1137,7 +1137,7 @@ namespace xsimd { return wasm_f32x4_ne(self, other); } - template ::value>> + template >> XSIMD_INLINE batch_bool neq(batch const& self, batch const& other, requires_arch) noexcept { return ~(self == other); @@ -1147,7 +1147,7 @@ namespace xsimd { return wasm_v128_xor(self, other); } - template ::value>> + template >> XSIMD_INLINE batch_bool neq(batch_bool const& self, batch_bool const& other, requires_arch) noexcept { return ~(self == other); @@ -1188,7 +1188,7 @@ namespace xsimd v128_t tmp3 = wasm_i32x4_shuffle(tmp0, tmp2, 4, 1, 2, 3); return wasm_f32x4_extract_lane(tmp3, 0); } - template ::value>> + template >> XSIMD_INLINE T reduce_add(batch const& self, requires_arch) noexcept { if constexpr (sizeof(T) == 4) @@ -1229,7 +1229,7 @@ namespace xsimd v128_t tmp3 = wasm_i32x4_shuffle(tmp0, tmp2, 4, 1, 2, 3); return wasm_f32x4_extract_lane(tmp3, 0); } - template ::value>> + template >> XSIMD_INLINE T reduce_mul(batch const& self, requires_arch) noexcept { if constexpr (sizeof(T) == 4) @@ -1307,10 +1307,10 @@ namespace xsimd } // sadd - template ::value>> + template >> XSIMD_INLINE batch sadd(batch const& self, batch const& other, requires_arch) noexcept { - if (std::is_signed::value) + if (std::is_signed_v) { if constexpr (sizeof(T) == 1) { @@ -1349,12 +1349,12 @@ namespace xsimd return wasm_v128_or(wasm_v128_and(cond, true_br), wasm_v128_andnot(false_br, cond)); } - template ::value>> + template >> 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>> + template >> 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 {}); @@ -1386,25 +1386,25 @@ namespace xsimd return wasm_f32x4_make(values...); } - template ::value>> + template >> XSIMD_INLINE batch set(batch const&, requires_arch, T v0, T v1) noexcept { return wasm_i64x2_make(v0, v1); } - template ::value>> + template >> 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>> + template >> 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>> + template >> 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); @@ -1417,7 +1417,7 @@ namespace xsimd return wasm_f64x2_make(values...); } - template ::value>> + template >> XSIMD_INLINE batch_bool set(batch_bool const&, requires_arch, Values... values) noexcept { return set(batch(), A {}, static_cast(values ? -1LL : 0LL)...).data; @@ -1438,10 +1438,10 @@ namespace xsimd } // ssub - template ::value>> + template >> XSIMD_INLINE batch ssub(batch const& self, batch const& other, requires_arch) noexcept { - if (std::is_signed::value) + if (std::is_signed_v) { if constexpr (sizeof(T) == 1) { @@ -1479,12 +1479,12 @@ namespace xsimd { return wasm_v128_store(mem, self); } - template ::value>> + template >> XSIMD_INLINE void store_aligned(T* mem, batch const& self, requires_arch) noexcept { return wasm_v128_store((v128_t*)mem, self); } - template ::value>> + template >> XSIMD_INLINE void store_aligned(T* mem, batch_bool const& self, requires_arch) noexcept { return wasm_v128_store((v128_t*)mem, self); @@ -1528,12 +1528,12 @@ namespace xsimd { return wasm_v128_store(mem, self); } - template ::value>> + template >> XSIMD_INLINE void store_unaligned(T* mem, batch const& self, requires_arch) noexcept { return wasm_v128_store((v128_t*)mem, self); } - template ::value>> + template >> XSIMD_INLINE void store_unaligned(T* mem, batch_bool const& self, requires_arch) noexcept { return wasm_v128_store((v128_t*)mem, self); @@ -1550,7 +1550,7 @@ namespace xsimd { return wasm_f32x4_sub(self, other); } - template ::value>> + template >> XSIMD_INLINE batch sub(batch const& self, batch const& other, requires_arch) noexcept { if constexpr (sizeof(T) == 1) @@ -1746,7 +1746,7 @@ namespace xsimd { return wasm_i32x4_shuffle(self, other, 2, 6, 3, 7); } - template ::value>> + template >> XSIMD_INLINE batch zip_hi(batch const& self, batch const& other, requires_arch) noexcept { if constexpr (sizeof(T) == 1) @@ -1783,7 +1783,7 @@ namespace xsimd { return wasm_i32x4_shuffle(self, other, 0, 4, 1, 5); } - template ::value>> + template >> XSIMD_INLINE batch zip_lo(batch const& self, batch const& other, requires_arch) noexcept { if constexpr (sizeof(T) == 1) diff --git a/include/xsimd/types/xsimd_batch.hpp b/include/xsimd/types/xsimd_batch.hpp index f12348418..e97dd24e0 100644 --- a/include/xsimd/types/xsimd_batch.hpp +++ b/include/xsimd/types/xsimd_batch.hpp @@ -652,7 +652,7 @@ namespace xsimd template struct batch, A> { - static_assert(std::is_same::value, + static_assert(std::is_same_v, "Please use batch, A> initialized from xtl::xcomplex instead"); }; #endif @@ -1793,7 +1793,7 @@ namespace xsimd using type = void; }; - template ::value> + template > struct batch_trait; template diff --git a/include/xsimd/types/xsimd_neon_register.hpp b/include/xsimd/types/xsimd_neon_register.hpp index 82e27a986..0732ea7cc 100644 --- a/include/xsimd/types/xsimd_neon_register.hpp +++ b/include/xsimd/types/xsimd_neon_register.hpp @@ -84,11 +84,11 @@ namespace xsimd using unsigned_neon_vector_type = typename neon_vector_type_impl<8 * sizeof(T)>::unsigned_type; template - using neon_vector_type = std::conditional_t::value, + using neon_vector_type = std::conditional_t, signed_neon_vector_type, unsigned_neon_vector_type>; - using char_neon_vector_type = std::conditional_t::value, + using char_neon_vector_type = std::conditional_t, signed_neon_vector_type, unsigned_neon_vector_type>; } diff --git a/include/xsimd/types/xsimd_rvv_register.hpp b/include/xsimd/types/xsimd_rvv_register.hpp index 85f786b91..76b9b2a32 100644 --- a/include/xsimd/types/xsimd_rvv_register.hpp +++ b/include/xsimd/types/xsimd_rvv_register.hpp @@ -100,7 +100,7 @@ namespace xsimd template \ static XSIMD_INLINE byte_type as_bytes(U x) noexcept \ { \ - static_assert(std::is_same::value, "inconsistent conversion types"); \ + static_assert(std::is_same_v, "inconsistent conversion types"); \ const auto words = XSIMD_RVV_JOINT5(__riscv_vreinterpret_, u, s, m, vmul)(x); \ return XSIMD_RVV_JOINT5(__riscv_vreinterpret_, u, 8, m, vmul)(words); \ } \ @@ -326,7 +326,7 @@ namespace xsimd operator register_type() const noexcept { return value.get(); } }; template - using rvv_reg_t = std::conditional_t::value, rvv_reg, Width>, void>; + using rvv_reg_t = std::conditional_t, rvv_reg, Width>, void>; // And some more of the same stuff for bool types, which have // similar problems and similar workarounds. @@ -387,7 +387,7 @@ namespace xsimd }; template - using rvv_bool_t = std::enable_if_t < !std::is_void::value, + using rvv_bool_t = std::enable_if_t < !std::is_void_v, rvv_bool, Width>; template @@ -435,12 +435,12 @@ namespace xsimd using floating_point_rvv_vector_type = typename rvv_vector_type_impl<8 * sizeof(T)>::floating_point_type; template - using signed_int_or_floating_point_rvv_vector_type = std::conditional_t::value, + using signed_int_or_floating_point_rvv_vector_type = std::conditional_t, floating_point_rvv_vector_type, signed_int_rvv_vector_type>; template - using rvv_vector_type = std::conditional_t::value, + using rvv_vector_type = std::conditional_t, signed_int_or_floating_point_rvv_vector_type, unsigned_int_rvv_vector_type>; } // namespace detail diff --git a/include/xsimd/types/xsimd_sve_register.hpp b/include/xsimd/types/xsimd_sve_register.hpp index 802588691..e4920d13b 100644 --- a/include/xsimd/types/xsimd_sve_register.hpp +++ b/include/xsimd/types/xsimd_sve_register.hpp @@ -132,19 +132,19 @@ namespace xsimd struct sve_vector_impl; template - struct sve_vector_impl::value>> + struct sve_vector_impl>> { using type = floating_point_sve_vector_type; }; template - struct sve_vector_impl::value && std::is_signed::value>> + struct sve_vector_impl && std::is_signed_v>> { using type = signed_int_sve_vector_type; }; template - struct sve_vector_impl::value && std::is_unsigned::value>> + struct sve_vector_impl && std::is_unsigned_v>> { using type = unsigned_int_sve_vector_type; }; @@ -153,19 +153,19 @@ namespace xsimd struct sizeless_sve_vector_impl; template - struct sizeless_sve_vector_impl::value>> + struct sizeless_sve_vector_impl>> { using type = sizeless_floating_point_sve_vector_type; }; template - struct sizeless_sve_vector_impl::value && std::is_signed::value>> + struct sizeless_sve_vector_impl && std::is_signed_v>> { using type = sizeless_signed_int_sve_vector_type; }; template - struct sizeless_sve_vector_impl::value && std::is_unsigned::value>> + struct sizeless_sve_vector_impl && std::is_unsigned_v>> { using type = sizeless_unsigned_int_sve_vector_type; }; diff --git a/include/xsimd/types/xsimd_traits.hpp b/include/xsimd/types/xsimd_traits.hpp index c794416ee..973b1988e 100644 --- a/include/xsimd/types/xsimd_traits.hpp +++ b/include/xsimd/types/xsimd_traits.hpp @@ -48,6 +48,9 @@ namespace xsimd { }; + template + inline constexpr bool has_simd_register_v = has_simd_register::value; + namespace detail { template @@ -85,7 +88,7 @@ namespace xsimd static_assert(A::supported(), "usage of batch type with unsupported architecture"); - static_assert(!A::supported() || xsimd::has_simd_register::value, + static_assert(!A::supported() || xsimd::has_simd_register_v, "usage of batch type with unsupported type"); }; @@ -115,20 +118,20 @@ namespace xsimd } template - struct simd_traits : detail::simd_traits_impl::value> + struct simd_traits : detail::simd_traits_impl> { }; template struct simd_traits> - : detail::simd_traits_impl, xsimd::has_simd_register::value> + : detail::simd_traits_impl, xsimd::has_simd_register_v> { }; #ifdef XSIMD_ENABLE_XTL_COMPLEX template struct simd_traits> - : detail::simd_traits_impl, xsimd::has_simd_register::value> + : detail::simd_traits_impl, xsimd::has_simd_register_v> { }; #endif @@ -175,61 +178,64 @@ namespace xsimd template struct simd_condition { - static constexpr bool value = (std::is_same_v && !std::is_same_v) || (std::is_same_v && !std::is_same_v) || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || detail::is_complex::value; + static constexpr bool value = (std::is_same_v && !std::is_same_v) || (std::is_same_v && !std::is_same_v) || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v || detail::is_complex_v; }; + template + inline constexpr bool simd_condition_v = simd_condition::value; + template struct simd_return_type_impl - : std::enable_if::value, batch> + : std::enable_if, batch> { }; template struct simd_return_type_impl - : std::enable_if::value, batch_bool> + : std::enable_if, batch_bool> { }; template struct simd_return_type_impl, A> - : std::enable_if::value, batch_bool> + : std::enable_if, batch_bool> { }; template struct simd_return_type_impl, T2, A> - : std::enable_if::value, batch, A>> + : std::enable_if, batch, A>> { }; template struct simd_return_type_impl, std::complex, A> - : std::enable_if::value, batch, A>> + : std::enable_if, batch, A>> { }; #ifdef XSIMD_ENABLE_XTL_COMPLEX template struct simd_return_type_impl, T2, A> - : std::enable_if::value, batch, A>> + : std::enable_if, batch, A>> { }; template struct simd_return_type_impl, std::complex, A> - : std::enable_if::value, batch, A>> + : std::enable_if, batch, A>> { }; template struct simd_return_type_impl, xtl::xcomplex, A> - : std::enable_if::value, batch, A>> + : std::enable_if, batch, A>> { }; template struct simd_return_type_impl, xtl::xcomplex, A> - : std::enable_if::value, batch, A>> + : std::enable_if, batch, A>> { }; #endif @@ -255,7 +261,7 @@ namespace xsimd static constexpr bool is_batch = false; ///< True if T is @c batch<...>. static constexpr bool is_batch_bool = false; ///< True if T is @c batch_bool<...>. static constexpr bool is_any_batch = false; ///< True if T is @c batch<...> or @c batch_bool<...>. - static constexpr bool is_complex = detail::is_complex::value; ///< True if T is complex or a batch of complex values. + static constexpr bool is_complex = detail::is_complex_v; ///< True if T is complex or a batch of complex values. }; #if XSIMD_CPP_VERSION < 201703L @@ -278,7 +284,7 @@ namespace xsimd static constexpr bool is_batch = true; static constexpr bool is_batch_bool = false; static constexpr bool is_any_batch = true; - static constexpr bool is_complex = detail::is_complex::value; + static constexpr bool is_complex = detail::is_complex_v; }; #if XSIMD_CPP_VERSION < 201703L @@ -375,7 +381,7 @@ namespace xsimd * @ingroup batch_traits * * type traits whose @c type field is set to @c T::value_type if @c - * is_batch::value and to @c T otherwise. + * is_batch_v and to @c T otherwise. * * @tparam T type to analyze. */ @@ -392,7 +398,7 @@ namespace xsimd * @ingroup batch_traits * * type traits whose @c type field is set to @c T::value_type if @c - * is_batch_bool::value and to @c bool otherwise. + * is_batch_bool_v and to @c bool otherwise. * * @tparam T type to analyze. */ diff --git a/include/xsimd/types/xsimd_utils.hpp b/include/xsimd/types/xsimd_utils.hpp index ec8f89590..66fe6dc99 100644 --- a/include/xsimd/types/xsimd_utils.hpp +++ b/include/xsimd/types/xsimd_utils.hpp @@ -190,8 +190,8 @@ namespace xsimd inline To bit_cast(From val) noexcept { static_assert(sizeof(From) == sizeof(To), "casting between compatible layout"); - static_assert(std::is_trivially_copyable::value, "input type is trivially copyable"); - static_assert(std::is_trivially_copyable::value, "output type is trivially copyable"); + static_assert(std::is_trivially_copyable_v, "input type is trivially copyable"); + static_assert(std::is_trivially_copyable_v, "output type is trivially copyable"); To res; std::memcpy(&res, &val, sizeof(val)); return res; @@ -377,6 +377,9 @@ namespace xsimd { }; #endif + + template + inline constexpr bool is_complex_v = is_complex::value; } /******************* diff --git a/test/test_batch.cpp b/test/test_batch.cpp index 129f9b272..ed43364e0 100644 --- a/test/test_batch.cpp +++ b/test/test_batch.cpp @@ -41,7 +41,7 @@ namespace detail_test_mulhilo } #else template - std::enable_if_t::value && (sizeof(T) == 8), T> + std::enable_if_t && (sizeof(T) == 8), T> mulhi_reference(T x, T y) noexcept { uint64_t ux = static_cast(x); @@ -51,7 +51,7 @@ namespace detail_test_mulhilo uint64_t ll = xl * yl, lh = xl * yh, hl = xh * yl, hh = xh * yh; uint64_t mid = (ll >> 32) + (lh & 0xffffffffULL) + (hl & 0xffffffffULL); uint64_t hi = hh + (lh >> 32) + (hl >> 32) + (mid >> 32); - if (std::is_signed::value) + if (std::is_signed_v) { if (x < 0) hi -= uy; diff --git a/test/test_custom_default_arch.cpp b/test/test_custom_default_arch.cpp index 3ae1f2aea..a92f4647e 100644 --- a/test/test_custom_default_arch.cpp +++ b/test/test_custom_default_arch.cpp @@ -17,7 +17,7 @@ #include "xsimd/xsimd.hpp" // Could be different than sse2 if we compile for other architecture avx -static_assert(std::is_same::value, "default arch correctly hooked"); +static_assert(std::is_same_v, "default arch correctly hooked"); #else