E.V.E  0.1-beta

Wrapper for SIMD registers. More...

Detailed Description

template<typename Type, typename Cardinal>
struct eve::wide< Type, Cardinal >

Wrapper for SIMD registers.

Required header: #include <eve/wide.hpp>

eve::wide is an architecture-agnostic representation of a IMD register and provides standardized API to access informations, compute values and manipulate such register.

Template Parameters
TypeType of value to store in the register
CardinalCardinal of the register. By default, the best cardinal for current architecture is selected.

Inherits eve::detail::wide_cardinal< Cardinal >, and eve::detail::wide_storage< as_register_t< Type, Cardinal, abi_t< Type, Cardinal > > >.

Public Types

using value_type = Type
 The type stored in the register.
 
using abi_type = abi_t< Type, Cardinal >
 The ABI tag for this register.
 
using storage_type = typename storage_base::storage_type
 The type used for this register storage.
 
using size_type = typename card_base::size_type
 Type for indexing element in a eve::wide.
 
using is_like = value_type
 Opt-in for like concept.
 
template<typename T , typename N = expected_cardinal_t<T>>
using rebind = wide< T, N >
 Generates a eve::wide from a different type T and cardinal N. If unspecified, N is computed as expected_cardinal_t<T>.
 
template<typename N >
using rescale = wide< Type, N >
 Generates a eve::wide type from a different cardinal N.
 
using cardinal_type = Cardinal
 Type describing the number of lanes of current wide.
 

Static Public Member Functions

static constexpr size_type size () noexcept
 Size of the wide in number of lanes.
 
static constexpr size_type max_size () noexcept
 Maximal number of lanes for a given wide.
 
static constexpr bool empty () noexcept
 Check if a wide contains 0 lanes.
 

Public Member Functions

Constructors
 wide ()
 Default constructor This operation is a no-op unless Type satisfies eve::product_type and has a non trivial default constructor.
 
 wide (storage_type const &r) noexcept
 Constructs from ABI-specific storage.
 
template<std::input_iterator It>
 wide (It b, It e) noexcept
 Constructs a eve::wide from a pair of Input Iterator. Construction is done piecewise unless the Input Iterators are Random Access Iterators.
 
template<detail::range Range>
 wide (Range &&r) noexcept
 Constructs a eve::wide from a Container. Construction is done piecewise unless the Input Iterators extracted from r are Random Access Iterators.
 
template<simd_compatible_ptr< wide > Ptr>
 wide (Ptr ptr) noexcept
 Constructs a eve::wide from a SIMD compatible pointer.
 
template<detail::data_source... Ptr>
requires (kumi::product_type<Type>)
 wide (kumi::tuple< Ptr... > ptr) noexcept
 Constructs a eve::wide from a SIMD compatible pointer.
 
template<scalar_value S>
 wide (S const &v) noexcept
 Constructs a eve::wide by splatting a scalar value in all lanes.
 
template<scalar_value S0, scalar_value S1, scalar_value... Ss>
 wide (S0 v0, S1 v1, Ss... vs) noexcept
 Constructs a eve::wide from a sequence of scalar values of proper size.
 
template<simd_value S0, simd_value... Ss>
 wide (S0 v0, Ss... vs) noexcept
 Constructs a eve::wide from a sequence of SIMD product type values.
 
template<std::invocable< size_type, size_type > Generator>
 wide (Generator &&g) noexcept
 Constructs a eve::wide from a Callable Object. More...
 
template<typename Half >
 wide (wide< Type, Half > const &l, wide< Type, Half > const &h) noexcept
 Constructs a eve::wide by combining two eve::wide of half the current cardinal. Does not participate in overload resolution if Cardinal::value != 2 * Half::value.
 
Assignment operators
wideoperator= (wide const &) &=default
 Assignment operator.
 
wideoperator= (storage_type const &r)
 Assignment of an architecture-specific SIMD register.
 
