Om
1.0.0
A universal framework for multimedia simulation
|
A class representing a 2-component 64-bit floating-point SIMD scalar. More...
#include <omSIMDScalarFloat64_2.h>
Public Member Functions | |
SIMDScalar () | |
Define the type for a 2x double scalar structure. More... | |
SIMDScalar (Float64 value) | |
Create a new 2D SIMD scalar with all elements equal to the specified value. More... | |
SIMDScalar (Float64 newA, Float64 newB) | |
Create a new 2D SIMD scalar with the elements equal to the specified 2 values. More... | |
SIMDScalar (const Float64 *array) | |
Create a new 2D SIMD scalar from the first 4 values stored at specified pointer's location. More... | |
SIMDScalar (const SIMDScalar &other) | |
Create a new SIMD scalar with the same contents as another. More... | |
SIMDScalar & | operator= (const SIMDScalar &other) |
Assign the contents of one SIMDScalar object to another. More... | |
void | store (Float64 *destination) const |
void | storeUnaligned (Float64 *destination) const |
Float64 & | operator[] (Index i) |
Get a reference to the value stored at the specified component index in this scalar. More... | |
Float64 | operator[] (Index i) const |
Get the value stored at the specified component index in this scalar. More... | |
const Float64 * | toArray () const |
Get a pointer to the first element in this scalar. More... | |
SIMDScalar< Int64, 2 > | operator== (const SIMDScalar &scalar) const |
Compare two 2D SIMD scalars component-wise for equality. More... | |
SIMDScalar< Int64, 2 > | operator== (const Float64 value) const |
Compare this scalar to a single floating point value for equality. More... | |
SIMDScalar< Int64, 2 > | operator!= (const SIMDScalar &scalar) const |
Compare two 2D SIMD scalars component-wise for inequality. More... | |
SIMDScalar< Int64, 2 > | operator!= (const Float64 value) const |
Compare this scalar to a single floating point value for inequality. More... | |
SIMDScalar< Int64, 2 > | operator< (const SIMDScalar &scalar) const |
Perform a component-wise less-than comparison between this and another 2D SIMD scalar. More... | |
SIMDScalar< Int64, 2 > | operator< (const Float64 value) const |
Perform a component-wise less-than comparison between this 2D SIMD scalar and an expanded scalar. More... | |
SIMDScalar< Int64, 2 > | operator> (const SIMDScalar &scalar) const |
Perform a component-wise greater-than comparison between this an another 2D SIMD scalar. More... | |
SIMDScalar< Int64, 2 > | operator> (const Float64 value) const |
Perform a component-wise greater-than comparison between this 2D SIMD scalar and an expanded scalar. More... | |
SIMDScalar< Int64, 2 > | operator<= (const SIMDScalar &scalar) const |
Perform a component-wise less-than-or-equal-to comparison between this an another 2D SIMD scalar. More... | |
SIMDScalar< Int64, 2 > | operator<= (const Float64 value) const |
Perform a component-wise less-than-or-equal-to comparison between this 2D SIMD scalar and an expanded scalar. More... | |
SIMDScalar< Int64, 2 > | operator>= (const SIMDScalar &scalar) const |
Perform a component-wise greater-than-or-equal-to comparison between this an another 2D SIMD scalar. More... | |
SIMDScalar< Int64, 2 > | operator>= (const Float64 value) const |
Perform a component-wise greater-than-or-equal-to comparison between this 2D SIMD scalar and an expanded scalar. More... | |
Float64 | sumScalar () const |
SIMDScalar | operator- () const |
Negate a scalar. More... | |
SIMDScalar | operator+ (const SIMDScalar &scalar) const |
Add this scalar to another and return the result. More... | |
SIMDScalar | operator+ (const Float64 value) const |
Add a value to every component of this scalar. More... | |
SIMDScalar | operator- (const SIMDScalar &scalar) const |
Subtract a scalar from this scalar component-wise and return the result. More... | |
SIMDScalar | operator- (const Float64 value) const |
Subtract a value from every component of this scalar. More... | |
SIMDScalar | operator* (const SIMDScalar &scalar) const |
Multiply component-wise this scalar and another scalar. More... | |
SIMDScalar | operator* (const Float64 value) const |
Multiply every component of this scalar by a value and return the result. More... | |
SIMDScalar | operator/ (const SIMDScalar &scalar) const |
Divide this scalar by another scalar component-wise. More... | |
SIMDScalar | operator/ (const Float64 value) const |
Divide every component of this scalar by a value and return the result. More... | |
SIMDScalar & | operator+= (const SIMDScalar &scalar) |
Add a scalar to this scalar, modifying this original scalar. More... | |
SIMDScalar & | operator-= (const SIMDScalar &scalar) |
Subtract a scalar from this scalar, modifying this original scalar. More... | |
SIMDScalar & | operator*= (const SIMDScalar &scalar) |
Multiply component-wise this scalar and another scalar and modify this scalar. More... | |
SIMDScalar & | operator/= (const SIMDScalar &scalar) |
Divide this scalar by another scalar component-wise and modify this scalar. More... | |
data::String | toString () const |
Convert this SIMD scalar into a human-readable string representation. More... | |
operator data::String () const | |
Convert this SIMD scalar into a human-readable string representation. More... | |
Static Public Member Functions | |
static SIMDScalar | load (const Float64 *array) |
static SIMDScalar | loadUnaligned (const Float64 *array) |
static Size | getAlignment () |
Return the alignment required for objects of this type. More... | |
static Size | getWidth () |
Get the width of this scalar (number of components it has). More... | |
static Bool | isSupported () |
Return whether or not this SIMD type is supported by the current CPU. More... | |
Friends | |
SIMDScalar | abs (const SIMDScalar &scalar) |
SIMDScalar | ceiling (const SIMDScalar &scalar) |
SIMDScalar | floor (const SIMDScalar &scalar) |
SIMDScalar | sqrt (const SIMDScalar &scalar) |
SIMDScalar | min (const SIMDScalar &scalar1, const SIMDScalar &scalar2) |
SIMDScalar | max (const SIMDScalar &scalar1, const SIMDScalar &scalar2) |
template<UInt i1, UInt i2> | |
SIMDScalar | shuffle (const SIMDScalar &scalar1) |
template<UInt i1, UInt i2> | |
SIMDScalar | shuffle (const SIMDScalar &scalar1, const SIMDScalar &scalar2) |
SIMDScalar | select (const SIMDScalar< Int64, 2 > &selector, const SIMDScalar &scalar1, const SIMDScalar &scalar2) |
SIMDScalar | subAdd (const SIMDScalar &scalar1, const SIMDScalar &scalar2) |
A class representing a 2-component 64-bit floating-point SIMD scalar.
This specialization of the SIMDScalar class uses a 128-bit value to encode 2 64-bit floating-point values. All basic arithmetic operations are supported, plus a subset of standard scalar operations: abs(), min(), max(), sqrt().
|
inline |
Define the type for a 2x double scalar structure.
Create a new 2D SIMD scalar with all elements left uninitialized.
|
inline |
Create a new 2D SIMD scalar with all elements equal to the specified value.
|
inline |
Create a new 2D SIMD scalar with the elements equal to the specified 2 values.
|
inlineexplicit |
Create a new 2D SIMD scalar from the first 4 values stored at specified pointer's location.
|
inline |
Create a new SIMD scalar with the same contents as another.
This shouldn't have to be overloaded, but for some reason the compiler (GCC) optimizes SIMD code better with it overloaded. Before, the compiler would store the result of a SIMD operation on the stack before transfering it to the destination, resulting in an extra 8+ load/stores per computation.
|
inline |
Assign the contents of one SIMDScalar object to another.
This shouldn't have to be overloaded, but for some reason the compiler (GCC) optimizes SIMD code better with it overloaded. Before, the compiler would store the result of a SIMD operation on the stack before transfering it to the destination, resulting in an extra 8+ load/stores per computation.
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
Get a reference to the value stored at the specified component index in this scalar.
|
inline |
Get the value stored at the specified component index in this scalar.
|
inline |
Get a pointer to the first element in this scalar.
The remaining values are in the next 3 locations after the first element.
|
inline |
Compare two 2D SIMD scalars component-wise for equality.
Return a 2D scalar of integers indicating the result of the comparison. If each corresponding pair of components is equal, the corresponding result component is non-zero. Otherwise, that result component is equal to zero.
|
inline |
Compare this scalar to a single floating point value for equality.
Return a 2D scalar of integers indicating the result of the comparison. The float value is expanded to a 4-wide SIMD scalar and compared with this scalar. If each corresponding pair of components is equal, the corresponding result component is non-zero. Otherwise, that result component is equal to zero.
|
inline |
Compare two 2D SIMD scalars component-wise for inequality.
Return a 2D scalar of integers indicating the result of the comparison. If each corresponding pair of components is not equal, the corresponding result component is non-zero. Otherwise, that result component is equal to zero.
|
inline |
Compare this scalar to a single floating point value for inequality.
Return a 2D scalar of integers indicating the result of the comparison. The float value is expanded to a 4-wide SIMD scalar and compared with this scalar. If each corresponding pair of components is not equal, the corresponding result component is non-zero. Otherwise, that result component is equal to zero.
|
inline |
Perform a component-wise less-than comparison between this and another 2D SIMD scalar.
Return a 2D scalar of integers indicating the result of the comparison. If each corresponding pair of components has this scalar's component less than the other scalar's component, the corresponding result component is non-zero. Otherwise, that result component is equal to zero.
|
inline |
Perform a component-wise less-than comparison between this 2D SIMD scalar and an expanded scalar.
Return a 2D scalar of integers indicating the result of the comparison. The float value is expanded to a 4-wide SIMD scalar and compared with this scalar. If each corresponding pair of components has this scalar's component less than the other scalar's component, the corresponding result component is non-zero. Otherwise, that result component is equal to zero.
|
inline |
Perform a component-wise greater-than comparison between this an another 2D SIMD scalar.
Return a 2D scalar of integers indicating the result of the comparison. If each corresponding pair of components has this scalar's component greater than the other scalar's component, the corresponding result component is non-zero. Otherwise, that result component is equal to zero.
|
inline |
Perform a component-wise greater-than comparison between this 2D SIMD scalar and an expanded scalar.
Return a 2D scalar of integers indicating the result of the comparison. The float value is expanded to a 4-wide SIMD scalar and compared with this scalar. If each corresponding pair of components has this scalar's component greater than the other scalar's component, the corresponding result component is non-zero. Otherwise, that result component is equal to zero.
|
inline |
Perform a component-wise less-than-or-equal-to comparison between this an another 2D SIMD scalar.
Return a 2D scalar of integers indicating the result of the comparison. If each corresponding pair of components has this scalar's component less than or equal to the other scalar's component, the corresponding result component is non-zero. Otherwise, that result component is equal to zero.
|
inline |
Perform a component-wise less-than-or-equal-to comparison between this 2D SIMD scalar and an expanded scalar.
Return a 2D scalar of integers indicating the result of the comparison. The float value is expanded to a 4-wide SIMD scalar and compared with this scalar. If each corresponding pair of components has this scalar's component less than or equal to the other scalar's component, the corresponding result component is non-zero. Otherwise, that result component is equal to zero.
|
inline |
Perform a component-wise greater-than-or-equal-to comparison between this an another 2D SIMD scalar.
Return a 2D scalar of integers indicating the result of the comparison. If each corresponding pair of components has this scalar's component greater than or equal to the other scalar's component, the corresponding result component is non-zero. Otherwise, that result component is equal to zero.
|
inline |
Perform a component-wise greater-than-or-equal-to comparison between this 2D SIMD scalar and an expanded scalar.
Return a 2D scalar of integers indicating the result of the comparison. The float value is expanded to a 4-wide SIMD scalar and compared with this scalar. If each corresponding pair of components has this scalar's component greater than or equal to the other scalar's component, the corresponding result component is non-zero. Otherwise, that result component is equal to zero.
|
inline |
|
inline |
Negate a scalar.
This method negates every component of this 2D SIMD scalar and returns the result, leaving this scalar unmodified.
|
inline |
Add this scalar to another and return the result.
This method adds another scalar to this one, component-wise, and returns this addition. It does not modify either of the original scalars.
scalar | - The scalar to add to this one. |
|
inline |
Add a value to every component of this scalar.
This method adds the value parameter to every component of the scalar, and returns a scalar representing this result. It does not modifiy the original scalar.
value | - The value to add to all components of this scalar. |
|
inline |
Subtract a scalar from this scalar component-wise and return the result.
This method subtracts another scalar from this one, component-wise, and returns this subtraction. It does not modify either of the original scalars.
scalar | - The scalar to subtract from this one. |
|
inline |
Subtract a value from every component of this scalar.
This method subtracts the value parameter from every component of the scalar, and returns a scalar representing this result. It does not modifiy the original scalar.
value | - The value to subtract from all components of this scalar. |
|
inline |
Multiply component-wise this scalar and another scalar.
This operator multiplies each component of this scalar by the corresponding component of the other scalar and returns a scalar representing this result. It does not modify either original scalar.
scalar | - The scalar to multiply this scalar by. |
|
inline |
Multiply every component of this scalar by a value and return the result.
This method multiplies the value parameter with every component of the scalar, and returns a scalar representing this result. It does not modifiy the original scalar.
value | - The value to multiplly with all components of this scalar. |
|
inline |
Divide this scalar by another scalar component-wise.
This operator divides each component of this scalar by the corresponding component of the other scalar and returns a scalar representing this result. It does not modify either original scalar.
scalar | - The scalar to multiply this scalar by. |
|
inline |
Divide every component of this scalar by a value and return the result.
This method Divides every component of the scalar by the value parameter, and returns a scalar representing this result. It does not modifiy the original scalar.
value | - The value to divide all components of this scalar by. |
|
inline |
Add a scalar to this scalar, modifying this original scalar.
This method adds another scalar to this scalar, component-wise, and sets this scalar to have the result of this addition.
scalar | - The scalar to add to this scalar. |
|
inline |
Subtract a scalar from this scalar, modifying this original scalar.
This method subtracts another scalar from this scalar, component-wise, and sets this scalar to have the result of this subtraction.
scalar | - The scalar to subtract from this scalar. |
|
inline |
Multiply component-wise this scalar and another scalar and modify this scalar.
This operator multiplies each component of this scalar by the corresponding component of the other scalar and modifies this scalar to contain the result.
scalar | - The scalar to multiply this scalar by. |
|
inline |
Divide this scalar by another scalar component-wise and modify this scalar.
This operator divides each component of this scalar by the corresponding component of the other scalar and modifies this scalar to contain the result.
scalar | - The scalar to divide this scalar by. |
|
inlinestatic |
Return the alignment required for objects of this type.
For most SIMD types this value will be 16 bytes. If there is no alignment required, 0 is returned.
|
inlinestatic |
Get the width of this scalar (number of components it has).
|
inlinestatic |
Return whether or not this SIMD type is supported by the current CPU.
|
inline |
Convert this SIMD scalar into a human-readable string representation.
|
inline |
Convert this SIMD scalar into a human-readable string representation.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Float64 om::math::SIMDScalar< Float64, 2 >::a |
The A component of a 2D SIMD scalar.
Float64 om::math::SIMDScalar< Float64, 2 >::b |
The B component of a 2D SIMD scalar.
Float64 om::math::SIMDScalar< Float64, 2 >::x[2] |
The components of a 2D SIMD scalar in array format.