From c8ed87f5fd669673a79fa03f95a607ddc88aae84 Mon Sep 17 00:00:00 2001 From: SadiinsoSnowfall Date: Sun, 24 Nov 2024 20:23:23 +0100 Subject: [PATCH] marked constexpr-only function as consteval --- include/eve/arch/cpu/top_bits.hpp | 4 ++-- include/eve/module/core/named_shuffles/blend.hpp | 8 ++++---- include/eve/module/core/named_shuffles/broadcast_lane.hpp | 4 ++-- include/eve/module/core/named_shuffles/reverse.hpp | 4 ++-- .../module/core/named_shuffles/reverse_in_subgroups.hpp | 4 ++-- include/eve/module/core/named_shuffles/slide.hpp | 6 +++--- include/eve/module/core/named_shuffles/swap_adjacent.hpp | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/eve/arch/cpu/top_bits.hpp b/include/eve/arch/cpu/top_bits.hpp index e7acd805f9..5df4477f6a 100644 --- a/include/eve/arch/cpu/top_bits.hpp +++ b/include/eve/arch/cpu/top_bits.hpp @@ -106,13 +106,13 @@ namespace detail else return movemask(logical_type{}).first; } - EVE_FORCEINLINE static constexpr std::ptrdiff_t bits_per_element_impl() + EVE_FORCEINLINE static consteval std::ptrdiff_t bits_per_element_impl() { if constexpr ( is_aggregated ) return top_bits::bits_per_element; else return decltype(movemask(logical_type{}).second){}(); } - static constexpr bool is_cheap_impl() + static consteval bool is_cheap_impl() { if constexpr ( has_emulated_abi_v ) return true; else if constexpr ( is_aggregated ) return top_bits::is_cheap; diff --git a/include/eve/module/core/named_shuffles/blend.hpp b/include/eve/module/core/named_shuffles/blend.hpp index a7b81cd250..345ddac8b3 100644 --- a/include/eve/module/core/named_shuffles/blend.hpp +++ b/include/eve/module/core/named_shuffles/blend.hpp @@ -68,7 +68,7 @@ namespace eve struct blend_t { template - static constexpr auto pattern(eve::as, eve::as, eve::fixed, pattern_t) + static consteval auto pattern(eve::as, eve::as, eve::fixed, pattern_t) { static_assert(((0 <= I && I <= 1) && ...), "pattern for blend has to only contain 0 and 1"); static_assert(pattern_t::size() * G == T::size(), "pattern has wrong number of elements"); @@ -82,7 +82,7 @@ struct blend_t } template - static constexpr std::ptrdiff_t level(eve::as, eve::as, eve::fixed g, pattern_t p) + static consteval std::ptrdiff_t level(eve::as, eve::as, eve::fixed g, pattern_t p) { if constexpr( sizeof...(I) == 1 ) return 0; else if constexpr( eve::has_aggregated_abi_v ) @@ -142,14 +142,14 @@ struct blend_t } template - static constexpr auto + static consteval auto pattern(eve::as tgt, eve::as, eve::fixed g, pattern_formula auto gen) { return pattern(tgt, tgt, g, fix_pattern(gen)); } template - static constexpr auto level(eve::as tgt, eve::as, eve::fixed g, pattern_formula auto gen) + static consteval auto level(eve::as tgt, eve::as, eve::fixed g, pattern_formula auto gen) { return level(tgt, tgt, g, fix_pattern(gen)); } diff --git a/include/eve/module/core/named_shuffles/broadcast_lane.hpp b/include/eve/module/core/named_shuffles/broadcast_lane.hpp index bcdc341c7c..71f677a14a 100644 --- a/include/eve/module/core/named_shuffles/broadcast_lane.hpp +++ b/include/eve/module/core/named_shuffles/broadcast_lane.hpp @@ -59,14 +59,14 @@ namespace eve struct broadcast_lane_t { template - static constexpr auto pattern(eve::as, eve::fixed, eve::index_t) + static consteval auto pattern(eve::as, eve::fixed, eve::index_t) { static_assert(I < T::size() / G); return eve::fix_pattern([](int, int) { return I; }); } template - static constexpr std::ptrdiff_t level(eve::as tgt, eve::fixed g, eve::index_t i) + static consteval std::ptrdiff_t level(eve::as tgt, eve::fixed g, eve::index_t i) { constexpr std::size_t reg_size = sizeof(element_type_t) * T::size(); constexpr std::ptrdiff_t g_size = sizeof(element_type_t) * G; diff --git a/include/eve/module/core/named_shuffles/reverse.hpp b/include/eve/module/core/named_shuffles/reverse.hpp index ec89ef2264..ca2db55ecb 100644 --- a/include/eve/module/core/named_shuffles/reverse.hpp +++ b/include/eve/module/core/named_shuffles/reverse.hpp @@ -55,13 +55,13 @@ namespace eve //================================================================================================ struct reverse_t { - template static constexpr auto pattern(eve::as, eve::fixed) + template static consteval auto pattern(eve::as, eve::fixed) { return eve::fix_pattern([](int i, int size) { return size - i - 1; }); } template - static constexpr std::ptrdiff_t level(eve::as tgt, eve::fixed g) + static consteval std::ptrdiff_t level(eve::as tgt, eve::fixed g) { if constexpr( eve::has_aggregated_abi_v ) { diff --git a/include/eve/module/core/named_shuffles/reverse_in_subgroups.hpp b/include/eve/module/core/named_shuffles/reverse_in_subgroups.hpp index 856d664892..76b78a9191 100644 --- a/include/eve/module/core/named_shuffles/reverse_in_subgroups.hpp +++ b/include/eve/module/core/named_shuffles/reverse_in_subgroups.hpp @@ -62,7 +62,7 @@ namespace eve struct reverse_in_subgroups_t { template - static constexpr auto pattern(eve::as, eve::fixed, eve::fixed) + static consteval auto pattern(eve::as, eve::fixed, eve::fixed) { static_assert(SubG <= T::size() / G); static_assert(SubG >= 1); @@ -77,7 +77,7 @@ struct reverse_in_subgroups_t } template - static constexpr std::ptrdiff_t level(eve::as tgt, eve::fixed g, eve::fixed sub_g) + static consteval std::ptrdiff_t level(eve::as tgt, eve::fixed g, eve::fixed sub_g) { constexpr std::ptrdiff_t g_size = sizeof(element_type_t) * G; constexpr std::size_t sub_size = g_size * SubG; diff --git a/include/eve/module/core/named_shuffles/slide.hpp b/include/eve/module/core/named_shuffles/slide.hpp index 44e6f9550e..f3e981f049 100644 --- a/include/eve/module/core/named_shuffles/slide.hpp +++ b/include/eve/module/core/named_shuffles/slide.hpp @@ -68,14 +68,14 @@ struct slide_left_impl_t { // One agr template - static constexpr auto pattern(eve::as, eve::fixed, eve::index_t) + static consteval auto pattern(eve::as, eve::fixed, eve::index_t) { static_assert(G > 0 && 0 <= S && S <= T::size() / G); return eve::fix_pattern([](int i, int n) { return (i + S) < n ? i + S : na_; }); } template - static constexpr std::ptrdiff_t level(eve::as tgt, eve::fixed g, eve::index_t s) + static consteval std::ptrdiff_t level(eve::as tgt, eve::fixed g, eve::index_t s) { using abi_t = typename T::abi_type; constexpr std::size_t reg_size = sizeof(element_type_t) * T::size(); @@ -133,7 +133,7 @@ struct slide_left_impl_t // Two args template - static constexpr std::ptrdiff_t + static consteval std::ptrdiff_t level(eve::as tgt, eve::as, eve::fixed g, eve::index_t s) { using abi_t = typename T::abi_type; diff --git a/include/eve/module/core/named_shuffles/swap_adjacent.hpp b/include/eve/module/core/named_shuffles/swap_adjacent.hpp index 0f3ae72b46..e46be290b5 100644 --- a/include/eve/module/core/named_shuffles/swap_adjacent.hpp +++ b/include/eve/module/core/named_shuffles/swap_adjacent.hpp @@ -53,7 +53,7 @@ namespace eve struct swap_adjacent_t { template - static constexpr auto pattern(eve::as, eve::fixed) + static consteval auto pattern(eve::as, eve::fixed) requires(G < T::size()) { return eve::fix_pattern( @@ -65,7 +65,7 @@ struct swap_adjacent_t } template - static constexpr std::ptrdiff_t level(eve::as tgt, eve::fixed g) + static consteval std::ptrdiff_t level(eve::as tgt, eve::fixed g) { constexpr std::ptrdiff_t g_size = sizeof(element_type_t) * G; constexpr std::size_t reg_size = sizeof(element_type_t) * T::size();