From d9dd5a9750aec61e78659532216ba1010b787d81 Mon Sep 17 00:00:00 2001 From: AntoinePrv Date: Wed, 5 Aug 2026 18:05:55 +0200 Subject: [PATCH 1/2] Delete pre 201703L code --- .../xsimd/config/xsimd_cpu_features_x86.hpp | 6 --- include/xsimd/types/xsimd_batch.hpp | 15 ------ include/xsimd/types/xsimd_traits.hpp | 53 ------------------- 3 files changed, 74 deletions(-) diff --git a/include/xsimd/config/xsimd_cpu_features_x86.hpp b/include/xsimd/config/xsimd_cpu_features_x86.hpp index 000760eaa..b0bf9bb21 100644 --- a/include/xsimd/config/xsimd_cpu_features_x86.hpp +++ b/include/xsimd/config/xsimd_cpu_features_x86.hpp @@ -17,9 +17,7 @@ #include #include #include -#if XSIMD_CPP_VERSION >= 201703L #include -#endif #include "../utils/bits.hpp" #include "./xsimd_config.hpp" @@ -249,12 +247,10 @@ namespace xsimd return m_manufacturer_id; } -#if XSIMD_CPP_VERSION >= 201703L constexpr std::string_view manufacturer_id() const noexcept { return { m_manufacturer_id.data(), m_manufacturer_id.size() }; } -#endif private: manufacturer_str m_manufacturer_id {}; @@ -835,12 +831,10 @@ namespace xsimd return leaf0().manufacturer_id_raw(); } -#if XSIMD_CPP_VERSION >= 201703L inline std::string_view manufacturer_id() const noexcept { return leaf0().manufacturer_id(); } -#endif /** The manufacturer ID string parsed into known common vendors. */ inline x86_manufacturer known_manufacturer() const noexcept diff --git a/include/xsimd/types/xsimd_batch.hpp b/include/xsimd/types/xsimd_batch.hpp index e97dd24e0..f09aa3bf5 100644 --- a/include/xsimd/types/xsimd_batch.hpp +++ b/include/xsimd/types/xsimd_batch.hpp @@ -415,11 +415,6 @@ namespace xsimd XSIMD_INLINE batch logical_or(batch const& other) const noexcept; }; -#if XSIMD_CPP_VERSION < 201703L - template - constexpr std::size_t batch::size; -#endif - /** * @brief batch of predicate over scalar or complex values. * @@ -497,11 +492,6 @@ namespace xsimd static XSIMD_INLINE register_type make_register(std::index_sequence<>, V... v) noexcept; }; -#if XSIMD_CPP_VERSION < 201703L - template - constexpr std::size_t batch_bool::size; -#endif - /** * @brief batch of complex values. * @@ -643,11 +633,6 @@ namespace xsimd real_batch m_imag; }; -#if XSIMD_CPP_VERSION < 201703L - template - constexpr std::size_t batch, A>::size; -#endif - #ifdef XSIMD_ENABLE_XTL_COMPLEX template struct batch, A> diff --git a/include/xsimd/types/xsimd_traits.hpp b/include/xsimd/types/xsimd_traits.hpp index 973b1988e..a3a0a9c77 100644 --- a/include/xsimd/types/xsimd_traits.hpp +++ b/include/xsimd/types/xsimd_traits.hpp @@ -64,11 +64,6 @@ namespace xsimd static constexpr size_t size = 1; }; -#if XSIMD_CPP_VERSION < 201703L - template - constexpr size_t simd_traits_impl::size; -#endif - template struct simd_traits_impl { @@ -77,11 +72,6 @@ namespace xsimd static constexpr size_t size = type::size; }; -#if XSIMD_CPP_VERSION < 201703L - template - constexpr size_t simd_traits_impl::size; -#endif - template struct static_check_supported_config_emitter { @@ -143,11 +133,6 @@ namespace xsimd static constexpr size_t size = simd_traits::size; }; -#if XSIMD_CPP_VERSION < 201703L - template - constexpr size_t revert_simd_traits::size; -#endif - template struct revert_simd_traits> { @@ -155,11 +140,6 @@ namespace xsimd static constexpr size_t size = batch::size; }; -#if XSIMD_CPP_VERSION < 201703L - template - constexpr size_t revert_simd_traits>::size; -#endif - template using simd_type = typename simd_traits::type; @@ -264,17 +244,6 @@ namespace xsimd 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 - template - constexpr bool batch_traits::is_batch; - template - constexpr bool batch_traits::is_batch_bool; - template - constexpr bool batch_traits::is_any_batch; - template - constexpr bool batch_traits::is_complex; -#endif - template struct batch_traits> { @@ -287,17 +256,6 @@ namespace xsimd static constexpr bool is_complex = detail::is_complex_v; }; -#if XSIMD_CPP_VERSION < 201703L - template - constexpr bool batch_traits>::is_batch; - template - constexpr bool batch_traits>::is_batch_bool; - template - constexpr bool batch_traits>::is_any_batch; - template - constexpr bool batch_traits>::is_complex; -#endif - template struct batch_traits> { @@ -310,17 +268,6 @@ namespace xsimd static constexpr bool is_complex = false; }; -#if XSIMD_CPP_VERSION < 201703L - template - constexpr bool batch_traits>::is_batch; - template - constexpr bool batch_traits>::is_batch_bool; - template - constexpr bool batch_traits>::is_any_batch; - template - constexpr bool batch_traits>::is_complex; -#endif - /** * @ingroup batch_traits * From 821cbbb613da4b0b9ed9971273d69bc6a4a5dd12 Mon Sep 17 00:00:00 2001 From: AntoinePrv Date: Wed, 5 Aug 2026 18:11:48 +0200 Subject: [PATCH 2/2] Delete CPU id pre C++17 code --- .../xsimd/config/xsimd_cpu_features_x86.hpp | 78 ++----------------- 1 file changed, 5 insertions(+), 73 deletions(-) diff --git a/include/xsimd/config/xsimd_cpu_features_x86.hpp b/include/xsimd/config/xsimd_cpu_features_x86.hpp index b0bf9bb21..25d6dc5b0 100644 --- a/include/xsimd/config/xsimd_cpu_features_x86.hpp +++ b/include/xsimd/config/xsimd_cpu_features_x86.hpp @@ -12,15 +12,15 @@ #ifndef XSIMD_CPU_FEATURES_X86_HPP #define XSIMD_CPU_FEATURES_X86_HPP +#include "../utils/bits.hpp" +#include "./xsimd_config.hpp" + #include #include #include #include -#include #include - -#include "../utils/bits.hpp" -#include "./xsimd_config.hpp" +#include #if XSIMD_TARGET_X86 && defined(_MSC_VER) #include // Contains the definition of __cpuidex @@ -122,75 +122,8 @@ namespace xsimd constexpr x86_cpuid_regs() noexcept = default; - // TODO(C++17) compact version for which this was designed. - // The else clause contains a very verbose port. -#if 0 using x86_reg32_bitset::all_bits_set...; using x86_reg32_bitset::get_range...; -#else - - private: - template - struct m_empty_reg - { - enum class type {}; - }; - - using eax_or_empty = std::conditional_t, typename m_empty_reg<0>::type, eax>; - using ebx_or_empty = std::conditional_t, typename m_empty_reg<1>::type, ebx>; - using ecx_or_empty = std::conditional_t, typename m_empty_reg<2>::type, ecx>; - using edx_or_empty = std::conditional_t, typename m_empty_reg<3>::type, edx>; - - public: - template , int> = 0> - constexpr bool all_bits_set() const noexcept - { - return x86_reg32_bitset::template all_bits_set(); - } - - template , int> = 0> - constexpr x86_reg32_t get_range() const noexcept - { - return x86_reg32_bitset::template get_range(); - } - - template , int> = 0> - constexpr bool all_bits_set() const noexcept - { - return x86_reg32_bitset::template all_bits_set(); - } - - template , int> = 0> - constexpr x86_reg32_t get_range() const noexcept - { - return x86_reg32_bitset::template get_range(); - } - - template , int> = 0> - constexpr bool all_bits_set() const noexcept - { - return x86_reg32_bitset::template all_bits_set(); - } - - template , int> = 0> - constexpr x86_reg32_t get_range() const noexcept - { - return x86_reg32_bitset::template get_range(); - } - - template , int> = 0> - constexpr bool all_bits_set() const noexcept - { - return x86_reg32_bitset::template all_bits_set(); - } - - template , int> = 0> - constexpr x86_reg32_t get_range() const noexcept - { - return x86_reg32_bitset::template get_range(); - } - -#endif // C++17 }; template @@ -1044,8 +977,7 @@ namespace xsimd // Check if it is safe to call CPUID with this value. // First we identify if the leaf is in the regular or extended range. - // TODO(C++17): if constexpr - if (L::leaf < extended_threshold) + if constexpr (L::leaf < extended_threshold) { // Check leaf0 in regular range if (L::leaf <= leaf0().highest_leaf())