template<scalar_value S>
wideoperator= (S v) noexcept
 Assignment of a scalar value by splatting it in all lanes.
 
Modifiers
void set (std::size_t i, scalar_value auto v) noexcept
 Set the value of a given lane.
 
auto get (std::size_t i) const noexcept
 Retrieve the value from a given lane.
 
auto back () const noexcept
 Retrieve the value of the first lanes.
 
auto front () const noexcept
 Retrieve the value of the first lane.
 
auto slice () const
 Slice a eve::wide into two eve::wide of half cardinal. Does not participate in overload resolution if Cardinal::value == 1. More...
 
template<std::size_t Slice>
auto slice (slice_t< Slice > s) const
 Return the upper or lower half-sized slice of a eve::wide. Does not participate in overload resolution if Cardinal::value == 1. More...
 
void swap (wide &other)
 Exchange this value with another eve::wide.
 
wideoperator++ () noexcept
 Pre-incrementation operator.
 
wideoperator-- () noexcept
 Pre-decrementation operator.
 
wide operator++ (int) noexcept
 Post-incrementation operator.
 
wide operator-- (int) noexcept
 Post-decrementation operator.
 
Indexing and reordering
template<integral_scalar_value Index>
auto operator[] (wide< Index, Cardinal > const &idx) const noexcept
 Dynamic lookup via lane indexing. More...
 
template<std::ptrdiff_t... I>
auto operator[] (pattern_t< I... > p) const noexcept
 Static lookup via lane indexing. More...
 
template<typename F >
auto operator[] (as_pattern< F > p) const noexcept
 Static lookup via procedural lane indexing. More...
 
Interface with architecture-specific intrinsics
storage_type const & storage () const &noexcept
 Retrieve the architecture-specific storage help by wide.
 
storage_typestorage () &noexcept
 Retrieve the architecture-specific storage help by wide.
 
storage_type storage () &&noexcept
 Retrieve the architecture-specific storage help by wide.
 
 operator storage_type const & () const &noexcept
 Implicit conversion to the architecture-specific storage help by wide.
 
 operator storage_type & () &noexcept
 Implicit conversion to the architecture-specific storage help by wide.
 
 operator storage_type () &&noexcept
 Implicit conversion to the architecture-specific storage help by wide.
 

Friends

void swap (wide &lhs, wide &rhs) noexcept
 Swaps the contents of lhs and rhs by calling lhs.swap(rhs).
 
auto operator~ (wide const &v) noexcept
 Perform a bitwise complement on all the wide lanes.
 
template<value V>
auto operator&= (wide &w, V o) noexcept
 Perform a compound bitwise and on all the wide lanes and assign the result to the current one.
 
template<scalar_value U, typename M >
auto operator& (wide const &v, wide< U, M > const &w) noexcept
 Perform a bitwise and between all lanes of two wide instances. Do not participate to overload resolution if both wide doesn't has the same sizeof
 
template<scalar_value S>
auto operator& (wide const &v, S w) noexcept
 Perform a bitwise and between all lanes of a eve::wide and a scalar Do not participate to overload resolution if sizeof(Type) != sizeof(S)
 
template<scalar_value S>
auto operator& (S v, wide const &w) noexcept
 Perform a bitwise and between all lanes of a scalar and a eve::wide Do not participate to overload resolution if sizeof(Type) != sizeof(S)
 
template<value V>
auto operator|= (wide &w, V o) noexcept
 Perform a Compound bitwise or on all the wide lanes and assign the result to the current one.
 
template<scalar_value U, typename M >
auto operator| (wide const &v, wide< U, M > const &w) noexcept
 Perform a bitwise or between all lanes of two wide instances. Do not participate to overload resolution if both wide doesn't has the same sizeof
 
template<scalar_value S>
auto operator| (wide const &v, S w) noexcept
 Perform a bitwise or between all lanes of a scalar and a eve::wide Do not participate to overload resolution if sizeof(Type) != sizeof(S)
 
