From 29b47e889071014de758fb9d97e73492782de7e4 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 2 Mar 2021 11:04:28 -0800 Subject: [PATCH] ircd::simd: Add constexprs for some lane traits. --- include/ircd/simd/traits.h | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/include/ircd/simd/traits.h b/include/ircd/simd/traits.h index 4f8f1d59b..4a30f3446 100644 --- a/include/ircd/simd/traits.h +++ b/include/ircd/simd/traits.h @@ -16,6 +16,20 @@ namespace ircd::simd template static constexpr size_t lanes(); + template + static constexpr bool is_lane_same(); + + template + static constexpr bool is_lane_base_of(); + + template + static constexpr bool is_lane_integral(); + + template + static constexpr bool is_lane_floating(); + // lane number convenience constants extern const u8x64 u8x64_lane_id; extern const u8x32 u8x32_lane_id; @@ -42,6 +56,36 @@ namespace ircd::simd }; } +template +constexpr bool +ircd::simd::is_lane_floating() +{ + return std::is_floating_point>::value; +} + +template +constexpr bool +ircd::simd::is_lane_integral() +{ + return std::is_integral>::value; +} + +template +constexpr bool +ircd::simd::is_lane_same() +{ + return std::is_same>::value; +} + +template +constexpr bool +ircd::simd::is_lane_base_of() +{ + return std::is_base_of>::value; +} + /// Get number of lanes for vector type (the number after the x in the /// type name). template