Om
1.0.0
A universal framework for multimedia simulation
|
The prototype for the SIMDArray class for wide SIMD operations. More...
#include <omSIMDArray.h>
Public Member Functions | |
SIMDArray () | |
Create a scalar with it's elements equal to zero. More... | |
SIMDArray (T value) | |
Create a scalar with it's elements equal to zero. More... | |
SIMDArray (const T *array) | |
Create a scalar with elements from the specified array. More... | |
const T * | toArray () const |
Return an array representation of this scalar. More... | |
T & | get (Index i) |
Get the element at the specified index in the scalar. More... | |
const T & | get (Index i) const |
Get the element at the specified index in the scalar. More... | |
T & | operator() (Index i) |
Get the element at the specified index in the scalar. More... | |
const T & | operator() (Index i) const |
Get the element at the specified index in the scalar. More... | |
T & | operator[] (Index i) |
Get the element at the specified index in the scalar. More... | |
const T & | operator[] (Index i) const |
Get the element at the specified index in the scalar. More... | |
void | set (Index i, T newX) |
Set the element at the specified index in the scalar. More... | |
T | sumScalar () const |
Return the horizontal sum of all components of this SIMD scalar. More... | |
SIMDArray | operator- () const |
Negate every component of this scalar and return the result. More... | |
SIMDArray | operator+ () const |
'Positivate' every component of this scalar, effectively returning a copy. More... | |
SIMDArray | operator+ (const SIMDArray &scalar) const |
Add a scalar to this scalar and return the resulting scalar. More... | |
SIMDArray | operator+ (const T &value) const |
Add a scalar value to each component of this scalar and return the resulting scalar. More... | |
SIMDArray | operator- (const SIMDArray &scalar) const |
Subtract a scalar from this scalar and return the resulting scalar. More... | |
SIMDArray | operator- (const T &value) const |
Subtract a scalar value from each component of this scalar and return the resulting scalar. More... | |
SIMDArray | operator* (const SIMDArray &scalar) const |
Return the result of a component-wise scalar multiplication with this scalar. More... | |
SIMDArray | operator* (const T &value) const |
Multiply a scalar value by each component of this scalar and return the resulting scalar. More... | |
SIMDArray | operator/ (const T &value) const |
Divide each component of this scalar by a scalar value and return the resulting scalar. More... | |
SIMDArray | operator/ (const SIMDArray &scalar) const |
Divide each component of this scalar by a scalar component and return the resulting scalar. More... | |
SIMDArray & | operator+= (const SIMDArray &v2) |
SIMDArray & | operator+= (const T &value) |
SIMDArray & | operator-= (const SIMDArray &v2) |
SIMDArray & | operator-= (const T &value) |
SIMDArray & | operator*= (const SIMDArray &scalar) |
SIMDArray & | operator*= (const T &value) |
SIMDArray & | operator/= (const SIMDArray &scalar) |
SIMDArray & | operator/= (const T &value) |
Static Public Member Functions | |
static Size | getAlignment () |
Return the alignment required in bytes for objects of this type. More... | |
static Size | getWidth () |
Get the width of this scalar (number of components it has). More... | |
Friends | |
template<typename U , Size dim> | |
SIMDArray< U, dim > | operator+ (const U &value, const SIMDArray< T, dim > &scalar) |
template<typename U , Size dim> | |
SIMDArray< U, dim > | operator- (const U &value, const SIMDArray< T, dim > &scalar) |
template<typename U , Size dim> | |
SIMDArray< U, dim > | operator* (const U &value, const SIMDArray< T, dim > &scalar) |
template<typename U , Size dim> | |
SIMDArray< U, dim > | operator/ (const U &value, const SIMDArray< T, dim > &scalar) |
The prototype for the SIMDArray class for wide SIMD operations.
This class emulates aribitrary-width SIMD registers using an array of SIMD values which are all processed in a vector fashion similar to normal SIMD values.
This template prototype is a scalar implementation of basic SIMD functionality. Supported operations include all basic arithmetic operations (+, -, *, /, +=, -=, *=, /=) and functions that operate on SIMDArray instances to find the per-component result for abs(), min(), max(), and sqrt() operations.
This implementation is provided as a fallback for when SIMD instructions are not available and for completeness. On any given platform, specializations for this class/functions should be implemented which use real SIMD operations.
|
inline |
Create a scalar with it's elements equal to zero.
|
inline |
Create a scalar with it's elements equal to zero.
|
inline |
Create a scalar with elements from the specified array.
The array must be of length greater than or equal to the width of the scalar.
|
inline |
Return an array representation of this scalar.
|
inline |
Get the element at the specified index in the scalar.
|
inline |
Get the element at the specified index in the scalar.
|
inline |
Get the element at the specified index in the scalar.
|
inline |
Get the element at the specified index in the scalar.
|
inline |
Get the element at the specified index in the scalar.
|
inline |
Get the element at the specified index in the scalar.
|
inline |
Set the element at the specified index in the scalar.
|
inline |
Return the horizontal sum of all components of this SIMD scalar.
|
inline |
Negate every component of this scalar and return the result.
|
inline |
'Positivate' every component of this scalar, effectively returning a copy.
|
inline |
Add a scalar to this scalar and return the resulting scalar.
|
inline |
Add a scalar value to each component of this scalar and return the resulting scalar.
|
inline |
Subtract a scalar from this scalar and return the resulting scalar.
|
inline |
Subtract a scalar value from each component of this scalar and return the resulting scalar.
|
inline |
Return the result of a component-wise scalar multiplication with this scalar.
|
inline |
Multiply a scalar value by each component of this scalar and return the resulting scalar.
|
inline |
Divide each component of this scalar by a scalar value and return the resulting scalar.
|
inline |
Divide each component of this scalar by a scalar component and return the resulting scalar.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
Return the alignment required in bytes 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).
|
friend |
|
friend |
|
friend |
|
friend |