template<scalar_value S>
auto operator| (S v, wide const &w) noexcept
 Perform a bitwise or between all lanes of a scalar and a eve::wide Do not participate to overload resolution if sizeof(Type) != sizeof(S)
 
template<value V>
auto operator^= (wide &w, V o) noexcept
 Perform a bitwise xor on all the wide lanes and assign the result to the current one.
 
template<scalar_value U, typename M >
auto operator^ (wide const &v, wide< U, M > const &w) noexcept
 Perform a bitwise xor between all lanes of two wide instances. Do not participate to overload resolution if both wide doesn't has the same sizeof
 
template<scalar_value S>
auto operator^ (wide const &v, S w) noexcept
 Perform a bitwise xor between all lanes of a scalar and a eve::wide Do not participate to overload resolution if sizeof(Type) != sizeof(S)
 
template<scalar_value S>
auto operator^ (S v, wide const &w) noexcept
 Perform a bitwise xor between all lanes of a scalar and a eve::wide Do not participate to overload resolution if sizeof(Type) != sizeof(S)
 
auto operator+ (wide const &v) noexcept
 Unary plus operator.
 
auto operator- (wide const &v) noexcept
 Unary minus operator. See also: eve::unary_minus.
 
template<value V>
auto & operator+= (wide &w, V v) noexcept
 Perform the compound addition on all the wide lanes and assign the result to the current one. See also: eve::add.
 
auto operator+ (wide const &v, wide const &w) noexcept
 Perform the addition between all lanes of its parameters See also: eve::add.
 
template<real_scalar_value S>
auto operator+ (S s, wide const &v) noexcept
 Perform the addition between a scalar and all lanes of a eve::wide See also: eve::add.
 
template<real_scalar_value S>
auto operator+ (wide const &v, S s) noexcept
 Perform the addition between all lanes of a eve::wide and a scalar See also: eve::add.
 
template<value V>
auto & operator-= (wide &w, V v) noexcept
 Perform the compound difference on all the wide lanes and assign the result to the current one. See also: eve::sub.
 
auto operator- (wide const &v, wide const &w) noexcept
 Perform the difference between all lanes of its parameters See also: eve::sub.
 
auto operator- (real_scalar_value auto s, wide const &v) noexcept
 Perform the difference between a scalar and all lanes of a eve::wide See also: eve::sub.
 
auto operator- (wide const &v, real_scalar_value auto s) noexcept
 Perform the difference between all lanes of a eve::wide and a scalar See also: eve::sub.
 
auto & operator*= (wide &w, value auto o) noexcept
 Perform the compound product on all the wide lanes and assign the result to the current one. See also: eve::mul.
 
auto operator* (wide const &v, wide const &w) noexcept
 Perform the product between all lanes of its parameters See also: eve::mul.
 
template<real_scalar_value S>
auto operator* (S s, wide const &v) noexcept
 Perform the product between a scalar and all lanes of a eve::wide See also: eve::mul.
 
auto operator* (wide const &v, real_scalar_value auto s) noexcept
 Perform the product between all lanes of a eve::wide and a scalar See also: eve::mul.
 
auto & operator/= (wide &w, value auto o) noexcept
 Perform the compound division on all the wide lanes and assign the result to the current one. See also: eve::div.
 
auto operator/ (wide const &v, wide const &w) noexcept
 Perform the division between all lanes of its parameters See also: eve::div.
 
template<real_scalar_value S>
auto operator/ (S s, wide const &v) noexcept
 Perform the division between a scalar and all lanes of a eve::wide See also: eve::div.
 
template<real_scalar_value S>
auto operator/ (wide const &v, S s) noexcept
 Perform the division between all lanes of a eve::wide and a scalar See also: eve::div.
 
template<integral_value V>
auto & operator%= (wide &w, V o) noexcept
 Perform the compound modulo on all the wide lanes and assign the result to the current one. Does not participate in overload resolution if Type does not models integral_scalar_value.
 
