From 08af376aeed71e3bbef1d9a72a93d2d91dc78f0e Mon Sep 17 00:00:00 2001 From: SadiinsoSnowfall Date: Tue, 4 Feb 2025 15:58:50 +0100 Subject: [PATCH 1/4] 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..3fcce57bff 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; + //================================================================================================ + //! @} + //================================================================================================ } From 9f5b438e67e73a9d3c9943f06934e5efa80de575 Mon Sep 17 00:00:00 2001 From: SadiinsoSnowfall Date: Wed, 5 Feb 2025 14:52:38 +0100 Subject: [PATCH 2/4] fix --- include/eve/module/core/regular/combine.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/eve/module/core/regular/combine.hpp b/include/eve/module/core/regular/combine.hpp index 3fcce57bff..d8df668ae7 100644 --- a/include/eve/module/core/regular/combine.hpp +++ b/include/eve/module/core/regular/combine.hpp @@ -14,9 +14,9 @@ namespace eve { template - struct combine_t : strict_elementwise_callable + struct combine_t : callable { - template + template constexpr EVE_FORCEINLINE typename T::combined_type operator()(T a, T b) const noexcept { return typename T::combined_type{a, b}; From 433e6c0df0fc1d2762f43b1d26b49dc65cfd0a7e Mon Sep 17 00:00:00 2001 From: SadiinsoSnowfall Date: Fri, 7 Feb 2025 12:04:25 +0100 Subject: [PATCH 3/4] update doc --- include/eve/module/core/regular/combine.hpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/include/eve/module/core/regular/combine.hpp b/include/eve/module/core/regular/combine.hpp index d8df668ae7..a3f70a8d5f 100644 --- a/include/eve/module/core/regular/combine.hpp +++ b/include/eve/module/core/regular/combine.hpp @@ -8,8 +8,6 @@ #include #include -#include -#include namespace eve { @@ -27,7 +25,7 @@ namespace eve //! @addtogroup core_simd //! @{ //! @var combine - //! @brief Computes the TODO + //! @brief Combines two SIMD values in a larger one //! //! **Defined in Header** //! @@ -40,19 +38,19 @@ namespace eve //! @code //! namespace eve //! { - //! constexpr auto combine(simd_value a, simd_value b) noexcept; + //! template + //! constexpr W combine(W a, W 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 + //! * `a`, `b`: two SIMD values 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 + //! * A [SIMD value](@ref eve::simd_value) contains the parameters concatenation, thus + //! producing a register of twice as many elements. //! //! @groupheader{Example} //! @godbolt{doc/core/combine.cpp} From 4dac50f349e0a8eb807f34672f85867db9aa0e12 Mon Sep 17 00:00:00 2001 From: SadiinsoSnowfall Date: Fri, 7 Feb 2025 14:53:15 +0100 Subject: [PATCH 4/4] fix doc --- include/eve/module/core/regular/combine.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/eve/module/core/regular/combine.hpp b/include/eve/module/core/regular/combine.hpp index a3f70a8d5f..7b4ae8a135 100644 --- a/include/eve/module/core/regular/combine.hpp +++ b/include/eve/module/core/regular/combine.hpp @@ -39,7 +39,7 @@ namespace eve //! namespace eve //! { //! template - //! constexpr W combine(W a, W b) noexcept; + //! typename W::combined_type combine(W a, W b) noexcept; //! } //! @endcode //!