Vital
Loading...
Searching...
No Matches
vital::poly_float Struct Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ poly_float() [1/5]

force_inline vital::poly_float::poly_float ( )
inlinenoexcept

Default constructor. Initializes to zero (0.0f).

◆ poly_float() [2/5]

force_inline vital::poly_float::poly_float ( simd_type initial_value)
inlinenoexcept

Constructs from a raw SIMD register.

Parameters
initial_valueThe SIMD register.

◆ poly_float() [3/5]

force_inline vital::poly_float::poly_float ( float initial_value)
inlinenoexcept

Constructs the SIMD register by broadcasting a single float value.

Parameters
initial_valueThe float value to broadcast.

◆ poly_float() [4/5]

force_inline vital::poly_float::poly_float ( float initial_value1,
float initial_value2 )
inlinenoexcept

Constructs a SIMD register by repeating two float values (for SSE2/NEON).

Parameters
initial_value1The first element.
initial_value2The second element.

◆ poly_float() [5/5]

force_inline vital::poly_float::poly_float ( float first,
float second,
float third,
float fourth )
inlinenoexcept

Constructs a SIMD register with four specified floats (for SSE2/NEON).

Parameters
firstThe first element.
secondThe second element.
thirdThe third element.
fourthThe fourth element.

◆ ~poly_float()

force_inline vital::poly_float::~poly_float ( )
inlinenoexcept

Destructor.

Member Function Documentation

◆ abs() [1/2]

static force_inline poly_float vector_call vital::poly_float::abs ( poly_float value)
inlinestatic

◆ abs() [2/2]

static force_inline simd_type vector_call vital::poly_float::abs ( simd_type value)
inlinestatic

Computes the absolute value of each element in the SIMD float register.

Parameters
valueThe floating-point operand.
Returns
The element-wise absolute value.

◆ access()

force_inline float vector_call vital::poly_float::access ( size_t index) const
inlinenoexcept

Accessor for an element in the SIMD register.

Parameters
indexThe index (0-based) of the element.
Returns
The corresponding scalar value.

◆ add()

static force_inline simd_type vector_call vital::poly_float::add ( simd_type one,
simd_type two )
inlinestatic

Adds two SIMD float registers.

Parameters
oneFirst operand.
twoSecond operand.
Returns
Sum of the two operands.

◆ bitAnd()

static force_inline simd_type vector_call vital::poly_float::bitAnd ( simd_type value,
mask_simd_type mask )
inlinestatic

Bitwise AND of a float SIMD register with a mask.

Parameters
valueThe floating-point operand.
maskThe integer mask (reinterpreted as float).
Returns
Bitwise AND result.

◆ bitNot()

static force_inline simd_type vector_call vital::poly_float::bitNot ( simd_type value)
inlinestatic

Bitwise NOT of a float SIMD register.

Parameters
valueThe operand to invert.
Returns
Bitwise NOT of the value.

◆ bitOr()

static force_inline simd_type vector_call vital::poly_float::bitOr ( simd_type value,
mask_simd_type mask )
inlinestatic

Bitwise OR of a float SIMD register with a mask.

Parameters
valueThe floating-point operand.
maskThe integer mask (reinterpreted as float).
Returns
Bitwise OR result.

◆ bitXor()

static force_inline simd_type vector_call vital::poly_float::bitXor ( simd_type value,
mask_simd_type mask )
inlinestatic

Bitwise XOR of a float SIMD register with a mask.

Parameters
valueThe floating-point operand.
maskThe integer mask (reinterpreted as float).
Returns
Bitwise XOR result.

◆ div()

static force_inline simd_type vector_call vital::poly_float::div ( simd_type one,
simd_type two )
inlinestatic

Divides one SIMD float register by another, element-wise.

Parameters
oneDividend.
twoDivisor.
Returns
Result of one / two.

◆ equal() [1/2]

static force_inline poly_mask vector_call vital::poly_float::equal ( poly_float one,
poly_float two )
inlinestatic

◆ equal() [2/2]

static force_inline mask_simd_type vector_call vital::poly_float::equal ( simd_type one,
simd_type two )
inlinestatic

