From ead311fda435d7401c2ad5b34985a032515a945b Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Sun, 12 Nov 2023 22:42:54 +0100 Subject: [PATCH] Disable batch of bools, and suggest using batch_bool instead It was only supported on Intel architectures and wasm, for no clear reason. Provide a unified experience by enforcing batch_bool instead. If someone really wants a batch of bool, then use another type to store it, e.g. uint8_t. Fix #945 --- include/xsimd/types/xsimd_avx512f_register.hpp | 1 - include/xsimd/types/xsimd_avx_register.hpp | 1 - include/xsimd/types/xsimd_batch.hpp | 1 + include/xsimd/types/xsimd_sse2_register.hpp | 1 - include/xsimd/types/xsimd_wasm_register.hpp | 1 - 5 files changed, 1 insertion(+), 4 deletions(-) diff --git a/include/xsimd/types/xsimd_avx512f_register.hpp b/include/xsimd/types/xsimd_avx512f_register.hpp index fb8e473e1..c1f80a122 100644 --- a/include/xsimd/types/xsimd_avx512f_register.hpp +++ b/include/xsimd/types/xsimd_avx512f_register.hpp @@ -53,7 +53,6 @@ namespace xsimd using type = simd_avx512_bool_register; }; - XSIMD_DECLARE_SIMD_REGISTER(bool, avx512f, __m512i); XSIMD_DECLARE_SIMD_REGISTER(signed char, avx512f, __m512i); XSIMD_DECLARE_SIMD_REGISTER(unsigned char, avx512f, __m512i); XSIMD_DECLARE_SIMD_REGISTER(char, avx512f, __m512i); diff --git a/include/xsimd/types/xsimd_avx_register.hpp b/include/xsimd/types/xsimd_avx_register.hpp index 95f18ebfb..6b1951f96 100644 --- a/include/xsimd/types/xsimd_avx_register.hpp +++ b/include/xsimd/types/xsimd_avx_register.hpp @@ -42,7 +42,6 @@ namespace xsimd namespace types { - XSIMD_DECLARE_SIMD_REGISTER(bool, avx, __m256i); XSIMD_DECLARE_SIMD_REGISTER(signed char, avx, __m256i); XSIMD_DECLARE_SIMD_REGISTER(unsigned char, avx, __m256i); XSIMD_DECLARE_SIMD_REGISTER(char, avx, __m256i); diff --git a/include/xsimd/types/xsimd_batch.hpp b/include/xsimd/types/xsimd_batch.hpp index c8a8239cc..b4989fc88 100644 --- a/include/xsimd/types/xsimd_batch.hpp +++ b/include/xsimd/types/xsimd_batch.hpp @@ -112,6 +112,7 @@ namespace xsimd template class batch : public types::simd_register, public types::integral_only_operators { + static_assert(!std::is_same::value, "use xsimd::batch_bool instead of xsimd::batch"); public: static constexpr std::size_t size = sizeof(types::simd_register) / sizeof(T); ///< Number of scalar elements in this batch. diff --git a/include/xsimd/types/xsimd_sse2_register.hpp b/include/xsimd/types/xsimd_sse2_register.hpp index 3855a9d7d..a9dc8960b 100644 --- a/include/xsimd/types/xsimd_sse2_register.hpp +++ b/include/xsimd/types/xsimd_sse2_register.hpp @@ -40,7 +40,6 @@ namespace xsimd #if XSIMD_WITH_SSE2 namespace types { - XSIMD_DECLARE_SIMD_REGISTER(bool, sse2, __m128i); XSIMD_DECLARE_SIMD_REGISTER(signed char, sse2, __m128i); XSIMD_DECLARE_SIMD_REGISTER(unsigned char, sse2, __m128i); XSIMD_DECLARE_SIMD_REGISTER(char, sse2, __m128i); diff --git a/include/xsimd/types/xsimd_wasm_register.hpp b/include/xsimd/types/xsimd_wasm_register.hpp index ab8782ac6..237db95c6 100644 --- a/include/xsimd/types/xsimd_wasm_register.hpp +++ b/include/xsimd/types/xsimd_wasm_register.hpp @@ -40,7 +40,6 @@ namespace xsimd #if XSIMD_WITH_WASM namespace types { - XSIMD_DECLARE_SIMD_REGISTER(bool, wasm, v128_t); XSIMD_DECLARE_SIMD_REGISTER(signed char, wasm, v128_t); XSIMD_DECLARE_SIMD_REGISTER(unsigned char, wasm, v128_t); XSIMD_DECLARE_SIMD_REGISTER(char, wasm, v128_t);