This class represents a four by four matrix stored in the SSE registers.
#include <SSE.h>
Public Member Functions |
|
HWMatrix (void) | |
HWMatrix (const mudbox::Matrix &m) | |
void | MirrorX (void) |
HWVector | Transform (const HWVector &v) const |
HWVector | ProjectedTransform (const HWVector &v) const |
MB_SSE_ALIGN16_VAR (__m128 r0) | |
MB_SSE_ALIGN16_VAR (__m128 r1) | |
MB_SSE_ALIGN16_VAR (__m128 r2) | |
MB_SSE_ALIGN16_VAR (__m128 r3) |
HWMatrix | ( | const mudbox::Matrix & | m | ) | [inline] |
void MirrorX | ( | void | ) | [inline] |
Definition at line 271 of file SSE.h.
{ static MB_SSE_ALIGN16_VAR(float c[4]) = { 1, 1, 1, 1 }; __m128 v0 = _mm_shuffle_ps( v.v, v.v, _MM_SHUFFLE(3,3,3,3) ); __m128 v1 = _mm_shuffle_ps( v.v, v.v, _MM_SHUFFLE(2,2,2,2) ); __m128 v2 = _mm_shuffle_ps( v.v, v.v, _MM_SHUFFLE(1,1,1,1) ); __m128 v3 = _mm_load_ps( c ); __m128 a0 = _mm_mul_ps( v0, r0 ); __m128 a1 = _mm_mul_ps( v1, r1 ); __m128 a2 = _mm_mul_ps( v2, r2 ); __m128 a3 = _mm_mul_ps( v3, r3 ); __m128 r = _mm_add_ps( a0, _mm_add_ps( a1, _mm_add_ps( a2, a3 ) ) ); HWVector z; z.v = r; return z; };
Definition at line 291 of file SSE.h.
{ static MB_SSE_ALIGN16_VAR(float c[4]) = { 1, 1, 1, 1 }; __m128 v0 = _mm_shuffle_ps( v.v, v.v, _MM_SHUFFLE(3,3,3,3) ); __m128 v1 = _mm_shuffle_ps( v.v, v.v, _MM_SHUFFLE(2,2,2,2) ); __m128 v2 = _mm_shuffle_ps( v.v, v.v, _MM_SHUFFLE(1,1,1,1) ); __m128 v3 = _mm_load_ps( c ); __m128 a0 = _mm_mul_ps( v0, r0 ); __m128 a1 = _mm_mul_ps( v1, r1 ); __m128 a2 = _mm_mul_ps( v2, r2 ); __m128 a3 = _mm_mul_ps( v3, r3 ); __m128 r = _mm_add_ps( a0, _mm_add_ps( a1, _mm_add_ps( a2, a3 ) ) ); __m128 d = _mm_shuffle_ps( r, r, _MM_SHUFFLE(3,3,3,3) ); HWVector z; z.v = _mm_div_ps( r, d ); return z; };
MB_SSE_ALIGN16_VAR | ( | __m128 | r0 | ) |
MB_SSE_ALIGN16_VAR | ( | __m128 | r1 | ) |
MB_SSE_ALIGN16_VAR | ( | __m128 | r2 | ) |
MB_SSE_ALIGN16_VAR | ( | __m128 | r3 | ) |