Compares two SIMD float registers for equality, element-wise.

Parameters
oneFirst operand.
twoSecond operand.
Returns
A mask (all bits set where equal, zero otherwise).

◆ greaterThan() [1/2]

static force_inline poly_mask vector_call vital::poly_float::greaterThan ( poly_float one,
poly_float two )
inlinestatic

◆ greaterThan() [2/2]

static force_inline mask_simd_type vector_call vital::poly_float::greaterThan ( simd_type one,
simd_type two )
inlinestatic

Compares two SIMD float registers, element-wise, for greater than.

Parameters
oneFirst operand.
twoSecond operand.
Returns
A mask (all bits set where one[i] > two[i], zero otherwise).

◆ greaterThanOrEqual() [1/2]

static force_inline poly_mask vector_call vital::poly_float::greaterThanOrEqual ( poly_float one,
poly_float two )
inlinestatic

◆ greaterThanOrEqual() [2/2]

static force_inline mask_simd_type vector_call vital::poly_float::greaterThanOrEqual ( simd_type one,
simd_type two )
inlinestatic

Compares two SIMD float registers, element-wise, for greater than or equal.

Parameters
oneFirst operand.
twoSecond operand.
Returns
A mask (all bits set where one[i] >= two[i], zero otherwise).

◆ init()

static force_inline simd_type vector_call vital::poly_float::init ( float scalar)
inlinestatic

Initializes a SIMD register with the same float repeated.

Parameters
scalarFloat value to broadcast across the SIMD register.
Returns
Initialized SIMD register.

◆ lessThan()

static force_inline poly_mask vector_call vital::poly_float::lessThan ( poly_float one,
poly_float two )
inlinestatic

◆ lessThanOrEqual()

static force_inline poly_mask vector_call vital::poly_float::lessThanOrEqual ( poly_float one,
poly_float two )
inlinestatic

◆ load()

static force_inline simd_type vector_call vital::poly_float::load ( const float * memory)
inlinestatic

Loads floating-point values from memory into a SIMD register.

Parameters
memoryPointer to memory location where float data is stored.
Returns
Loaded SIMD register.

◆ max() [1/2]

static force_inline poly_float vector_call vital::poly_float::max ( poly_float one,
poly_float two )
inlinestatic

◆ max() [2/2]

static force_inline simd_type vector_call vital::poly_float::max ( simd_type one,
simd_type two )
inlinestatic

Returns the element-wise maximum of two SIMD float registers.

Parameters
oneFirst operand.
twoSecond operand.
Returns
Element-wise maximum.

◆ min() [1/2]

static force_inline poly_float vector_call vital::poly_float::min ( poly_float one,
poly_float two )
inlinestatic

◆ min() [2/2]

static force_inline simd_type vector_call vital::poly_float::min ( simd_type one,
simd_type two )
inlinestatic

Returns the element-wise minimum of two SIMD float registers.

Parameters
oneFirst operand.
twoSecond operand.
Returns
Element-wise minimum.

◆ mul()

static force_inline simd_type vector_call vital::poly_float::mul ( simd_type one,
simd_type two )
inlinestatic

Multiplies two SIMD float registers element-wise.

Parameters
oneFirst operand.
twoSecond operand.
Returns
Product of the two operands.

◆ mulAdd() [1/2]

static force_inline poly_float vector_call vital::poly_float::mulAdd ( poly_float one,
poly_float two,
poly_float three )
inlinestatic

Convenience overloads returning poly_float instead of simd_type:

◆ mulAdd() [2/2]

static force_inline simd_type vector_call vital::poly_float::mulAdd ( simd_type one,
simd_type two,
simd_type three )
inlinestatic

Fused multiply-add operation: one = one + (two * three).

Parameters
oneAccumulator register.
twoFirst multiplier operand.
threeSecond multiplier operand.
Returns
Result of the fused multiply-add.

◆ mulScalar()

static force_inline simd_type vector_call vital::poly_float::mulScalar ( simd_type value,
float scalar )
inlinestatic

Multiplies a SIMD float register by a float scalar.

