Skip to content

Commit

Permalink
made combine into a new format callable
Browse files Browse the repository at this point in the history
  • Loading branch information
SadiinsoSnowfall committed Feb 4, 2025
1 parent c998c11 commit 5021048
Showing 1 changed file with 47 additions and 45 deletions.
92 changes: 47 additions & 45 deletions include/eve/module/core/regular/combine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,50 +13,52 @@

namespace eve
{
//TODO DOC
//================================================================================================
//! @addtogroup core_simd
//! @{
//! @var combine
//! @brief Computes the TODO
//!
//! **Defined in Header**
//!
//! @code
//! #include <eve/module/core.hpp>
//! @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<typename Options>
struct combine_t : strict_elementwise_callable<combine_t, Options, almost_option>
{
template<value T>
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<value T>
EVE_FORCEINLINE auto
combine_(EVE_SUPPORTS(cpu_), T const& a, T const& b) noexcept
{
return as_wide_t<T, typename cardinal_t<T>::combined_type>(a, b);
}
//================================================================================================
//! @addtogroup core_simd
//! @{
//! @var combine
//! @brief Computes the TODO
//!
//! **Defined in Header**
//!
//! @code
//! #include <eve/module/core.hpp>
//! @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<combine_t>;
//================================================================================================
//! @}
//================================================================================================
}

0 comments on commit 5021048

Please sign in to comment.