|
native 0.0.1
Vectors, masks and wide register packs for C++26
|
#include <simd_family.h>
Public Member Functions | |
| simd ()=default | |
| Default initialization leaves storage unspecified; value initialization with braces zero-initializes it. | |
| constexpr | simd (simd const &)=default |
| Copy the stored value without arithmetic or normalization. | |
| constexpr simd & | operator= (simd const &)=default |
| Copy the stored value and return *this; no numerical conversion is performed. | |
| constexpr | simd (float x) |
| Broadcast x to all lanes. | |
| constexpr | simd (__m256 x) |
| Adopt native lane storage without numerical conversion. | |
| constexpr void | store (float *p) const |
| Store every logical lane; no extra alignment is required. | |
| template<std::size_t Alignment = 1> | |
| constexpr void | store_memory (float *p) const noexcept |
| Store full lanes, assuming Alignment-byte pointer alignment. | |
| constexpr | operator native_type () const noexcept |
| Return the native storage value without a numerical conversion. | |
| constexpr native_type | to_native () const noexcept |
| Project native register storage without a numerical conversion. | |
| constexpr bits_type | bits () const noexcept |
| Project exact binary32 lane words into the unsigned vector. | |
| constexpr bits_type | to_bits () const noexcept |
| Synonym for bits(): preserve all binary32 representation bits. | |
| constexpr void | storeu (float *p) const |
| Synonym for an unaligned full-vector store. | |
| constexpr void | store_bits (std::uint32_t *p) const noexcept |
| Store exact binary32 representations as uint32_t words. | |
| constexpr void | store_bits_partial (std::uint32_t *p, std::size_t n) const noexcept |
| Store exactly n representation words; require n <= lanes. | |
| constexpr | simd (std::array< float, 8 > const &values) noexcept |
| Load one lane from each array element, in array order. | |
|
template<class... X> requires (sizeof...(X)==8) && (std::convertible_to<X,float> && ...) | |
| constexpr | simd (X... x) noexcept((noexcept(static_cast< float >(x)) &&...)) |
| Convert one argument per lane; exceptions follow those named-lvalue conversions. | |
| constexpr simd & | operator+= (simd b) noexcept |
| Apply the corresponding lane-wise add operation in place and return *this. | |
| constexpr simd & | operator-= (simd b) noexcept |
| Apply the corresponding lane-wise subtract operation in place and return *this. | |
| constexpr simd & | operator*= (simd b) noexcept |
| Apply the corresponding lane-wise multiply operation in place and return *this. | |
| constexpr simd & | operator/= (simd b) noexcept |
| Apply the corresponding lane-wise divide operation in place and return *this. | |
Static Public Member Functions | |
| static constexpr simd | load (float const *p) |
| Load every logical lane; no extra alignment is required. | |
| template<std::size_t Alignment = 1> | |
| static constexpr simd | load_memory (float const *p) noexcept |
| Load full lanes, assuming Alignment-byte pointer alignment. | |
| static constexpr simd | from_bits (bits_type bits) noexcept |
| Reinterpret unsigned lane words as binary32, without normalization. | |
| static constexpr simd | from_bits (std::uint32_t bits) noexcept |
| Reinterpret unsigned lane words as binary32, without normalization. | |
| static constexpr simd | from_float (float x) noexcept |
| Broadcast one binary32 value to every lane. | |
| static constexpr simd | from_native (native_type x) noexcept |
| Adopt native register storage without changing its bits. | |
| static constexpr simd | unsafe_from_float32 (native_type x) noexcept |
| Adopt native raw float storage; this raw type adds no normalization. | |
| static constexpr simd | loadu (float const *p) |
| Synonym for an unaligned full-vector load. | |
| static constexpr simd | load_bits (std::uint32_t const *p) noexcept |
| Load exact binary32 representations from uint32_t words. | |
| static constexpr simd | load_bits_partial (std::uint32_t const *p, std::size_t n, std::uint32_t fill=0) noexcept |
| Load n words and fill the remaining lanes; require n <= lanes. | |
Friends | |
| constexpr simd | operator+ (simd a, simd b) |
| Add corresponding floating-point lanes using the caller's rounding and denormal environment. | |
| constexpr simd | operator- (simd a, simd b) |
| Subtract corresponding floating-point lanes using the caller's rounding and denormal environment. | |
| constexpr simd | operator* (simd a, simd b) |
| Multiply corresponding floating-point lanes using the caller's rounding and denormal environment. | |
| constexpr simd | operator/ (simd a, simd b) |
| Divide corresponding floating-point lanes using the caller's rounding and denormal environment. | |
| constexpr simd | operator- (simd a) |
| Negate every logical lane; floating-point lanes change sign. | |
| constexpr mask_type | operator< (simd a, simd b) |
| Return a mask whose lanes are true where a < b holds. NaN lanes yield false. | |
| constexpr mask_type | operator> (simd a, simd b) |
| Return a mask whose lanes are true where a > b holds. NaN lanes yield false. | |
| constexpr mask_type | operator== (simd a, simd b) |
| Return a mask whose lanes are true where a == b holds. NaN lanes yield false. | |
| template<class M> requires (std::same_as<M,mask_type> || std::same_as<M,vector_mask_type>) | |
| constexpr simd | select (M m, simd a, simd b) |
| Choose a where the canonical mask is true, otherwise b; both operands are evaluated. | |
| constexpr simd | fma (simd a, simd b, simd c) |
| Compute a*b+c with one fused rounding per lane. | |
| constexpr simd | sqrt (simd a) |
| Compute the native square root in every lane. | |
| constexpr simd | round_even (simd a) |
| Round to an integral value, ties to even, independent of ambient direction. | |
| constexpr simd | normal_pow2 (simd n) |
| Construct normal powers of two; require integral exponents in [-126,127]. | |
| constexpr mask_type | operator!= (simd a, simd b) noexcept |
| Return a mask whose lanes are true where a != b holds. NaN lanes compare unequal. | |
| constexpr mask_type | operator<= (simd a, simd b) noexcept |
| Return a mask whose lanes are true where a <= b holds. NaN lanes yield false. | |
| constexpr mask_type | operator>= (simd a, simd b) noexcept |
| Return a mask whose lanes are true where a >= b holds. NaN lanes yield false. | |
Raw x86 float storage; the Arch argument fixes comparison-mask representation.
Definition at line 3777 of file simd_family.h.
|
friend |
Choose a where the canonical mask is true, otherwise b; both operands are evaluated.
Choose a in true lanes and b in false lanes; both operands are evaluated.
Definition at line 3853 of file simd_family.h.