Parameters
valueThe SIMD float register.
scalarThe float scalar.
Returns
Product of each element in the register by the scalar.

◆ mulSub() [1/2]

static force_inline poly_float vector_call vital::poly_float::mulSub ( poly_float one,
poly_float two,
poly_float three )
inlinestatic

◆ mulSub() [2/2]

static force_inline simd_type vector_call vital::poly_float::mulSub ( simd_type one,
simd_type two,
simd_type three )
inlinestatic

Fused multiply-sub operation: one = one - (two * three).

Parameters
oneAccumulator register.
twoFirst multiplier operand.
threeSecond multiplier operand.
Returns
Result of the fused multiply-sub.

◆ neg()

static force_inline simd_type vector_call vital::poly_float::neg ( simd_type value)
inlinestatic

Negates a SIMD float register.

Parameters
valueSIMD register to negate.
Returns
Negation of the input register.

◆ notEqual() [1/2]

static force_inline poly_mask vector_call vital::poly_float::notEqual ( poly_float one,
poly_float two )
inlinestatic

◆ notEqual() [2/2]

static force_inline mask_simd_type vector_call vital::poly_float::notEqual ( simd_type one,
simd_type two )
inlinestatic

Compares two SIMD float registers for non-equality, element-wise.

Parameters
oneFirst operand.
twoSecond operand.
Returns
A mask (all bits set where one[i] != two[i], zero otherwise).

◆ operator&()

force_inline poly_float vector_call vital::poly_float::operator& ( poly_mask other) const
inlinenoexcept

◆ operator&=() [1/2]

force_inline poly_float &vector_call vital::poly_float::operator&= ( mask_simd_type other)
inlinenoexcept

◆ operator&=() [2/2]

force_inline poly_float &vector_call vital::poly_float::operator&= ( poly_mask other)
inlinenoexcept

◆ operator*() [1/2]

force_inline poly_float vector_call vital::poly_float::operator* ( float scalar) const
inlinenoexcept

◆ operator*() [2/2]

force_inline poly_float vector_call vital::poly_float::operator* ( poly_float other) const
inlinenoexcept

◆ operator*=() [1/3]

force_inline poly_float &vector_call vital::poly_float::operator*= ( float scalar)
inlinenoexcept

◆ operator*=() [2/3]

force_inline poly_float &vector_call vital::poly_float::operator*= ( poly_float other)
inlinenoexcept

◆ operator*=() [3/3]

force_inline poly_float &vector_call vital::poly_float::operator*= ( simd_type other)
inlinenoexcept

◆ operator+()

force_inline poly_float vector_call vital::poly_float::operator+ ( poly_float other) const
inlinenoexcept

Arithmetic operators.

◆ operator+=() [1/3]

force_inline poly_float &vector_call vital::poly_float::operator+= ( float scalar)
inlinenoexcept

Compound assignment operators using a scalar.

◆ operator+=() [2/3]

force_inline poly_float &vector_call vital::poly_float::operator+= ( poly_float other)
inlinenoexcept

Compound assignment operators using poly_float.

◆ operator+=() [3/3]

force_inline poly_float &vector_call vital::poly_float::operator+= ( simd_type other)
inlinenoexcept

Compound assignment operators using simd_type.

◆ operator-() [1/2]

force_inline poly_float vector_call vital::poly_float::operator- ( ) const
inlinenoexcept

Unary operators.

◆ operator-() [2/2]

force_inline poly_float vector_call vital::poly_float::operator- ( poly_float other) const
inlinenoexcept

◆ operator-=() [1/3]

force_inline poly_float &vector_call vital::poly_float::operator-= ( float scalar)
inlinenoexcept

◆ operator-=() [2/3]

force_inline poly_float &vector_call vital::poly_float::operator-= ( poly_float other)
inlinenoexcept

◆ operator-=() [3/3]

force_inline poly_float &vector_call vital::poly_float::operator-= ( simd_type other)
inlinenoexcept

◆ operator/()

force_inline poly_float vector_call vital::poly_float::operator/ ( poly_float other) const
inlinenoexcept

◆ operator/=() [1/3]

force_inline poly_float &vector_call vital::poly_float::operator/= ( float scalar)
inlinenoexcept

