Skip to content

Commit

Permalink
change split_type def
Browse files Browse the repository at this point in the history
  • Loading branch information
SadiinsoSnowfall committed Nov 21, 2024
1 parent 342d23b commit 3dbbbd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
4 changes: 3 additions & 1 deletion include/eve/arch/cpu/logical_wide.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ namespace eve
using combined_type = logical<wide<Type, typename Cardinal::combined_type>>;

//! Type representing a logical wide of the same type but with a cardinal half the size
using split_type = logical<typename wide<Type, Cardinal>::split_type>;
template<typename N = Cardinal>
requires (N::Value > 1)
using split_type = logical<typename wide<Type, N>::split_type>;

//! @brief Generates a eve::wide from a different type `T` and cardinal `N`.
//! If unspecified, `N` is computed as `expected_cardinal_t<T>`.
Expand Down
14 changes: 3 additions & 11 deletions include/eve/arch/cpu/wide.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ namespace eve
struct EVE_MAY_ALIAS wide
: detail::wide_storage<as_register_t<Type, Cardinal, abi_t<Type, Cardinal>>>
{
private:
// split_type does not exist on cardinals of size 1
// this function returns a void_t if the split_type does not exist
template <typename T, typename N>
static constexpr auto get_split_type() noexcept
{
if constexpr (N::value > 1) return wide<T, typename N::split_type>{};
}

public:
using storage_base = detail::wide_storage<as_register_t<Type, Cardinal, abi_t<Type, Cardinal>>>;

//! The type stored in the register.
Expand All @@ -102,7 +92,9 @@ namespace eve
using combined_type = wide<Type, typename Cardinal::combined_type>;

//! Type representing a wide of the same type but with a cardinal half the size
using split_type = decltype(get_split_type<Type, Cardinal>());
template<typename N = Cardinal>
requires (N::Value > 1)
using split_type = wide<Type, typename N::split_type>;

//! @brief Generates a eve::wide from a different type `T` and cardinal `N`.
//! If unspecified, `N` is computed as `expected_cardinal_t<T>`.
Expand Down

0 comments on commit 3dbbbd6

Please sign in to comment.