#include <sse_vector_4f32.h>
The class and the default constructor are always defined. The functions of this class are only defined when C4D_HAS_SSE2_CAPABILITY is set. Instances of this class must be aligned to 16 bytes. The layout in the memory is as follows: address + 0 + 1 + 2 + 3 R0 R1 R2 R3
Public Types | |
using | ValueType = Float32 |
Public Member Functions | |
Vector4f32 ()=default | |
MAXON_ATTRIBUTE_FORCE_INLINE | Vector4f32 (Float32 f, Bool setAll=true) |
MAXON_ATTRIBUTE_FORCE_INLINE | Vector4f32 (Float32 f0, Float32 f1, Float32 f2, Float32 f3) |
MAXON_ATTRIBUTE_FORCE_INLINE | Vector4f32 (const Float32 *p, Bool aligned) |
MAXON_ATTRIBUTE_FORCE_INLINE void | LoadUnaligned (const Float32 *p) |
MAXON_ATTRIBUTE_FORCE_INLINE void | LoadUnaligned (const Float64 *p) |
MAXON_ATTRIBUTE_FORCE_INLINE void | LoadAligned (const Float32 *p) |
MAXON_ATTRIBUTE_FORCE_INLINE void | LoadAligned (const Float64 *p) |
MAXON_ATTRIBUTE_FORCE_INLINE void | StoreUnaligned (Float32 *p) const |
MAXON_ATTRIBUTE_FORCE_INLINE void | StoreAligned (Float32 *p) const |
MAXON_ATTRIBUTE_FORCE_INLINE Float32 & | operator[] (UInt i) |
MAXON_ATTRIBUTE_FORCE_INLINE Float32 | operator[] (UInt i) const |
MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32 & | operator+= (const Vector4f32 &a) |
MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32 | Blend (const Vector4f32 &b, const Vector4f32 &mask) const |
Static Public Member Functions | |
template<Int32 ma4, Int32 ma3, Int32 ma2, Int32 ma1> | |
static MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32 | Shuffle (const Vector4f32 &a) |
template<Int32 mb2, Int32 mb1, Int32 ma2, Int32 ma1> | |
static MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32 | Shuffle (const Vector4f32 &a, const Vector4f32 &b) |
Public Attributes | |
union { | |
Float32 v [4] | |
}; | |
|
default |
Constructs the object. It does not set a default value.
|
explicit |
Constructs the object and sets all values to f.
[in] | f | The value that is assigned to all vector elements. |
|
explicit |
Constructs the object and sets all values to f0...f3.
[in] | f0 | The value that is assigned to vector element 0. |
[in] | f1 | The value that is assigned to vector element 1. |
[in] | f2 | The value that is assigned to vector element 2. |
[in] | f3 | The value that is assigned to vector element 3. |
|
explicit |
Constructs a vector from an address in the memory.
[in] | p | The address where the vector is loaded from. |
[in] | aligned | Should be set to true, if p is known to be 16-byte aligned. |
MAXON_ATTRIBUTE_FORCE_INLINE void LoadUnaligned | ( | const Float32 * | p | ) |
Loads a vector from an address in the memory.
[in] | p | The address where the vector is loaded from. |
MAXON_ATTRIBUTE_FORCE_INLINE void LoadUnaligned | ( | const Float64 * | p | ) |
Loads a vector from an address in the memory.
[in] | p | The address where the vector is loaded from. |
MAXON_ATTRIBUTE_FORCE_INLINE void LoadAligned | ( | const Float32 * | p | ) |
Loads a vector from an address in the memory.
[in] | p | The address where the vector is loaded from, must be 16-byte aligned. |
MAXON_ATTRIBUTE_FORCE_INLINE void LoadAligned | ( | const Float64 * | p | ) |
Loads a vector from an address in the memory.
[in] | p | The address where the vector is loaded from, must be 16-byte aligned. |
MAXON_ATTRIBUTE_FORCE_INLINE void StoreUnaligned | ( | Float32 * | p | ) | const |
Stores the contents of this vector to an address in the memory.
[in] | p | The address where the vector is to be stored, must be 16-byte aligned. |
MAXON_ATTRIBUTE_FORCE_INLINE void StoreAligned | ( | Float32 * | p | ) | const |
Stores the contents of this vector to an address in the memory.
[in] | p | The address where the vector is to be stored, must be 16-byte aligned. |
MAXON_ATTRIBUTE_FORCE_INLINE Float32& operator[] | ( | UInt | i | ) |
Gets component i from the vector.
[in] | i | The index. |
MAXON_ATTRIBUTE_FORCE_INLINE Float32 operator[] | ( | UInt | i | ) | const |
Gets component i from the vector.
[in] | i | The index. |
MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32& operator+= | ( | const Vector4f32 & | a | ) |
Adds a vector to this.
[in] | a | The vector to add. |
MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32 Blend | ( | const Vector4f32 & | b, |
const Vector4f32 & | mask | ||
) | const |
Blends this vector with another one using a mask. For each vector element, the element of this vector is chosen if the mask element is zero, and the element of the B vector is chosen if the mask element has all bits set. If only some of the mask bits are set, the result is undefined.
[in] | b | Input vector B. |
[in] | mask | Mask vector. |
|
static |
Shuffles the components of the input vector. Note that the template arguments must be numeric constants.
[in] | a | Input vector. |
ma1 | Decides which element of vector A becomes the new R0. |
ma2 | Decides which element of vector A becomes the new R1. |
ma3 | Decides which element of vector A becomes the new R2. |
ma4 | Decides which element of vector A becomes the new R3. |
|
static |
Shuffles the components of the input vectors. Note that the template arguments must be numeric constants and be 0 to 3.
[in] | a | Input vector A. |
[in] | b | Input vector B. |
ma1 | Decides which element of vector A becomes the new R0. |
ma2 | Decides which element of vector A becomes the new R1. |
mb1 | Decides which element of vector B becomes the new R2. |
mb2 | Decides which element of vector B becomes the new R3. |
|
friend |
Casts a Vector4i32 to a Vector4f32 vector.
|
friend |
Converts a Vector4i32 to a Vector4f32 vector.
|
friend |
Casts a Vector4f32 to a Vector4i32 vector.
|
friend |
Converts a Vector4f32 to a Vector4i32 vector.
|
friend |
Converts two Vector2f64 to a Vector4f32 vector.
|
friend |
Converts one Vector2f64 to a Vector4f32 vector.
|
friend |
|
friend |
Adds two vectors.
[in] | a | The first operand. |
[in] | b | The second operand. |
|
friend |
Subtracts two vectors.
[in] | a | The first operand. |
[in] | b | The second operand. |
|
friend |
Multiplies two vectors.
[in] | a | The first operand. |
[in] | b | The second operand. |
|
friend |
Multiplies a Float32 with each vector component.
[in] | a | The first operand. |
[in] | b | The second operand. |
|
friend |
Divides two vectors.
[in] | a | The first operand. |
[in] | b | The second operand. |
|
friend |
Calculates the minimum of two vectors.
[in] | a | Input vector A. |
[in] | b | Input vector B. |
|
friend |
Calculates the maximum of two vectors.
[in] | a | Input vector A. |
[in] | b | Input vector B. |
|
friend |
Clamps all components of the input vector x to a and b.
[in] | x | Input vector. |
[in] | a | Minimum value. |
[in] | b | Maximum value. |
|
friend |
Transposes the input vectors.
[in,out] | a | Input / Output vector a. |
[in,out] | b | Input / Output vector b. |
[in,out] | c | Input / Output vector c. |
[in,out] | d | Input / Output vector d. |
Float32 v[4] |
union { ... } |
The internal SSE vector.