◆ operator/=() [2/3]

force_inline poly_float &vector_call vital::poly_float::operator/= ( poly_float other)
inlinenoexcept

◆ operator/=() [3/3]

force_inline poly_float &vector_call vital::poly_float::operator/= ( simd_type other)
inlinenoexcept

◆ operator[]()

force_inline float vector_call vital::poly_float::operator[] ( size_t index) const
inlinenoexcept

Operator[] overload (read-only).

Parameters
indexThe index to access.
Returns
The scalar value at that index.

◆ operator^()

force_inline poly_float vector_call vital::poly_float::operator^ ( poly_mask other) const
inlinenoexcept

◆ operator^=() [1/2]

force_inline poly_float &vector_call vital::poly_float::operator^= ( mask_simd_type other)
inlinenoexcept

◆ operator^=() [2/2]

force_inline poly_float &vector_call vital::poly_float::operator^= ( poly_mask other)
inlinenoexcept

◆ operator|()

force_inline poly_float vector_call vital::poly_float::operator| ( poly_mask other) const
inlinenoexcept

◆ operator|=() [1/2]

force_inline poly_float &vector_call vital::poly_float::operator|= ( mask_simd_type other)
inlinenoexcept

◆ operator|=() [2/2]

force_inline poly_float &vector_call vital::poly_float::operator|= ( poly_mask other)
inlinenoexcept

◆ operator~()

force_inline poly_float vector_call vital::poly_float::operator~ ( ) const
inlinenoexcept

◆ set()

force_inline void vector_call vital::poly_float::set ( size_t index,
float new_value )
inlinenoexcept

Sets a specific element in the SIMD register.

Parameters
indexThe index (0-based) of the element.
new_valueThe new value to place at that index.

◆ sign_mask() [1/2]

static force_inline poly_mask vector_call vital::poly_float::sign_mask ( poly_float value)
inlinestatic

◆ sign_mask() [2/2]

static force_inline mask_simd_type vector_call vital::poly_float::sign_mask ( simd_type value)
inlinestatic

Extracts the sign bit mask from each element in the SIMD float register.

Parameters
valueThe floating-point operand.
Returns
A mask where each element has the sign bit of the corresponding float.

◆ sub()

static force_inline simd_type vector_call vital::poly_float::sub ( simd_type one,
simd_type two )
inlinestatic

Subtracts one SIMD float register from another.

Parameters
oneFirst operand.
twoSecond operand.
Returns
Result of one - two.

◆ sum() [1/2]

force_inline float vector_call vital::poly_float::sum ( ) const
inlinenoexcept

Sums all elements in the SIMD float register.

Returns
Sum of the vector elements.

◆ sum() [2/2]

static force_inline float vector_call vital::poly_float::sum ( simd_type value)
inlinestatic

Computes the sum of all elements in a SIMD float register.

Parameters
valueThe SIMD register to sum.
Returns
The sum of all elements.

◆ toMask()

static force_inline mask_simd_type vector_call vital::poly_float::toMask ( simd_type value)
inlinestatic

Interprets the bits of a float SIMD register as a mask (integer).

Parameters
valueThe floating-point SIMD register.
Returns
The same bits reinterpreted as a mask_simd_type.

◆ toSimd()

static force_inline simd_type vector_call vital::poly_float::toSimd ( mask_simd_type mask)
inlinestatic

Interprets the bits of a mask SIMD register as float SIMD.

Parameters
maskThe mask to reinterpret.
Returns
The same bits reinterpreted as a float SIMD register.

◆ transpose()

static force_inline void vector_call vital::poly_float::transpose ( simd_type & row0,
simd_type & row1,
simd_type & row2,
simd_type & row3 )
inlinestatic

Performs an in-place 4x4 transpose of four SSE/NEON registers containing float data.

Parameters
row0Row 0 (in/out).
row1Row 1 (in/out).
row2Row 2 (in/out).
row3Row 3 (in/out).

Member Data Documentation

◆ value

simd_type vital::poly_float::value

The underlying SIMD register for float.


The documentation for this struct was generated from the following file: