Skip to content

Commit

Permalink
Obsolete the version() method from register description
Browse files Browse the repository at this point in the history
Fix #1007
  • Loading branch information
serge-sans-paille committed Mar 17, 2024
1 parent 1d8536b commit 7080469
Show file tree
Hide file tree
Showing 31 changed files with 1 addition and 66 deletions.
28 changes: 1 addition & 27 deletions include/xsimd/config/xsimd_arch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return false; }
static constexpr bool available() noexcept { return false; }
static constexpr unsigned version() noexcept { return 0; }
static constexpr std::size_t alignment() noexcept { return 0; }
static constexpr bool requires_alignment() noexcept { return false; }
static constexpr char const* name() noexcept { return "<none>"; }
Expand All @@ -57,26 +56,6 @@ namespace xsimd
{
};

template <unsigned... Vals>
struct is_sorted;

template <>
struct is_sorted<> : std::true_type
{
};

template <unsigned Val>
struct is_sorted<Val> : std::true_type
{
};

template <unsigned V0, unsigned V1, unsigned... Vals>
struct is_sorted<V0, V1, Vals...>
: std::conditional<(V0 >= V1), is_sorted<V1, Vals...>,
std::false_type>::type
{
};

template <typename T>
inline constexpr T max_of(T value) noexcept
{
Expand Down Expand Up @@ -106,15 +85,10 @@ namespace xsimd

} // namespace detail

// An arch_list is a list of architectures, sorted by version number.
// An arch_list is a list of architectures.
template <class... Archs>
struct arch_list
{
#ifndef NDEBUG
static_assert(detail::is_sorted<Archs::version()...>::value,
"architecture list must be sorted by version");
#endif

using best = typename detail::head<Archs...>::type;

template <class Arch>
Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_avx2_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX2; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(2, 2, 0); }
static constexpr char const* name() noexcept { return "avx2"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_avx512bw_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512BW; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(3, 4, 0); }
static constexpr char const* name() noexcept { return "avx512bw"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_avx512cd_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512CD; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(3, 2, 0); }
static constexpr char const* name() noexcept { return "avx512cd"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_avx512dq_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512DQ; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(3, 3, 0); }
static constexpr char const* name() noexcept { return "avx512dq"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_avx512er_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512ER; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(3, 3, 1); }
static constexpr char const* name() noexcept { return "avx512er"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_avx512f_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512F; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(3, 1, 0); }
static constexpr std::size_t alignment() noexcept { return 64; }
static constexpr bool requires_alignment() noexcept { return true; }
static constexpr char const* name() noexcept { return "avx512f"; }
Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_avx512ifma_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512IFMA; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(3, 5, 0); }
static constexpr char const* name() noexcept { return "avx512ifma"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_avx512pf_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512PF; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(3, 4, 1); }
static constexpr char const* name() noexcept { return "avx512pf"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_avx512vbmi_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512VBMI; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(3, 6, 0); }
static constexpr char const* name() noexcept { return "avx512vbmi"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_avx512vnni_avx512bw_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512VNNI_AVX512BW; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(3, 4, 1); }
static constexpr char const* name() noexcept { return "avx512vnni+avx512bw"; }
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX512VNNI_AVX512VBMI; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(3, 6, 1); }
static constexpr char const* name() noexcept { return "avx512vnni+avx512vbmi"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_avx_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_AVX; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(2, 1, 0); }
static constexpr std::size_t alignment() noexcept { return 32; }
static constexpr bool requires_alignment() noexcept { return true; }
static constexpr char const* name() noexcept { return "avx"; }
Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_avxvnni_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_AVXVNNI; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(2, 3, 0); }
static constexpr char const* name() noexcept { return "avxvnni"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_fma3_avx2_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_FMA3_AVX2; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(2, 2, 1); }
static constexpr char const* name() noexcept { return "fma3+avx2"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_fma3_avx_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_FMA3_AVX; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(2, 1, 1); }
static constexpr char const* name() noexcept { return "fma3+avx"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_fma3_sse_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_FMA3_SSE; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(1, 4, 3); }
static constexpr char const* name() noexcept { return "fma3+sse4.2"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_fma4_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_FMA4; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(1, 4, 4); }
static constexpr char const* name() noexcept { return "fma4"; }
};

