Vector4i32 Class Reference

#include <sse_vector_4i32.h>

Detailed Description

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 Member Functions

MAXON_ATTRIBUTE_FORCE_INLINE Vector4i32 ()
 
MAXON_ATTRIBUTE_FORCE_INLINE Vector4i32 (Int32 i)
 
MAXON_ATTRIBUTE_FORCE_INLINE Vector4i32 (Int32 i0, Int32 i1, Int32 i2, Int32 i3)
 
MAXON_ATTRIBUTE_FORCE_INLINE void LoadUnaligned (const Int32 *p)
 
MAXON_ATTRIBUTE_FORCE_INLINE void LoadAligned (const Int32 *p)
 
MAXON_ATTRIBUTE_FORCE_INLINE void StoreUnaligned (Int32 *p) const
 
MAXON_ATTRIBUTE_FORCE_INLINE void StoreAligned (Int32 *p) const
 
MAXON_ATTRIBUTE_FORCE_INLINE Int32operator[] (UInt i)
 
MAXON_ATTRIBUTE_FORCE_INLINE Int32 operator[] (UInt i) const
 
MAXON_ATTRIBUTE_FORCE_INLINE Vector4i32operator+= (const Vector4i32 &a)
 

Static Public Member Functions

template<Int32 imm>
static MAXON_ATTRIBUTE_FORCE_INLINE Vector4i32 ShiftLeft (const Vector4i32 &a)
 
template<Int32 ma4, Int32 ma3, Int32 ma2, Int32 ma1>
static MAXON_ATTRIBUTE_FORCE_INLINE Vector4i32 Shuffle (const Vector4i32 &a)
 

Protected Attributes

union {
   Int32   v [4]
 
   Int32   x
 
   Int32   y
 
   Int32   z
 
   Int32   w
 
}; 
 

Friends

Vector4f32 CastToVector4f32 (const Vector4i32 &a)
 
Vector4f32 ConvertToVector4f32 (const Vector4i32 &a)
 
Vector4i32 CastToVector4i32 (const Vector4f32 &a)
 
Vector4i32 ConvertToVector4i32 (const Vector4f32 &a)
 
MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4i32 operator+ (const Vector4i32 &a, const Vector4i32 &b)
 

Constructor & Destructor Documentation

◆ Vector4i32() [1/3]

Constructs the object. It does not set a default value.

◆ Vector4i32() [2/3]

Constructs the object and sets all values to i.

Parameters
[in]iThe value that is assigned to all vector elements.

◆ Vector4i32() [3/3]

MAXON_ATTRIBUTE_FORCE_INLINE Vector4i32 ( Int32  i0,
Int32  i1,
Int32  i2,
Int32  i3 
)
explicit

Constructs the object and sets all values to i0...i3.

Parameters
[in]i0The value that is assigned to vector element 0.
[in]i1The value that is assigned to vector element 1.
[in]i2The value that is assigned to vector element 2.
[in]i3The value that is assigned to vector element 3.

Member Function Documentation

◆ LoadUnaligned()

MAXON_ATTRIBUTE_FORCE_INLINE void LoadUnaligned ( const Int32 p)

Loads a vector from an address in the memory.

Parameters
[in]pThe address where the vector is loaded from.

◆ LoadAligned()

MAXON_ATTRIBUTE_FORCE_INLINE void LoadAligned ( const Int32 p)

Loads a vector from an address in the memory.

Parameters
[in]pThe address where the vector is loaded from, must be 16-byte aligned.

◆ StoreUnaligned()

MAXON_ATTRIBUTE_FORCE_INLINE void StoreUnaligned ( Int32 p) const

Stores the contents of this vector to an address in the memory.

Parameters
[in]pThe address where the vector is to be stored.

◆ StoreAligned()

MAXON_ATTRIBUTE_FORCE_INLINE void StoreAligned ( Int32 p) const

Stores the contents of this vector to an address in the memory.

Parameters
[in]pThe address where the vector is to be stored. It must be 16-byte aligned.

◆ operator[]() [1/2]

Gets component i from the vector.

Parameters
[in]iThe index.
Returns
Vector element.

◆ operator[]() [2/2]

MAXON_ATTRIBUTE_FORCE_INLINE Int32 operator[] ( UInt  i) const

Gets component i from the vector.

Parameters
[in]iThe index.
Returns
Vector element.

◆ operator+=()

Adds a vector to this.

Parameters
[in]aThe vector to add.
Returns
A reference to this vector.

◆ ShiftLeft()

static MAXON_ATTRIBUTE_FORCE_INLINE Vector4i32 ShiftLeft ( const Vector4i32 a)
static

Shifts the whole vector left. Note that the template argument must be a numeric constant. SSE2

Parameters
[in]aInput vector.
Template Parameters
immDefines the number of bytes to shift left.
Returns
The shifted vector.

◆ Shuffle()

static MAXON_ATTRIBUTE_FORCE_INLINE Vector4i32 Shuffle ( const Vector4i32 a)
static

Shuffles the components of the input vector. Note that the template arguments must be numeric constants.

Parameters
[in]aInput vector.
Template Parameters
ma1Decides which element of vector A becomes the new R0.
ma2Decides which element of vector A becomes the new R1.
ma3Decides which element of vector A becomes the new R2.
ma4Decides which element of vector A becomes the new R3.
Returns
A vector consisting of R0=A[ma1], R1=A[ma2], R2=A[ma2], R3=A[ma3]

Friends And Related Function Documentation

◆ CastToVector4f32

Vector4f32 CastToVector4f32 ( const Vector4i32 a)
friend

Casts a Vector4i32 to a Vector4f32 vector.

Returns
A Vector4f32 vector.

◆ ConvertToVector4f32

Vector4f32 ConvertToVector4f32 ( const Vector4i32 a)
friend

Converts a Vector4i32 to a Vector4f32 vector.

Returns
A Vector4f32 vector.

◆ CastToVector4i32

Vector4i32 CastToVector4i32 ( const Vector4f32 a)
friend

Casts a Vector4f32 to a Vector4i32 vector.

Returns
A Vector4i32 vector.

◆ ConvertToVector4i32

Vector4i32 ConvertToVector4i32 ( const Vector4f32 a)
friend

Converts a Vector4f32 to a Vector4i32 vector.

Returns
A Vector4i32 vector.

◆ operator+

MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4i32 operator+ ( const Vector4i32 a,
const Vector4i32 b 
)
friend

Adds two vectors.

Parameters
[in]aThe first operand.
[in]bThe second operand.
Returns
The sum of a and b.

Member Data Documentation

◆ v

Int32 v[4]

◆ x

Int32 x

◆ y

Int32 y

◆ z

Int32 z

◆ w

Int32 w

◆ 

union { ... }

The internal SSE vector.