auto operator% (wide const &v, wide const &w) noexcept
 Perform the modulo between all lanes of its parameters. Does not participate in overload resolution if Type does not models integral_scalar_value.
 
template<integral_scalar_value S>
auto operator% (S s, wide const &v) noexcept
 Perform the modulo between a scalar and all lanes of a eve::wide Does not participate in overload resolution if Type does not models integral_scalar_value.
 
auto operator% (wide const &v, integral_scalar_value auto s) noexcept
 Perform the modulo between all lanes of a eve::wide and a scalar Does not participate in overload resolution if Type does not models integral_scalar_value.
 
template<integral_value S>
auto & operator<<= (wide &w, S s) noexcept
 Perform the compound left-shift on all the eve::wide lanes and assign the result to current one.
 
template<integral_value S>
auto operator<< (wide v, S s) noexcept
 Perform the left-shift between all lanes of a eve::wide and an integral scalar.
 
template<integral_value S>
auto & operator>>= (wide &w, S s) noexcept
 Perform the compound right-shift on all the eve::wide lanes and assign the result to current one.
 
template<integral_value S>
auto operator>> (wide v, S s) noexcept
 Perform the right-shift between all lanes of a eve::wide and an integral scalar.
 
auto operator== (wide v, wide w) noexcept
 Element-wise equality comparison of two eve::wide.
 
template<scalar_value S>
auto operator== (wide v, S w) noexcept
 Element-wise equality comparison of a eve::wide and a scalar value.
 
template<scalar_value S>
auto operator== (S v, wide w) noexcept
 Element-wise equality comparison of a scalar value and a eve::wide.
 
auto operator!= (wide v, wide w) noexcept
 Element-wise inequality comparison of two eve::wide.
 
template<scalar_value S>
auto operator!= (wide v, S w) noexcept
 Element-wise inequality comparison of a eve::wide and a scalar value.
 
template<scalar_value S>
auto operator!= (S v, wide w) noexcept
 Element-wise inequality comparison of a scalar value and a eve::wide.
 
auto operator< (wide v, wide w) noexcept
 Element-wise less-than comparison between eve::wide.
 
template<scalar_value S>
auto operator< (wide v, S w) noexcept
 Element-wise less-than comparison between a eve::wide and a scalar.
 
template<scalar_value S>
auto operator< (S v, wide w) noexcept
 Element-wise less-than comparison between a scalar and a eve::wide.
 
auto operator> (wide v, wide w) noexcept
 Element-wise greater-than comparison between eve::wide.
 
template<scalar_value S>
auto operator> (wide v, S w) noexcept
 Element-wise greater-than comparison between a eve::wide and a scalar.
 
template<scalar_value S>
auto operator> (S v, wide w) noexcept
 Element-wise greater-than comparison between a scalar and a eve::wide.
 
auto operator>= (wide v, wide w) noexcept
 Element-wise greater-or-equal comparison between eve::wide.
 
template<scalar_value S>
auto operator>= (wide v, S w) noexcept
 Element-wise greater-or-equal comparison between a eve::wide and a scalar.
 
template<scalar_value S>
auto operator>= (S v, wide w) noexcept
 Element-wise greater-or-equal comparison between a scalar and a eve::wide.
 
auto operator<= (wide v, wide w) noexcept
 Element-wise less-or-equal comparison between eve::wide.
 
template<scalar_value S>
auto operator<= (wide v, S w) noexcept
 Element-wise less-or-equal comparison between a eve::wide and a scalar.
 
template<scalar_value S>
auto operator<= (S v, wide w) noexcept
 Element-wise less-or-equal comparison between a scalar and a eve::wide.
 
logical< wideoperator! (wide v) noexcept
 Computes the logical complement of its parameter.
 
std::ostream & operator<< (std::ostream &os, wide p)
 Inserts a eve::wide into a output stream.