HWVector Struct Reference
#include <SSE.h>
This class represents a four dimensional vector stored in the SSE registers.
Definition at line 64 of file SSE.h.
Definition at line 66 of file SSE.h.
Definition at line 73 of file SSE.h.
Definition at line 78 of file SSE.h.
80 v = _mm_set_ps( h.
x, h.
y, h.
z, 0);
HWVector |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z, |
|
|
float |
w = 0 |
|
) |
| |
|
inline |
Definition at line 82 of file SSE.h.
84 v = _mm_set_ps(
x,
y,
z,
w );
GLubyte GLubyte GLubyte GLubyte w
Definition at line 87 of file SSE.h.
89 v = _mm_loadu_ps(
a );
GLubyte GLubyte GLubyte a
Definition at line 68 of file SSE.h.
Definition at line 91 of file SSE.h.
91 {
HWVector r; r.v = _mm_shuffle_ps(
v,
v,_MM_SHUFFLE(2,1,3,0));
return r; };
GLdouble GLdouble GLdouble r
This class represents a four dimensional vector stored in the SSE registers.
Definition at line 92 of file SSE.h.
92 { result.v = _mm_shuffle_ps(
v,
v,_MM_SHUFFLE(2,1,3,0)); }
void ShiftLeftInPlace |
( |
| ) |
|
|
inline |
Definition at line 93 of file SSE.h.
93 {
v = _mm_shuffle_ps(
v,
v,_MM_SHUFFLE(2,1,3,0)); }
Definition at line 94 of file SSE.h.
94 {
HWVector r; r.v = _mm_shuffle_ps(
v,
v,_MM_SHUFFLE(1,3,2,0));
return r; };
GLdouble GLdouble GLdouble r
This class represents a four dimensional vector stored in the SSE registers.
Definition at line 95 of file SSE.h.
95 { result.v = _mm_shuffle_ps(
v,
v,_MM_SHUFFLE(1,3,2,0)); };
Definition at line 96 of file SSE.h.
This class represents a four dimensional vector stored in the SSE registers.
HWVector ShiftLeft(void) const __attribute__((always_inline))
HWVector ShiftRight(void) const __attribute__((always_inline))
Definition at line 108 of file SSE.h.
111 r.v = _mm_mul_ps(
v, o.v );
113 r.v = _mm_hadd_ps( r.v, r.v );
114 r.v = _mm_hadd_ps( r.v, r.v );
GLdouble GLdouble GLdouble r
This class represents a four dimensional vector stored in the SSE registers.
Definition at line 118 of file SSE.h.
121 r.v = _mm_sqrt_ss( r.v );
GLdouble GLdouble GLdouble r
This class represents a four dimensional vector stored in the SSE registers.
HWVector operator|(const HWVector &o) const __attribute__((always_inline))
Definition at line 125 of file SSE.h.
GLdouble GLdouble GLdouble r
This class represents a four dimensional vector stored in the SSE registers.
HWVector operator|(const HWVector &o) const __attribute__((always_inline))
Definition at line 131 of file SSE.h.
138 float fDistance = (d|(*this))-(d|vStart);
139 return fDistance>0?fDistance:(-fDistance);
This class represents a four dimensional vector stored in the SSE registers.
void Normalize(void) __attribute__((always_inline))
int int int int int int h
Definition at line 142 of file SSE.h.
145 f.v = _mm_rsqrt_ps( f.v );
146 v = _mm_mul_ps( f.v,
v );
This class represents a four dimensional vector stored in the SSE registers.
HWVector operator|(const HWVector &o) const __attribute__((always_inline))
Definition at line 149 of file SSE.h.
151 static const unsigned int a = (1 << 23);
152 static const float twoTo23AsFloat = (float)a;
153 static const __m128 twoTo23 = _mm_set_ps( twoTo23AsFloat, twoTo23AsFloat, twoTo23AsFloat, twoTo23AsFloat );
155 __m128
b = _mm_castsi128_ps(_mm_srli_epi32( _mm_slli_epi32( _mm_castps_si128(
v),1 ), 1 ));
157 __m128 d = _mm_sub_ps( _mm_add_ps( _mm_add_ps( _mm_sub_ps(
v, twoTo23 ), twoTo23 ), twoTo23 ), twoTo23 );
159 __m128 largeMaskE = _mm_cmpgt_ps( b, twoTo23 );
161 __m128
g = _mm_cmplt_ps(
v, d );
163 __m128
h = _mm_cvtepi32_ps( _mm_castps_si128(g) );
165 __m128
t = _mm_add_ps( d, h );
167 __m128
w = _mm_and_ps(
v, largeMaskE );
168 t = _mm_andnot_ps( largeMaskE, t );
170 vResult.v = _mm_or_ps( t, w );
This class represents a four dimensional vector stored in the SSE registers.
int int int int int int h
GLubyte GLubyte GLubyte a
GLubyte GLubyte GLubyte GLubyte w
Definition at line 174 of file SSE.h.
174 {
HWVector r; r.v = _mm_min_ps(
v, o.v );
return r; };
GLdouble GLdouble GLdouble r
This class represents a four dimensional vector stored in the SSE registers.
Definition at line 175 of file SSE.h.
175 {
HWVector r; r.v = _mm_max_ps(
v, o.v );
return r; };
GLdouble GLdouble GLdouble r
This class represents a four dimensional vector stored in the SSE registers.
Definition at line 176 of file SSE.h.
176 {
HWVector r; r.v = _mm_add_ps(
v, o.v );
return r; };
GLdouble GLdouble GLdouble r
This class represents a four dimensional vector stored in the SSE registers.
Definition at line 177 of file SSE.h.
177 {
HWVector r; r.v = _mm_sub_ps(
v, o.v );
return r; };
GLdouble GLdouble GLdouble r
This class represents a four dimensional vector stored in the SSE registers.
Definition at line 178 of file SSE.h.
178 {
v = _mm_add_ps(
v, o.v ); };
Definition at line 179 of file SSE.h.
179 {
v = _mm_sub_ps(
v, o.v ); };
Definition at line 180 of file SSE.h.
180 {
v = _mm_mul_ps(
v, o.v ); };
Definition at line 181 of file SSE.h.
181 {
v = _mm_div_ps(
v, o.v ); };
Definition at line 182 of file SSE.h.
182 {
HWVector r; r.v = _mm_mul_ps(
v, o.v );
return r; };
GLdouble GLdouble GLdouble r
This class represents a four dimensional vector stored in the SSE registers.
Definition at line 183 of file SSE.h.
183 {
HWVector r; r.v = _mm_mul_ps(
v, _mm_set1_ps(
f ) );
return r; };
GLdouble GLdouble GLdouble r
This class represents a four dimensional vector stored in the SSE registers.
Definition at line 184 of file SSE.h.
184 {
HWVector r; r.v = _mm_div_ps(
v, o.v );
return r; };
GLdouble GLdouble GLdouble r
This class represents a four dimensional vector stored in the SSE registers.
void operator*= |
( |
float |
f | ) |
|
|
inline |
Definition at line 185 of file SSE.h.
185 {
v = _mm_mul_ps(
v, _mm_set1_ps(
f ) ); };
Definition at line 186 of file SSE.h.
186 { _mm_storeu_ps(
p,
v ); };
Definition at line 187 of file SSE.h.
187 {
v = _mm_set_ps1(
f ); };
void StoreNormalAsInt |
( |
int * |
pBuffer | ) |
const |
|
inline |
Definition at line 188 of file SSE.h.
196 __m128
f = _mm_load_ps(
c );
197 f = _mm_mul_ps( f,
v );
198 __m128i i = _mm_cvtps_epi32( f );
199 _mm_storeu_si128( (__m128i *)pBuffer, i );
MB_SSE_ALIGN16_VAR(__m128 v)
void StoreAsInt |
( |
int * |
pBuffer | ) |
const |
|
inline |
Definition at line 201 of file SSE.h.
203 __m128i i = _mm_cvtps_epi32(
v );
204 _mm_storeu_si128( (__m128i *)pBuffer, i );
void StoreAsIntTruncate |
( |
int * |
pBuffer | ) |
const |
|
inline |
Definition at line 206 of file SSE.h.
208 __m128i i = _mm_cvttps_epi32(
v );
209 _mm_storeu_si128( (__m128i *)pBuffer, i );
operator float |
( |
void |
| ) |
const |
|
inline |
Definition at line 211 of file SSE.h.
214 _mm_store_ss( &
f,
v );
MB_SSE_ALIGN16_VAR(__m128 v)
Definition at line 217 of file SSE.h.
220 __m128
t = _mm_shuffle_ps(
v,
v, _MM_SHUFFLE(2,1,0,3) );
221 _mm_store_ss( &r.
x, t );
222 t = _mm_shuffle_ps( t, t, _MM_SHUFFLE(2,1,0,3) );
223 _mm_store_ss( &r.
y, t );
224 t = _mm_shuffle_ps( t, t, _MM_SHUFFLE(2,1,0,3) );
225 _mm_store_ss( &r.
z, t );
GLdouble GLdouble GLdouble r
Represents a 3D vector or point with S23E8 floating point elements.
Definition at line 228 of file SSE.h.
231 __m128
t = _mm_shuffle_ps(
v,
v, _MM_SHUFFLE(2,1,0,3) );
232 _mm_store_ss( &r.
x, t );
233 t = _mm_shuffle_ps( t, t, _MM_SHUFFLE(2,1,0,3) );
234 _mm_store_ss( &r.
y, t );
235 t = _mm_shuffle_ps( t, t, _MM_SHUFFLE(2,1,0,3) );
236 _mm_store_ss( &r.
z, t );
237 t = _mm_shuffle_ps( t, t, _MM_SHUFFLE(2,1,0,3) );
238 _mm_store_ss( &r.
w, t );
GLdouble GLdouble GLdouble r
A four dimensionsional vector (X, Y, Z, and W)
MB_SSE_ALIGN16_VAR |
( |
__m128 |
v | ) |
|
The documentation for this struct was generated from the following file: