Vital
|
Represents a vector of floating-point values using SIMD instructions. More...
#include <poly_values.h>
Classes | |
union | scalar_simd_union |
Helper union for copying between a scalar array and a SIMD type. More... | |
union | simd_scalar_union |
Helper union for copying between a SIMD type and a scalar array. More... | |
Public Member Functions | |
force_inline | poly_float () noexcept |
Default constructor. Initializes to zero (0.0f). | |
force_inline | poly_float (simd_type initial_value) noexcept |
Constructs from a raw SIMD register. | |
force_inline | poly_float (float initial_value) noexcept |
Constructs the SIMD register by broadcasting a single float value. | |
force_inline | poly_float (float initial_value1, float initial_value2) noexcept |
Constructs a SIMD register by repeating two float values (for SSE2/NEON). | |
force_inline | poly_float (float first, float second, float third, float fourth) noexcept |
Constructs a SIMD register with four specified floats (for SSE2/NEON). | |
force_inline | ~poly_float () noexcept |
Destructor. | |
force_inline float vector_call | access (size_t index) const noexcept |
Accessor for an element in the SIMD register. | |
force_inline void vector_call | set (size_t index, float new_value) noexcept |
Sets a specific element in the SIMD register. | |
force_inline float vector_call | operator[] (size_t index) const noexcept |
Operator[] overload (read-only). | |
force_inline poly_float &vector_call | operator+= (poly_float other) noexcept |
Compound assignment operators using poly_float. | |
force_inline poly_float &vector_call | operator-= (poly_float other) noexcept |
force_inline poly_float &vector_call | operator*= (poly_float other) noexcept |
force_inline poly_float &vector_call | operator/= (poly_float other) noexcept |
force_inline poly_float &vector_call | operator&= (poly_mask other) noexcept |
force_inline poly_float &vector_call | operator|= (poly_mask other) noexcept |
force_inline poly_float &vector_call | operator^= (poly_mask other) noexcept |
force_inline poly_float &vector_call | operator+= (simd_type other) noexcept |
Compound assignment operators using simd_type. | |
force_inline poly_float &vector_call | operator-= (simd_type other) noexcept |
force_inline poly_float &vector_call | operator*= (simd_type other) noexcept |
force_inline poly_float &vector_call | operator/= (simd_type other) noexcept |
force_inline poly_float &vector_call | operator&= (mask_simd_type other) noexcept |
force_inline poly_float &vector_call | operator|= (mask_simd_type other) noexcept |
force_inline poly_float &vector_call | operator^= (mask_simd_type other) noexcept |
force_inline poly_float &vector_call | operator+= (float scalar) noexcept |
Compound assignment operators using a scalar. | |
force_inline poly_float &vector_call | operator-= (float scalar) noexcept |
force_inline poly_float &vector_call | operator*= (float scalar) noexcept |
force_inline poly_float &vector_call | operator/= (float scalar) noexcept |
force_inline poly_float vector_call | operator+ (poly_float other) const noexcept |
Arithmetic operators. | |
force_inline poly_float vector_call | operator- (poly_float other) const noexcept |
force_inline poly_float vector_call | operator* (poly_float other) const noexcept |
force_inline poly_float vector_call | operator/ (poly_float other) const noexcept |
force_inline poly_float vector_call | operator* (float scalar) const noexcept |
force_inline poly_float vector_call | operator& (poly_mask other) const noexcept |
force_inline poly_float vector_call | operator| (poly_mask other) const noexcept |
force_inline poly_float vector_call | operator^ (poly_mask other) const noexcept |
force_inline poly_float vector_call | operator- () const noexcept |
Unary operators. | |
force_inline poly_float vector_call | operator~ () const noexcept |
force_inline float vector_call | sum () const noexcept |
Sums all elements in the SIMD float register. | |
Static Public Member Functions | |
static force_inline mask_simd_type vector_call | toMask (simd_type value) |
Interprets the bits of a float SIMD register as a mask (integer). | |
static force_inline simd_type vector_call | toSimd (mask_simd_type mask) |
Interprets the bits of a mask SIMD register as float SIMD. | |
static force_inline simd_type vector_call | init (float scalar) |
Initializes a SIMD register with the same float repeated. | |
static force_inline simd_type vector_call | load (const float *memory) |
Loads floating-point values from memory into a SIMD register. | |
static force_inline simd_type vector_call | add (simd_type one, simd_type two) |
Adds two SIMD float registers. | |
static force_inline simd_type vector_call | sub (simd_type one, simd_type two) |
Subtracts one SIMD float register from another. | |
static force_inline simd_type vector_call | neg (simd_type value) |
Negates a SIMD float register. | |
static force_inline simd_type vector_call | mul (simd_type one, simd_type two) |
Multiplies two SIMD float registers element-wise. | |
static force_inline simd_type vector_call | mulScalar (simd_type value, float scalar) |
Multiplies a SIMD float register by a float scalar. | |
static force_inline simd_type vector_call | mulAdd (simd_type one, simd_type two, simd_type three) |
Fused multiply-add operation: one = one + (two * three) . | |
static force_inline simd_type vector_call | mulSub (simd_type one, simd_type two, simd_type three) |
Fused multiply-sub operation: one = one - (two * three) . | |
static force_inline simd_type vector_call | div (simd_type one, simd_type two) |
Divides one SIMD float register by another, element-wise. | |
static force_inline simd_type vector_call | bitAnd (simd_type value, mask_simd_type mask) |
Bitwise AND of a float SIMD register with a mask. | |
static force_inline simd_type vector_call | bitOr (simd_type value, mask_simd_type mask) |
Bitwise OR of a float SIMD register with a mask. | |
static force_inline simd_type vector_call | bitXor (simd_type value, mask_simd_type mask) |
Bitwise XOR of a float SIMD register with a mask. | |
static force_inline simd_type vector_call | bitNot (simd_type value) |
Bitwise NOT of a float SIMD register. | |
static force_inline simd_type vector_call | max (simd_type one, simd_type two) |
Returns the element-wise maximum of two SIMD float registers. | |
static force_inline simd_type vector_call | min (simd_type one, simd_type two) |
Returns the element-wise minimum of two SIMD float registers. | |
static force_inline simd_type vector_call | abs (simd_type value) |
Computes the absolute value of each element in the SIMD float register. | |
static force_inline mask_simd_type vector_call | sign_mask (simd_type value) |
Extracts the sign bit mask from each element in the SIMD float register. | |
static force_inline mask_simd_type vector_call | equal (simd_type one, simd_type two) |
Compares two SIMD float registers for equality, element-wise. | |
static force_inline mask_simd_type vector_call | greaterThan (simd_type one, simd_type two) |
Compares two SIMD float registers, element-wise, for greater than. | |
static force_inline mask_simd_type vector_call | greaterThanOrEqual (simd_type one, simd_type two) |
Compares two SIMD float registers, element-wise, for greater than or equal. | |
static force_inline mask_simd_type vector_call | notEqual (simd_type one, simd_type two) |
Compares two SIMD float registers for non-equality, element-wise. | |
static force_inline float vector_call | sum (simd_type value) |
Computes the sum of all elements in a SIMD float register. | |
static force_inline void vector_call | transpose (simd_type &row0, simd_type &row1, simd_type &row2, simd_type &row3) |
Performs an in-place 4x4 transpose of four SSE/NEON registers containing float data. | |
static force_inline poly_float vector_call | mulAdd (poly_float one, poly_float two, poly_float three) |
Convenience overloads returning poly_float instead of simd_type: | |
static force_inline poly_float vector_call | mulSub (poly_float one, poly_float two, poly_float three) |
static force_inline poly_float vector_call | max (poly_float one, poly_float two) |
static force_inline poly_float vector_call | min (poly_float one, poly_float two) |
static force_inline poly_float vector_call | abs (poly_float value) |
static force_inline poly_mask vector_call | sign_mask (poly_float value) |
static force_inline poly_mask vector_call | equal (poly_float one, poly_float two) |
static force_inline poly_mask vector_call | notEqual (poly_float one, poly_float two) |
static force_inline poly_mask vector_call | greaterThan (poly_float one, poly_float two) |
static force_inline poly_mask vector_call | greaterThanOrEqual (poly_float one, poly_float two) |
static force_inline poly_mask vector_call | lessThan (poly_float one, poly_float two) |
static force_inline poly_mask vector_call | lessThanOrEqual (poly_float one, poly_float two) |
Public Attributes | |
simd_type | value |
The underlying SIMD register for float. | |
Represents a vector of floating-point values using SIMD instructions.
Depending on the available instruction set (AVX2, SSE2, NEON), the vector width differs. This struct provides basic arithmetic, bitwise, and comparison operations on these SIMD vectors.
|
inlinenoexcept |
Default constructor. Initializes to zero (0.0f).
|
inlinenoexcept |
Constructs from a raw SIMD register.
initial_value | The SIMD register. |
|
inlinenoexcept |
Constructs the SIMD register by broadcasting a single float value.
initial_value | The float value to broadcast. |
|
inlinenoexcept |
Constructs a SIMD register by repeating two float values (for SSE2/NEON).
initial_value1 | The first element. |
initial_value2 | The second element. |
|
inlinenoexcept |
Constructs a SIMD register with four specified floats (for SSE2/NEON).
first | The first element. |
second | The second element. |
third | The third element. |
fourth | The fourth element. |
|
inlinenoexcept |
Destructor.
|
inlinestatic |
|
inlinestatic |
Computes the absolute value of each element in the SIMD float register.
value | The floating-point operand. |
|
inlinenoexcept |
Accessor for an element in the SIMD register.
index | The index (0-based) of the element. |
|
inlinestatic |
Adds two SIMD float registers.
one | First operand. |
two | Second operand. |
|
inlinestatic |
Bitwise AND of a float SIMD register with a mask.
value | The floating-point operand. |
mask | The integer mask (reinterpreted as float). |
|
inlinestatic |
Bitwise NOT of a float SIMD register.
value | The operand to invert. |
|
inlinestatic |
Bitwise OR of a float SIMD register with a mask.
value | The floating-point operand. |
mask | The integer mask (reinterpreted as float). |
|
inlinestatic |
Bitwise XOR of a float SIMD register with a mask.
value | The floating-point operand. |
mask | The integer mask (reinterpreted as float). |
|
inlinestatic |
Divides one SIMD float register by another, element-wise.
one | Dividend. |
two | Divisor. |
one / two
.
|
inlinestatic |
|
inlinestatic |
Compares two SIMD float registers for equality, element-wise.
one | First operand. |
two | Second operand. |
|
inlinestatic |
|
inlinestatic |
Compares two SIMD float registers, element-wise, for greater than.
one | First operand. |
two | Second operand. |
|
inlinestatic |
|
inlinestatic |
Compares two SIMD float registers, element-wise, for greater than or equal.
one | First operand. |
two | Second operand. |
|
inlinestatic |
Initializes a SIMD register with the same float repeated.
scalar | Float value to broadcast across the SIMD register. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Loads floating-point values from memory into a SIMD register.
memory | Pointer to memory location where float data is stored. |
|
inlinestatic |
|
inlinestatic |
Returns the element-wise maximum of two SIMD float registers.
one | First operand. |
two | Second operand. |
|
inlinestatic |
|
inlinestatic |
Returns the element-wise minimum of two SIMD float registers.
one | First operand. |
two | Second operand. |
|
inlinestatic |
Multiplies two SIMD float registers element-wise.
one | First operand. |
two | Second operand. |
|
inlinestatic |
Convenience overloads returning poly_float instead of simd_type:
|
inlinestatic |
Fused multiply-add operation: one = one + (two * three)
.
one | Accumulator register. |
two | First multiplier operand. |
three | Second multiplier operand. |
|
inlinestatic |
Multiplies a SIMD float register by a float scalar.
value | The SIMD float register. |
scalar | The float scalar. |
|
inlinestatic |
|
inlinestatic |
Fused multiply-sub operation: one = one - (two * three)
.
one | Accumulator register. |
two | First multiplier operand. |
three | Second multiplier operand. |
|
inlinestatic |
Negates a SIMD float register.
value | SIMD register to negate. |
|
inlinestatic |
|
inlinestatic |
Compares two SIMD float registers for non-equality, element-wise.
one | First operand. |
two | Second operand. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Arithmetic operators.
|
inlinenoexcept |
Compound assignment operators using a scalar.
|
inlinenoexcept |
Compound assignment operators using poly_float.
|
inlinenoexcept |
Compound assignment operators using simd_type.
|
inlinenoexcept |
Unary operators.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Operator[] overload (read-only).
index | The index to access. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Sets a specific element in the SIMD register.
index | The index (0-based) of the element. |
new_value | The new value to place at that index. |
|
inlinestatic |
|
inlinestatic |
Extracts the sign bit mask from each element in the SIMD float register.
value | The floating-point operand. |
|
inlinestatic |
Subtracts one SIMD float register from another.
one | First operand. |
two | Second operand. |
one - two
.
|
inlinenoexcept |
Sums all elements in the SIMD float register.
|
inlinestatic |
Computes the sum of all elements in a SIMD float register.
value | The SIMD register to sum. |
|
inlinestatic |
Interprets the bits of a float SIMD register as a mask (integer).
value | The floating-point SIMD register. |
|
inlinestatic |
Interprets the bits of a mask SIMD register as float SIMD.
mask | The mask to reinterpret. |
|
inlinestatic |
Performs an in-place 4x4 transpose of four SSE/NEON registers containing float data.
row0 | Row 0 (in/out). |
row1 | Row 1 (in/out). |
row2 | Row 2 (in/out). |
row3 | Row 3 (in/out). |
simd_type vital::poly_float::value |
The underlying SIMD register for float.