From 5021048b6bf40c609468baf800cad7b86fb7b498 Mon Sep 17 00:00:00 2001 From: SadiinsoSnowfall Date: Tue, 4 Feb 2025 15:58:50 +0100 Subject: [PATCH] made combine into a new format callable --- include/eve/module/core/regular/combine.hpp | 92 +++++++++++---------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/include/eve/module/core/regular/combine.hpp b/include/eve/module/core/regular/combine.hpp index a37022c60a..ab282490b9 100644 --- a/include/eve/module/core/regular/combine.hpp +++ b/include/eve/module/core/regular/combine.hpp @@ -13,50 +13,52 @@ namespace eve { - //TODO DOC -//================================================================================================ -//! @addtogroup core_simd -//! @{ -//! @var combine -//! @brief Computes the TODO -//! -//! **Defined in Header** -//! -//! @code -//! #include -//! @endcode -//! -//! @groupheader{Callable Signatures} -//! -//! @code -//! namespace eve -//! { -//! TODO -//! } -//! @endcode -//! -//! **Parameters** -//! -//! * `x`: An instance of an [SIMD value](@ref eve::simd_value) -//! -//! **Return value** -//! -//! * TODO -//! -//! @groupheader{Example} -//! -//! @godbolt{doc/core/combine.cpp} -//! @} -//================================================================================================ -EVE_MAKE_CALLABLE(combine_, combine); -} + template + struct combine_t : strict_elementwise_callable + { + template + constexpr EVE_FORCEINLINE typename T::combined_type operator()(T a, T b) const noexcept + { + return typename T::combined_type{a, b}; + } + }; -namespace eve::detail -{ -template -EVE_FORCEINLINE auto -combine_(EVE_SUPPORTS(cpu_), T const& a, T const& b) noexcept -{ - return as_wide_t::combined_type>(a, b); -} + //================================================================================================ + //! @addtogroup core_simd + //! @{ + //! @var combine + //! @brief Computes the TODO + //! + //! **Defined in Header** + //! + //! @code + //! #include + //! @endcode + //! + //! @groupheader{Callable Signatures} + //! + //! @code + //! namespace eve + //! { + //! constexpr auto combine(simd_value a, simd_value b) noexcept; + //! } + //! @endcode + //! + //! **Parameters** + //! + //! * `a`: An instance of a [SIMD value](@ref eve::simd_value) + //! * `b`: An instance of a [SIMD value](@ref eve::simd_value) of the same type and cardinal + //! + //! **Return value** + //! + //! * A [SIMD value](@ref eve::simd_value) of the same type and twice the cardinal of that of + //! the parameters + //! + //! @groupheader{Example} + //! @godbolt{doc/core/combine.cpp} + //================================================================================================ + inline constexpr auto combine = functor; + //================================================================================================ + //! @} + //================================================================================================ }