Tuesday
|
The simd
class template and its associated utility structs and functions.
Classes | |
struct | tue::is_simd_component< T > |
Checks if a type can be used as the component type of an SIMD vector. More... | |
struct | tue::is_arithmetic_simd_component< T > |
Checks if a type is an arithmetic type that can be used as the component type of an SIMD vector. More... | |
struct | tue::is_floating_point_simd_component< T > |
Checks if a type is a floating-point type that can be used as the component type of an SIMD vector. More... | |
struct | tue::is_integral_simd_component< T > |
Checks if a type is an integral type that can be used as the component type of an SIMD vector. More... | |
class | tue::simd< T, N > |
An N -component SIMD vector. More... | |
Macros | |
#define | TUE_SSE |
Defined if the current compiler configuration supports SSE intrinsics. More... | |
#define | TUE_SSE2 |
Defined if the current compiler configuration supports SSE2 intrinsics. More... | |
Typedefs | |
template<typename T > | |
using | tue::simd2 = simd< T, 2 > |
A 2-component SIMD vector. More... | |
template<typename T > | |
using | tue::simd4 = simd< T, 4 > |
A 4-component SIMD vector. More... | |
template<typename T > | |
using | tue::simd8 = simd< T, 8 > |
An 8-component SIMD vector. More... | |
template<typename T > | |
using | tue::simd16 = simd< T, 16 > |
A 16-component SIMD vector. More... | |
template<typename T > | |
using | tue::simd32 = simd< T, 32 > |
A 32-component SIMD vector. More... | |
template<typename T > | |
using | tue::simd64 = simd< T, 64 > |
A 64-component SIMD vector. More... | |
using | tue::float32x2 = simd2< float > |
A 2-component SIMD vector with float components. More... | |
using | tue::float32x4 = simd4< float > |
A 4-component SIMD vector with float components. More... | |
using | tue::float32x8 = simd8< float > |
An 8-component SIMD vector with float components. More... | |
using | tue::float32x16 = simd16< float > |
A 16-component SIMD vector with float components. More... | |
using | tue::float64x2 = simd2< double > |
A 2-component SIMD vector with double components. More... | |
using | tue::float64x4 = simd4< double > |
A 4-component SIMD vector with double components. More... | |
using | tue::float64x8 = simd8< double > |
An 8-component SIMD vector with double components. More... | |
using | tue::int8x2 = simd2< std::int8_t > |
A 2-component SIMD vector with std::int8_t components. More... | |
using | tue::int8x4 = simd4< std::int8_t > |
A 4-component SIMD vector with std::int8_t components. More... | |
using | tue::int8x8 = simd8< std::int8_t > |
An 8-component SIMD vector with std::int8_t components. More... | |
using | tue::int8x16 = simd16< std::int8_t > |
A 16-component SIMD vector with std::int8_t components. More... | |
using | tue::int8x32 = simd32< std::int8_t > |
A 32-component SIMD vector with std::int8_t components. More... | |
using | tue::int8x64 = simd64< std::int8_t > |
A 64-component SIMD vector with std::int8_t components. More... | |
using | tue::int16x2 = simd2< std::int16_t > |
A 2-component SIMD vector with std::int16_t components. More... | |
using | tue::int16x4 = simd4< std::int16_t > |
A 4-component SIMD vector with std::int16_t components. More... | |
using | tue::int16x8 = simd8< std::int16_t > |
An 8-component SIMD vector with std::int16_t components. More... | |
using | tue::int16x16 = simd16< std::int16_t > |
A 16-component SIMD vector with std::int16_t components. More... | |
using | tue::int16x32 = simd32< std::int16_t > |
A 32-component SIMD vector with std::int16_t components. More... | |
using | tue::int32x2 = simd2< std::int32_t > |
A 2-component SIMD vector with std::int32_t components. More... | |
using | tue::int32x4 = simd4< std::int32_t > |
A 4-component SIMD vector with std::int32_t components. More... | |
using | tue::int32x8 = simd8< std::int32_t > |
An 8-component SIMD vector with std::int32_t components. More... | |
using | tue::int32x16 = simd16< std::int32_t > |
A 16-component SIMD vector with std::int32_t components. More... | |
using | tue::int64x2 = simd2< std::int64_t > |
A 2-component SIMD vector with std::int64_t components. More... | |
using | tue::int64x4 = simd4< std::int64_t > |
A 4-component SIMD vector with std::int64_t components. More... | |
using | tue::int64x8 = simd8< std::int64_t > |
An 8-component SIMD vector with std::int64_t components. More... | |
using | tue::uint8x2 = simd2< std::uint8_t > |
A 2-component SIMD vector with std::uint8_t components. More... | |
using | tue::uint8x4 = simd4< std::uint8_t > |
A 4-component SIMD vector with std::uint8_t components. More... | |
using | tue::uint8x8 = simd8< std::uint8_t > |
An 8-component SIMD vector with std::uint8_t components. More... | |
using | tue::uint8x16 = simd16< std::uint8_t > |
A 16-component SIMD vector with std::uint8_t components. More... | |
using | tue::uint8x32 = simd32< std::uint8_t > |
A 32-component SIMD vector with std::uint8_t components. More... | |
using | tue::uint8x64 = simd64< std::uint8_t > |
A 64-component SIMD vector with std::uint8_t components. More... | |
using | tue::uint16x2 = simd2< std::uint16_t > |
A 2-component SIMD vector with std::uint16_t components. More... | |
using | tue::uint16x4 = simd4< std::uint16_t > |
A 4-component SIMD vector with std::uint16_t components. More... | |
using | tue::uint16x8 = simd8< std::uint16_t > |
An 8-component SIMD vector with std::uint16_t components. More... | |
using | tue::uint16x16 = simd16< std::uint16_t > |
A 16-component SIMD vector with std::uint16_t components. More... | |
using | tue::uint16x32 = simd32< std::uint16_t > |
A 32-component SIMD vector with std::uint16_t components. More... | |
using | tue::uint32x2 = simd2< std::uint32_t > |
A 2-component SIMD vector with std::uint32_t components. More... | |
using | tue::uint32x4 = simd4< std::uint32_t > |
A 4-component SIMD vector with std::uint32_t components. More... | |
using | tue::uint32x8 = simd8< std::uint32_t > |
An 8-component SIMD vector with std::uint32_t components. More... | |
using | tue::uint32x16 = simd16< std::uint32_t > |
A 16-component SIMD vector with std::uint32_t components. More... | |
using | tue::uint64x2 = simd2< std::uint64_t > |
A 2-component SIMD vector with std::uint64_t components. More... | |
using | tue::uint64x4 = simd4< std::uint64_t > |
A 4-component SIMD vector with std::uint64_t components. More... | |
using | tue::uint64x8 = simd8< std::uint64_t > |
An 8-component SIMD vector with std::uint64_t components. More... | |
using | tue::bool8x2 = simd2< bool8 > |
A 2-component SIMD vector with bool8 components. More... | |
using | tue::bool8x4 = simd4< bool8 > |
A 4-component SIMD vector with bool8 components. More... | |
using | tue::bool8x8 = simd8< bool8 > |
An 8-component SIMD vector with bool8 components. More... | |
using | tue::bool8x16 = simd16< bool8 > |
A 16-component SIMD vector with bool8 components. More... | |
using | tue::bool8x32 = simd32< bool8 > |
A 32-component SIMD vector with bool8 components. More... | |
using | tue::bool8x64 = simd64< bool8 > |
A 64-component SIMD vector with bool8 components. More... | |
using | tue::bool16x2 = simd2< bool16 > |
A 2-component SIMD vector with bool16 components. More... | |
using | tue::bool16x4 = simd4< bool16 > |
A 4-component SIMD vector with bool16 components. More... | |
using | tue::bool16x8 = simd8< bool16 > |
An 8-component SIMD vector with bool16 components. More... | |
using | tue::bool16x16 = simd16< bool16 > |
A 16-component SIMD vector with bool16 components. More... | |
using | tue::bool16x32 = simd32< bool16 > |
A 32-component SIMD vector with bool16 components. More... | |
using | tue::bool32x2 = simd2< bool32 > |
A 2-component SIMD vector with bool32 components. More... | |
using | tue::bool32x4 = simd4< bool32 > |
A 4-component SIMD vector with bool32 components. More... | |
using | tue::bool32x8 = simd8< bool32 > |
An 8-component SIMD vector with bool32 components. More... | |
using | tue::bool32x16 = simd16< bool32 > |
A 16-component SIMD vector with bool32 components. More... | |
using | tue::bool64x2 = simd2< bool64 > |
A 2-component SIMD vector with bool64 components. More... | |
using | tue::bool64x4 = simd4< bool64 > |
A 4-component SIMD vector with bool64 components. More... | |
using | tue::bool64x8 = simd8< bool64 > |
An 8-component SIMD vector with bool64 components. More... | |
Functions | |
template<typename T , int N> | |
std::enable_if_t< std::is_signed< T >::value, simd< T, N > > | tue::operator+ (const simd< T, N > &s) noexcept |
Computes the unary plus of each component of s . More... | |
template<typename T , int N> | |
simd< T, N > & | tue::operator++ (simd< T, N > &s) noexcept |
Pre-increments each component of s . More... | |
template<typename T , int N> | |
simd< T, N > | tue::operator++ (simd< T, N > &s, int) noexcept |
Post-increments each component of s . More... | |
template<typename T , int N> | |
std::enable_if_t< std::is_signed< T >::value, simd< T, N > > | tue::operator- (const simd< T, N > &s) noexcept |
Computes the unary minus of each component of s . More... | |
template<typename T , int N> | |
simd< T, N > & | tue::operator-- (simd< T, N > &s) noexcept |
Pre-decrements each component of s . More... | |
template<typename T , int N> | |
simd< T, N > | tue::operator-- (simd< T, N > &s, int) noexcept |
Post-decrements each component of s . More... | |
template<typename T , int N> | |
simd< T, N > | tue::operator~ (const simd< T, N > &s) noexcept |
Computes the bitwise NOT of each component of s . More... | |
template<typename T , int N> | |
simd< T, N > | tue::operator+ (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Computes the sums of each component of lhs and each corresponding component of rhs . More... | |
template<typename T , int N> | |
simd< T, N > | tue::operator- (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Computes the differences between each component of lhs and each corresponding component of rhs . More... | |
template<typename T , int N> | |
simd< T, N > | tue::operator* (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Computes the products of each component of lhs and each corresponding component of rhs . More... | |
template<typename T , int N> | |
simd< T, N > | tue::operator/ (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Computes the quotients of each component of lhs over each corresponding component of rhs . More... | |
template<typename T , int N> | |
simd< T, N > | tue::operator% (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Computes the modulos of each component of lhs over each corresponding component of rhs . More... | |
template<typename T , int N> | |
simd< T, N > | tue::operator& (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Computes the bitwise AND of each component of lhs and each corresponding component of rhs . More... | |
template<typename T , int N> | |
simd< T, N > | tue::operator| (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Computes the bitwise OR of each component of lhs and each corresponding component of rhs . More... | |
template<typename T , int N> | |
simd< T, N > | tue::operator^ (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Computes the bitwise XOR of each component of lhs and each corresponding component of rhs . More... | |
template<typename T , int N> | |
simd< T, N > | tue::operator<< (const simd< T, N > &lhs, int rhs) noexcept |
Computes the bitwise shifts left of each component of lhs by rhs . More... | |
template<typename T , int N> | |
simd< T, N > | tue::operator>> (const simd< T, N > &lhs, int rhs) noexcept |
Computes the bitwise shifts right of each component of lhs by rhs . More... | |
template<typename T , int N> | |
simd< T, N > & | tue::operator+= (simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Adds each component of rhs to each corresponding component of lhs . More... | |
template<typename T , int N> | |
simd< T, N > & | tue::operator-= (simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Subtracts each component of rhs from each corresponding component of lhs . More... | |
template<typename T , int N> | |
simd< T, N > & | tue::operator*= (simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Multiplies each component of lhs by each corresponding component of rhs . More... | |
template<typename T , int N> | |
simd< T, N > & | tue::operator/= (simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Divides each component of lhs by each corresponding component of rhs . More... | |
template<typename T , int N> | |
simd< T, N > & | tue::operator%= (simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Modulos each component of lhs by each corresponding component of rhs . More... | |
template<typename T , int N> | |
simd< T, N > & | tue::operator&= (simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Bitwise ANDs each component of lhs with each corresponding component of rhs . More... | |
template<typename T , int N> | |
simd< T, N > & | tue::operator|= (simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Bitwise ORs each component of lhs with each corresponding component of rhs . More... | |
template<typename T , int N> | |
simd< T, N > & | tue::operator^= (simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Bitwise XORs each component of lhs with each corresponding component of rhs . More... | |
template<typename T , int N> | |
simd< T, N > & | tue::operator<<= (simd< T, N > &lhs, int rhs) noexcept |
Bitwise shifts left each component of lhs by rhs . More... | |
template<typename T , int N> | |
simd< T, N > & | tue::operator>>= (simd< T, N > &lhs, int rhs) noexcept |
Bitwise shifts right each component of lhs by rhs . More... | |
template<typename T , int N> | |
bool | tue::operator== (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Determines whether or not two simd 's compare equal. More... | |
template<typename T , int N> | |
bool | tue::operator!= (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Determines whether or not two simd 's compare not equal. More... | |
template<typename T , int N> | |
std::enable_if_t< std::is_floating_point< T >::value, simd< T, N > > | tue::math::sin (const simd< T, N > &s) noexcept |
Computes tue::math::sin() for each component of s . More... | |
template<typename T , int N> | |
std::enable_if_t< std::is_floating_point< T >::value, simd< T, N > > | tue::math::cos (const simd< T, N > &s) noexcept |
Computes tue::math::cos() for each component of s . More... | |
template<typename T , int N> | |
std::enable_if_t< std::is_floating_point< T >::value > | tue::math::sincos (const simd< T, N > &s, simd< T, N > &sin_out, simd< T, N > &cos_out) noexcept |
Computes tue::math::sincos() for each component of s . More... | |
template<typename T , int N> | |
std::enable_if_t< std::is_floating_point< T >::value, simd< T, N > > | tue::math::exp (const simd< T, N > &s) noexcept |
Computes tue::math::exp() for each component of s . More... | |
template<typename T , int N> | |
std::enable_if_t< std::is_floating_point< T >::value, simd< T, N > > | tue::math::log (const simd< T, N > &s) noexcept |
Computes tue::math::log() for each component of s . More... | |
template<typename T , int N> | |
std::enable_if_t< std::is_arithmetic< T >::value, simd< T, N > > | tue::math::abs (const simd< T, N > &s) noexcept |
Computes tue::math::abs() for each component of s . More... | |
template<typename T , int N> | |
std::enable_if_t< std::is_floating_point< T >::value, simd< T, N > > | tue::math::pow (const simd< T, N > &bases, const simd< T, N > &exponents) noexcept |
Computes tue::math::pow() for each component of bases and each corresponding component of exponents . More... | |
template<typename T , int N> | |
std::enable_if_t< std::is_floating_point< T >::value, simd< T, N > > | tue::math::recip (const simd< T, N > &s) noexcept |
Computes tue::math::recip() for each component of s . More... | |
template<typename T , int N> | |
std::enable_if_t< std::is_floating_point< T >::value, simd< T, N > > | tue::math::sqrt (const simd< T, N > &s) noexcept |
Computes tue::math::sqrt() for each component of s . More... | |
template<typename T , int N> | |
std::enable_if_t< std::is_floating_point< T >::value, simd< T, N > > | tue::math::rsqrt (const simd< T, N > &s) noexcept |
Computes tue::math::rsqrt() for each component of s . More... | |
template<typename T , int N> | |
std::enable_if_t< std::is_arithmetic< T >::value, simd< T, N > > | tue::math::min (const simd< T, N > &s1, const simd< T, N > &s2) noexcept |
Computes tue::math::min() for each corresponding pair of components from s1 and s2 . More... | |
template<typename T , int N> | |
std::enable_if_t< std::is_arithmetic< T >::value, simd< T, N > > | tue::math::max (const simd< T, N > &s1, const simd< T, N > &s2) noexcept |
Computes tue::math::max() for each corresponding pair of components from s1 and s2 . More... | |
template<typename T , typename U , int N> | |
std::enable_if_t< is_sized_bool< T >::value &&sizeof(T)==sizeof(U), simd< U, N > > | tue::math::mask (const simd< T, N > &conditions, const simd< U, N > &values) noexcept |
Computes tue::math::mask() for each corresponding pair of components from conditions and values . More... | |
template<typename T , typename U , int N> | |
std::enable_if_t< is_sized_bool< T >::value &&sizeof(T)==sizeof(U), simd< U, N > > | tue::math::select (const simd< T, N > &conditions, const simd< U, N > &values, const simd< U, N > &otherwise) noexcept |
Computes tue::math::select() for each corresponding trio of components from conditions , values , and otherwise . More... | |
template<typename T , int N> | |
simd< sized_bool_t< sizeof(T)>, N > | tue::math::less (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Computes tue::math::less() for each corresponding pair of components from lhs and rhs . More... | |
template<typename T , int N> | |
simd< sized_bool_t< sizeof(T)>, N > | tue::math::less_equal (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Computes tue::math::less_equal() for each corresponding pair of components from lhs and rhs . More... | |
template<typename T , int N> | |
simd< sized_bool_t< sizeof(T)>, N > | tue::math::greater (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Computes tue::math::greater() for each corresponding pair of components from lhs and rhs . More... | |
template<typename T , int N> | |
simd< sized_bool_t< sizeof(T)>, N > | tue::math::greater_equal (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Computes tue::math::greater_equal() for each corresponding pair of components from lhs and rhs . More... | |
template<typename T , int N> | |
simd< sized_bool_t< sizeof(T)>, N > | tue::math::equal (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Computes tue::math::equal() for each corresponding pair of components from lhs and rhs . More... | |
template<typename T , int N> | |
simd< sized_bool_t< sizeof(T)>, N > | tue::math::not_equal (const simd< T, N > &lhs, const simd< T, N > &rhs) noexcept |
Computes tue::math::not_equal() for each corresponding pair of components from lhs and rhs . More... | |
struct tue::is_simd_component |
Checks if a type can be used as the component type of an SIMD vector.
Extends std::integral_constant<bool, true>
for the following types and std::integral_constant<bool, false>
otherwise:
float
double
std::int8_t
std::int16_t
std::int32_t
std::int64_t
std::uint8_t
std::uint16_t
std::uint32_t
std::uint64_t
tue::bool8
tue::bool16
tue::bool32
tue::bool64
T | The type to check. |
struct tue::is_arithmetic_simd_component |
Checks if a type is an arithmetic type that can be used as the component type of an SIMD vector.
Extends std::integral_constant<bool, true>
for the following types and std::integral_constant<bool, false>
otherwise:
float
double
std::int8_t
std::int16_t
std::int32_t
std::int64_t
std::uint8_t
std::uint16_t
std::uint32_t
std::uint64_t
T | The type to check. |
struct tue::is_floating_point_simd_component |
Checks if a type is a floating-point type that can be used as the component type of an SIMD vector.
Extends std::integral_constant<bool, true>
for the following types and std::integral_constant<bool, false>
otherwise:
float
double
T | The type to check. |
struct tue::is_integral_simd_component |
Checks if a type is an integral type that can be used as the component type of an SIMD vector.
Extends std::integral_constant<bool, true>
for the following types and std::integral_constant<bool, false>
otherwise:
std::int8_t
std::int16_t
std::int32_t
std::int64_t
std::uint8_t
std::uint16_t
std::uint32_t
std::uint64_t
T | The type to check. |
class tue::simd |
An N
-component SIMD vector.
simd
has the same size requirements as T[N]
and its alignment equals its size. It's accelerated by compiler and architecture-specific SIMD intrinsics where possible, but compatibility fallbacks are always available otherwise.
simd
types may contain platform-specific implicit constructors and conversion operators for converting to and from the underlying SIMD intrinsic type. The current mapping is as follows:
SSE
simd Type | SIMD Intrinsic |
---|---|
bool32x4 | __m128 |
float32x4 | __m128 |
SSE2
simd Type | SIMD Intrinsic |
---|---|
bool8x16 | __m128i |
bool16x8 | __m128i |
bool32x4 | __m128i and __m128 |
bool64x2 | __m128i and __m128d |
int8x16 | __m128i |
int16x8 | __m128i |
int32x4 | __m128i |
int64x2 | __m128i |
uint8x16 | __m128i |
uint16x8 | __m128i |
uint32x4 | __m128i |
uint64x2 | __m128i |
float32x4 | __m128 |
float64x2 | __m128d |
T | The component type. is_simd_component<T>value must be true . |
N | The component count. Must be 2 , 4 , 8 , 16 , 32 , or 64 . |
Public Types | |
using | component_type = T |
This simd type's component type. More... | |
Static Public Attributes | |
static constexpr int | component_count = N |
This simd type's component count. More... | |
static constexpr bool | is_accelerated = false |
Whether or not this type is accelerated by SIMD intrinsics. More... | |
Constructors, Conversions, and Factory Functions | |
simd () noexcept=default | |
Default constructs each component. More... | |
simd (T x) noexcept | |
Constructs each component with the same value. More... | |
template<int M = N, typename = std::enable_if_t<M == 2>> | |
simd (T x, T y) noexcept | |
Constructs each component with the value of the corresponding argument. More... | |
template<int M = N, typename = std::enable_if_t<M == 4>> | |
simd (T x, T y, T z, T w) noexcept | |
Constructs each component with the value of the corresponding argument. More... | |
template<int M = N, typename = std::enable_if_t<M == 8>> | |
simd (T s0, T s1, T s2, T s3, T s4, T s5, T s6, T s7) noexcept | |
Constructs each component with the value of the corresponding argument. More... | |
template<int M = N, typename = std::enable_if_t<M == 16>> | |
simd (T s0, T s1, T s2, T s3, T s4, T s5, T s6, T s7, T s8, T s9, T s10, T s11, T s12, T s13, T s14, T s15) noexcept | |
Constructs each component with the value of the corresponding argument. More... | |
template<typename U > | |
simd (const simd< U, N > &s) noexcept | |
Explicitly casts another simd to a new component type. More... | |
static simd< T, N > | zero () noexcept |
Returns an simd with each component set to 0 . More... | |
static simd< T, N > | load (const T *data) noexcept |
Loads the given aligned component array into a new simd . More... | |
static simd< T, N > | loadu (const T *data) noexcept |
Loads the given unaligned component array into a new simd . More... | |
Public Member Functions | |
void | store (T *data) const noexcept |
Store's this simd 's underlying component array in the given aligned component array. More... | |
void | storeu (T *data) const noexcept |
Store's this simd 's underlying component array in the given unaligned component array. More... | |
const T * | data () const noexcept |
Returns a pointer to this simd 's underlying component array. More... | |
T * | data () noexcept |
Returns a pointer to this simd 's underlying component array. More... | |
using tue::simd< T, N >::component_type = T |
This simd
type's component type.
|
static |
This simd
type's component count.
|
static |
Whether or not this type is accelerated by SIMD intrinsics.
Default constructs each component.
Constructs each component with the same value.
x | The value to construct each component with. |
|
inlinenoexcept |
Constructs each component with the value of the corresponding argument.
This overload is only available when N
equals 2
.
x | The value to construct the first component with. |
y | The value to construct the second component with. |
|
inlinenoexcept |
Constructs each component with the value of the corresponding argument.
This overload is only available when N
equals 4
.
x | The value to construct the first component with. |
y | The value to construct the second component with. |
z | The value to construct the third component with. |
w | The value to construct the fourth component with. |
|
inlinenoexcept |
Constructs each component with the value of the corresponding argument.
This overload is only available when N
equals 8
.
s0 | The value to construct the first component with. |
s1 | The value to construct the second component with. |
s2 | The value to construct the third component with. |
s3 | The value to construct the fourth component with. |
s4 | The value to construct the fifth component with. |
s5 | The value to construct the sixth component with. |
s6 | The value to construct the seventh component with. |
s7 | The value to construct the eighth component with. |
|
inlinenoexcept |
Constructs each component with the value of the corresponding argument.
This overload is only available when N
equals 16
.
s0 | The value to construct the first component with. |
s1 | The value to construct the second component with. |
s2 | The value to construct the third component with. |
s3 | The value to construct the fourth component with. |
s4 | The value to construct the fifth component with. |
s5 | The value to construct the sixth component with. |
s6 | The value to construct the seventh component with. |
s7 | The value to construct the eighth component with. |
s8 | The value to construct the ninth component with. |
s9 | The value to construct the tenth component with. |
s10 | The value to construct the eleventh component with. |
s11 | The value to construct the twelfth component with. |
s12 | The value to construct the thirteenth component with. |
s13 | The value to construct the fourteenth component with. |
s14 | The value to construct the fifteenth component with. |
s15 | The value to construct the sixteenth component with. |
|
inlineexplicitnoexcept |
Explicitly casts another simd
to a new component type.
U | The component type of s . |
s | The simd to cast from. |
Returns an simd
with each component set to 0
.
simd
with each component set to 0
.
|
inlinestaticnoexcept |
Loads the given aligned component array into a new simd
.
The source array must have the same alignment as this simd
type. If the source array is null, unaligned, or doesn't contain at least N
components, behavior is undefined.
data | The source component array. |
simd
.
|
inlinestaticnoexcept |
Loads the given unaligned component array into a new simd
.
If the source array is null or doesn't contain at least N
components, behavior is undefined.
data | The source component array. |
simd
.
|
inlinenoexcept |
Store's this simd
's underlying component array in the given aligned component array.
The destination array must have the same alignment as this simd
type. If the destination array is null, unaligned, or doesn't contain room for all N
components, behavior is undefined.
data | The destination component array. |
|
inlinenoexcept |
Store's this simd
's underlying component array in the given unaligned component array.
If the destination array is null or doesn't contain room for all N
components, behavior is undefined.
data | The destination component array. |
|
inlinenoexcept |
Returns a pointer to this simd
's underlying component array.
simd
's underlying component array.
|
inlinenoexcept |
Returns a pointer to this simd
's underlying component array.
simd
's underlying component array. #define TUE_SSE |
Defined if the current compiler configuration supports SSE intrinsics.
#define TUE_SSE2 |
Defined if the current compiler configuration supports SSE2 intrinsics.
using tue::simd2 = typedef simd<T, 2> |
A 2-component SIMD vector.
T | The component type. |
using tue::simd4 = typedef simd<T, 4> |
A 4-component SIMD vector.
T | The component type. |
using tue::simd8 = typedef simd<T, 8> |
An 8-component SIMD vector.
T | The component type. |
using tue::simd16 = typedef simd<T, 16> |
A 16-component SIMD vector.
T | The component type. |
using tue::simd32 = typedef simd<T, 32> |
A 32-component SIMD vector.
T | The component type. |
using tue::simd64 = typedef simd<T, 64> |
A 64-component SIMD vector.
T | The component type. |
using tue::float32x2 = typedef simd2<float> |
A 2-component SIMD vector with float
components.
using tue::float32x4 = typedef simd4<float> |
A 4-component SIMD vector with float
components.
using tue::float32x8 = typedef simd8<float> |
An 8-component SIMD vector with float
components.
using tue::float32x16 = typedef simd16<float> |
A 16-component SIMD vector with float
components.
using tue::float64x2 = typedef simd2<double> |
A 2-component SIMD vector with double
components.
using tue::float64x4 = typedef simd4<double> |
A 4-component SIMD vector with double
components.
using tue::float64x8 = typedef simd8<double> |
An 8-component SIMD vector with double
components.
using tue::int8x2 = typedef simd2<std::int8_t> |
A 2-component SIMD vector with std::int8_t
components.
using tue::int8x4 = typedef simd4<std::int8_t> |
A 4-component SIMD vector with std::int8_t
components.
using tue::int8x8 = typedef simd8<std::int8_t> |
An 8-component SIMD vector with std::int8_t
components.
using tue::int8x16 = typedef simd16<std::int8_t> |
A 16-component SIMD vector with std::int8_t
components.
using tue::int8x32 = typedef simd32<std::int8_t> |
A 32-component SIMD vector with std::int8_t
components.
using tue::int8x64 = typedef simd64<std::int8_t> |
A 64-component SIMD vector with std::int8_t
components.
using tue::int16x2 = typedef simd2<std::int16_t> |
A 2-component SIMD vector with std::int16_t
components.
using tue::int16x4 = typedef simd4<std::int16_t> |
A 4-component SIMD vector with std::int16_t
components.
using tue::int16x8 = typedef simd8<std::int16_t> |
An 8-component SIMD vector with std::int16_t
components.
using tue::int16x16 = typedef simd16<std::int16_t> |
A 16-component SIMD vector with std::int16_t
components.
using tue::int16x32 = typedef simd32<std::int16_t> |
A 32-component SIMD vector with std::int16_t
components.
using tue::int32x2 = typedef simd2<std::int32_t> |
A 2-component SIMD vector with std::int32_t
components.
using tue::int32x4 = typedef simd4<std::int32_t> |
A 4-component SIMD vector with std::int32_t
components.
using tue::int32x8 = typedef simd8<std::int32_t> |
An 8-component SIMD vector with std::int32_t
components.
using tue::int32x16 = typedef simd16<std::int32_t> |
A 16-component SIMD vector with std::int32_t
components.
using tue::int64x2 = typedef simd2<std::int64_t> |
A 2-component SIMD vector with std::int64_t
components.
using tue::int64x4 = typedef simd4<std::int64_t> |
A 4-component SIMD vector with std::int64_t
components.
using tue::int64x8 = typedef simd8<std::int64_t> |
An 8-component SIMD vector with std::int64_t
components.
using tue::uint8x2 = typedef simd2<std::uint8_t> |
A 2-component SIMD vector with std::uint8_t
components.
using tue::uint8x4 = typedef simd4<std::uint8_t> |
A 4-component SIMD vector with std::uint8_t
components.
using tue::uint8x8 = typedef simd8<std::uint8_t> |
An 8-component SIMD vector with std::uint8_t
components.
using tue::uint8x16 = typedef simd16<std::uint8_t> |
A 16-component SIMD vector with std::uint8_t
components.
using tue::uint8x32 = typedef simd32<std::uint8_t> |
A 32-component SIMD vector with std::uint8_t
components.
using tue::uint8x64 = typedef simd64<std::uint8_t> |
A 64-component SIMD vector with std::uint8_t
components.
using tue::uint16x2 = typedef simd2<std::uint16_t> |
A 2-component SIMD vector with std::uint16_t
components.
using tue::uint16x4 = typedef simd4<std::uint16_t> |
A 4-component SIMD vector with std::uint16_t
components.
using tue::uint16x8 = typedef simd8<std::uint16_t> |
An 8-component SIMD vector with std::uint16_t
components.
using tue::uint16x16 = typedef simd16<std::uint16_t> |
A 16-component SIMD vector with std::uint16_t
components.
using tue::uint16x32 = typedef simd32<std::uint16_t> |
A 32-component SIMD vector with std::uint16_t
components.
using tue::uint32x2 = typedef simd2<std::uint32_t> |
A 2-component SIMD vector with std::uint32_t
components.
using tue::uint32x4 = typedef simd4<std::uint32_t> |
A 4-component SIMD vector with std::uint32_t
components.
using tue::uint32x8 = typedef simd8<std::uint32_t> |
An 8-component SIMD vector with std::uint32_t
components.
using tue::uint32x16 = typedef simd16<std::uint32_t> |
A 16-component SIMD vector with std::uint32_t
components.
using tue::uint64x2 = typedef simd2<std::uint64_t> |
A 2-component SIMD vector with std::uint64_t
components.
using tue::uint64x4 = typedef simd4<std::uint64_t> |
A 4-component SIMD vector with std::uint64_t
components.
using tue::uint64x8 = typedef simd8<std::uint64_t> |
An 8-component SIMD vector with std::uint64_t
components.
using tue::bool8x2 = typedef simd2<bool8> |
A 2-component SIMD vector with bool8
components.
using tue::bool8x4 = typedef simd4<bool8> |
A 4-component SIMD vector with bool8
components.
using tue::bool8x8 = typedef simd8<bool8> |
An 8-component SIMD vector with bool8
components.
using tue::bool8x16 = typedef simd16<bool8> |
A 16-component SIMD vector with bool8
components.
using tue::bool8x32 = typedef simd32<bool8> |
A 32-component SIMD vector with bool8
components.
using tue::bool8x64 = typedef simd64<bool8> |
A 64-component SIMD vector with bool8
components.
using tue::bool16x2 = typedef simd2<bool16> |
A 2-component SIMD vector with bool16
components.
using tue::bool16x4 = typedef simd4<bool16> |
A 4-component SIMD vector with bool16
components.
using tue::bool16x8 = typedef simd8<bool16> |
An 8-component SIMD vector with bool16
components.
using tue::bool16x16 = typedef simd16<bool16> |
A 16-component SIMD vector with bool16
components.
using tue::bool16x32 = typedef simd32<bool16> |
A 32-component SIMD vector with bool16
components.
using tue::bool32x2 = typedef simd2<bool32> |
A 2-component SIMD vector with bool32
components.
using tue::bool32x4 = typedef simd4<bool32> |
A 4-component SIMD vector with bool32
components.
using tue::bool32x8 = typedef simd8<bool32> |
An 8-component SIMD vector with bool32
components.
using tue::bool32x16 = typedef simd16<bool32> |
A 16-component SIMD vector with bool32
components.
using tue::bool64x2 = typedef simd2<bool64> |
A 2-component SIMD vector with bool64
components.
using tue::bool64x4 = typedef simd4<bool64> |
A 4-component SIMD vector with bool64
components.
using tue::bool64x8 = typedef simd8<bool64> |
An 8-component SIMD vector with bool64
components.
|
inlinenoexcept |
Computes the unary plus of each component of s
.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
s
.
|
inlinenoexcept |
Pre-increments each component of s
.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
s
.
|
inlinenoexcept |
Post-increments each component of s
.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
s
before being incremented.
|
inlinenoexcept |
Computes the unary minus of each component of s
.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
s
.
|
inlinenoexcept |
Pre-decrements each component of s
.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
s
.
|
inlinenoexcept |
Post-decrements each component of s
.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
s
before being decremented.
|
inlinenoexcept |
Computes the bitwise NOT of each component of s
.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
s
.
|
inlinenoexcept |
Computes the sums of each component of lhs
and each corresponding component of rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
and each corresponding component of rhs
.
|
inlinenoexcept |
Computes the differences between each component of lhs
and each corresponding component of rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
and each corresponding component of rhs
.
|
inlinenoexcept |
Computes the products of each component of lhs
and each corresponding component of rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
and each corresponding component of rhs
.
|
inlinenoexcept |
Computes the quotients of each component of lhs
over each corresponding component of rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
over each corresponding component of rhs
.
|
inlinenoexcept |
Computes the modulos of each component of lhs
over each corresponding component of rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
over each corresponding component of rhs
.
|
inlinenoexcept |
Computes the bitwise AND of each component of lhs
and each corresponding component of rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
and each corresponding component of rhs
.
|
inlinenoexcept |
Computes the bitwise OR of each component of lhs
and each corresponding component of rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
and each corresponding component of rhs
.
|
inlinenoexcept |
Computes the bitwise XOR of each component of lhs
and each corresponding component of rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
and each corresponding component of rhs
.
|
inlinenoexcept |
Computes the bitwise shifts left of each component of lhs
by rhs
.
T | The component type of lhs . |
N | The component count of lhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
by rhs
.
|
inlinenoexcept |
Computes the bitwise shifts right of each component of lhs
by rhs
.
T | The component type of lhs . |
N | The component count of lhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
by rhs
.
|
inlinenoexcept |
Adds each component of rhs
to each corresponding component of lhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
.
|
inlinenoexcept |
Subtracts each component of rhs
from each corresponding component of lhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
.
|
inlinenoexcept |
Multiplies each component of lhs
by each corresponding component of rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
.
|
inlinenoexcept |
Divides each component of lhs
by each corresponding component of rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
.
|
inlinenoexcept |
Modulos each component of lhs
by each corresponding component of rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
.
|
inlinenoexcept |
Bitwise ANDs each component of lhs
with each corresponding component of rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
.
|
inlinenoexcept |
Bitwise ORs each component of lhs
with each corresponding component of rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
.
|
inlinenoexcept |
Bitwise XORs each component of lhs
with each corresponding component of rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
.
|
inlinenoexcept |
Bitwise shifts left each component of lhs
by rhs
.
T | The component type of lhs . |
N | The component count of lhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
.
|
inlinenoexcept |
Bitwise shifts right each component of lhs
by rhs
.
T | The component type of lhs . |
N | The component count of lhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
lhs
.
|
inlinenoexcept |
Determines whether or not two simd
's compare equal.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
true
if all the corresponding pairs of components compare equal and false
otherwise.
|
inlinenoexcept |
Determines whether or not two simd
's compare not equal.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
true
if at least one of the corresponding pairs of components compares not equal and false
otherwise.
|
inlinenoexcept |
Computes tue::math::sin()
for each component of s
.
The results may not match tue::math::sin()
exactly, but will at least approximate the same values.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
tue::math::sin()
for each component of s
.
|
inlinenoexcept |
Computes tue::math::cos()
for each component of s
.
The results may not match tue::math::cos()
exactly, but will at least approximate the same values.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
tue::math::cos()
for each component of s
.
|
inlinenoexcept |
Computes tue::math::sincos()
for each component of s
.
The results may not match tue::math::sincos()
exactly, but will at least approximate the same values.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
sin_out | A reference to the simd to store the sin() results in. |
cos_out | A reference to the simd to store the cos() results in. |
|
inlinenoexcept |
Computes tue::math::exp()
for each component of s
.
The results may not match tue::math::exp()
exactly, but will at least approximate the same values.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
tue::math::exp()
for each component of s
.
|
inlinenoexcept |
Computes tue::math::log()
for each component of s
.
The results may not match tue::math::log()
exactly, but will at least approximate the same values.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
tue::math::log()
for each component of s
.
|
inlinenoexcept |
Computes tue::math::abs()
for each component of s
.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
tue::math::abs()
for each component of s
.
|
inlinenoexcept |
Computes tue::math::pow()
for each component of bases
and each corresponding component of exponents
.
The results may not match tue::math::pow()
exactly, but will at least approximate the same values.
T | The component type of both bases and exponents . |
N | The component count of both bases and exponents . |
bases | The bases. |
exponents | The exponents. |
tue::math::pow()
for each component of bases
and each corresponding component of exponents
.
|
inlinenoexcept |
Computes tue::math::recip()
for each component of s
.
The results may not match tue::math::recip()
exactly, but will at least approximate the same values.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
tue::math::recip()
for each component of s
.
|
inlinenoexcept |
Computes tue::math::sqrt()
for each component of s
.
The results may not match tue::math::sqrt()
exactly, but will at least approximate the same values.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
tue::math::sqrt()
for each component of s
.
|
inlinenoexcept |
Computes tue::math::rsqrt()
for each component of s
.
The results may not match tue::math::rsqrt()
exactly, but will at least approximate the same values.
T | The component type of s . |
N | The component count of s . |
s | An simd . |
tue::math::rsqrt()
for each component of s
.
|
inlinenoexcept |
Computes tue::math::min()
for each corresponding pair of components from s1
and s2
.
T | The component type of both s1 and s2 . |
N | The component count of both s1 and s2 . |
s1 | An simd . |
s2 | Another simd . |
tue::math::min()
for each corresponding pair of components from s1
and s2
.
|
inlinenoexcept |
Computes tue::math::max()
for each corresponding pair of components from s1
and s2
.
T | The component type of both s1 and s2 . |
N | The component count of both s1 and s2 . |
s1 | An simd . |
s2 | Another simd . |
tue::math::max()
for each corresponding pair of components from s1
and s2
.
|
inlinenoexcept |
Computes tue::math::mask()
for each corresponding pair of components from conditions
and values
.
T | The component type of conditions . |
U | The component type of values . |
N | The component count of both conditions and values . |
conditions | An simd . |
values | Another simd . |
tue::math::mask()
for each corresponding pair of components from conditions
and values
.
|
inlinenoexcept |
Computes tue::math::select()
for each corresponding trio of components from conditions
, values
, and otherwise
.
T | The component type of conditions . |
U | The component type of values and otherwise . |
N | The component count of all three parameters. |
conditions | An simd . |
values | Another simd . |
otherwise | Another simd . |
tue::math::select()
for each corresponding trio of components from conditions
, values
, and otherwise
.
|
inlinenoexcept |
Computes tue::math::less()
for each corresponding pair of components from lhs
and rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
tue::math::less()
for each corresponding pair of components from lhs
and rhs
.
|
inlinenoexcept |
Computes tue::math::less_equal()
for each corresponding pair of components from lhs
and rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
tue::math::less_equal()
for each corresponding pair of components from lhs
and rhs
.
|
inlinenoexcept |
Computes tue::math::greater()
for each corresponding pair of components from lhs
and rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
tue::math::greater()
for each corresponding pair of components from lhs
and rhs
.
|
inlinenoexcept |
Computes tue::math::greater_equal()
for each corresponding pair of components from lhs
and rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
tue::math::greater_equal()
for each corresponding pair of components from lhs
and rhs
.
|
inlinenoexcept |
Computes tue::math::equal()
for each corresponding pair of components from lhs
and rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
tue::math::equal()
for each corresponding pair of components from lhs
and rhs
.
|
inlinenoexcept |
Computes tue::math::not_equal()
for each corresponding pair of components from lhs
and rhs
.
T | The component type of both lhs and rhs . |
N | The component count of both lhs and rhs . |
lhs | The left-hand side operand. |
rhs | The right-hand side operand. |
tue::math::not_equal()
for each corresponding pair of components from lhs
and rhs
.