Expand Down
5 changes: 0 additions & 5 deletions include/xsimd/types/xsimd_generic_arch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,8 @@ namespace xsimd
static constexpr std::size_t alignment() noexcept { return 0; }
/// Whether this architecture requires aligned memory access.
static constexpr bool requires_alignment() noexcept { return false; }
/// Unique identifier for this architecture.
static constexpr unsigned version() noexcept { return generic::version(0, 0, 0); }
/// Name of the architecture.
static constexpr char const* name() noexcept { return "generic"; }

protected:
static constexpr unsigned version(unsigned major, unsigned minor, unsigned patch, unsigned multiplier = 100u) noexcept { return major * multiplier * multiplier + minor * multiplier + patch; }
};

struct unsupported
Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_i8mm_neon64_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_I8MM_NEON64; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(8, 2, 0); }
static constexpr char const* name() noexcept { return "i8mm+neon64"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_neon64_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ namespace xsimd
static constexpr bool available() noexcept { return true; }
static constexpr bool requires_alignment() noexcept { return true; }
static constexpr std::size_t alignment() noexcept { return 16; }
static constexpr unsigned version() noexcept { return generic::version(8, 1, 0); }
static constexpr char const* name() noexcept { return "arm64+neon"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_neon_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ namespace xsimd
static constexpr bool available() noexcept { return true; }
static constexpr bool requires_alignment() noexcept { return true; }
static constexpr std::size_t alignment() noexcept { return 16; }
static constexpr unsigned version() noexcept { return generic::version(7, 0, 0); }
static constexpr char const* name() noexcept { return "arm32+neon"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_rvv_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ namespace xsimd
static constexpr bool available() noexcept { return true; }
static constexpr bool requires_alignment() noexcept { return true; }
static constexpr std::size_t alignment() noexcept { return 16; }
static constexpr unsigned version() noexcept { return generic::version(1, 0, 0, /*multiplier=*/1000); }
static constexpr char const* name() noexcept { return "riscv+rvv"; }
};
}
Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_sse2_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ namespace xsimd
static constexpr bool supported() noexcept { return XSIMD_WITH_SSE2; }
static constexpr bool available() noexcept { return true; }
static constexpr bool requires_alignment() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(1, 2, 0); }
static constexpr std::size_t alignment() noexcept { return 16; }
static constexpr char const* name() noexcept { return "sse2"; }
};
Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_sse3_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_SSE3; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(1, 3, 0); }
static constexpr char const* name() noexcept { return "sse3"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_sse4_1_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_SSE4_1; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(1, 4, 1); }
static constexpr char const* name() noexcept { return "sse4.1"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_sse4_2_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_SSE4_2; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(1, 4, 2); }
static constexpr char const* name() noexcept { return "sse4.2"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_ssse3_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace xsimd
{
static constexpr bool supported() noexcept { return XSIMD_WITH_SSSE3; }
static constexpr bool available() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(1, 3, 1); }
static constexpr char const* name() noexcept { return "ssse3"; }
};

Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_sve_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace xsimd
static constexpr bool available() noexcept { return true; }
static constexpr bool requires_alignment() noexcept { return true; }
static constexpr std::size_t alignment() noexcept { return 16; }
static constexpr unsigned version() noexcept { return generic::version(9, Width / 32, 0); }
static constexpr char const* name() noexcept { return "arm64+sve"; }
};
}
Expand Down
1 change: 0 additions & 1 deletion include/xsimd/types/xsimd_wasm_register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ namespace xsimd
static constexpr bool supported() noexcept { return XSIMD_WITH_WASM; }
static constexpr bool available() noexcept { return true; }
static constexpr bool requires_alignment() noexcept { return true; }
static constexpr unsigned version() noexcept { return generic::version(10, 0, 0); }
static constexpr std::size_t alignment() noexcept { return 16; }
static constexpr char const* name() noexcept { return "wasm"; }
};
Expand Down
6 changes: 0 additions & 6 deletions test/test_arch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ struct check_available
}
};

struct get_arch_version
{
template <class Arch>
unsigned operator()(Arch) { return Arch::version(); }
};

template <class T>
static bool try_load()
{
Expand Down

0 comments on commit 7080469

Please sign in to comment.