STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Macros | Functions | Variables
fvec.h File Reference
#include <xmmintrin.h>
#include <ivec.h>
#include <crtdefs.h>

Go to the source code of this file.

Classes

class  F32vec4
 
class  F32vec1
 

Macros

#define _VEC_ASSERT(_Expression)   (void)( (!!(_Expression)) || (_wassert(_CRT_WIDE(#_Expression), _CRT_WIDE(__FILE__), __LINE__), 0) )
 
#define _f32vec4_abs_mask   ((F32vec4)__f32vec4_abs_mask_cheat.m)
 
#define Fvec32s4_COMP(op)   friend F32vec4 cmp##op (const F32vec4 &a, const F32vec4 &b) { return _mm_cmp##op##_ps(a,b); }
 
#define Fvec32s4_SELECT(op)
 
#define Fvec32s1_COMP(op)   friend F32vec1 cmp##op (const F32vec1 &a, const F32vec1 &b) { return _mm_cmp##op##_ss(a,b); }
 
#define Fvec32s1_SELECT(op)
 

Functions

_CRTIMP void __cdecl _wassert (_In_z_ const wchar_t *_Message, _In_z_ const wchar_t *_File, _In_ unsigned _Line)
 
F32vec4 unpack_low (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 unpack_high (const F32vec4 &a, const F32vec4 &b)
 
int move_mask (const F32vec4 &a)
 
void loadu (F32vec4 &a, float *p)
 
void storeu (float *p, const F32vec4 &a)
 
void store_nta (float *p, const F32vec4 &a)
 
 Fvec32s4_SELECT (eq) Fvec32s4_SELECT(lt) Fvec32s4_SELECT(le) Fvec32s4_SELECT(gt) Fvec32s4_SELECT(ge) Fvec32s4_SELECT(neq) Fvec32s4_SELECT(nlt) Fvec32s4_SELECT(nle) Fvec32s4_SELECT(ngt) Fvec32s4_SELECT(nge) inline Is16vec4 simd_max(const Is16vec4 &a
 
const Is16vec4 &b return _m_pmaxsw (a, b)
 
Is16vec4 simd_min (const Is16vec4 &a, const Is16vec4 &b)
 
Iu8vec8 simd_max (const Iu8vec8 &a, const Iu8vec8 &b)
 
Iu8vec8 simd_min (const Iu8vec8 &a, const Iu8vec8 &b)
 
Iu16vec4 simd_avg (const Iu16vec4 &a, const Iu16vec4 &b)
 
Iu8vec8 simd_avg (const Iu8vec8 &a, const Iu8vec8 &b)
 
int move_mask (const I8vec8 &a)
 
Iu16vec4 mul_high (const Iu16vec4 &a, const Iu16vec4 &b)
 
void mask_move (const I8vec8 &a, const I8vec8 &b, char *addr)
 
void store_nta (__m64 *p, const M64 &a)
 
int F32vec4ToInt (const F32vec4 &a)
 
Is32vec2 F32vec4ToIs32vec2 (const F32vec4 &a)
 
F32vec4 IntToF32vec4 (const F32vec4 &a, int i)
 
F32vec4 Is32vec2ToF32vec4 (const F32vec4 &a, const Is32vec2 &b)
 
 Fvec32s1_SELECT (eq) Fvec32s1_SELECT(lt) Fvec32s1_SELECT(le) Fvec32s1_SELECT(gt) Fvec32s1_SELECT(ge) Fvec32s1_SELECT(neq) Fvec32s1_SELECT(nlt) Fvec32s1_SELECT(nle) Fvec32s1_SELECT(ngt) Fvec32s1_SELECT(nge) inline int F32vec1ToInt(const F32vec1 &a)
 

Variables

union {
   int   i [4]
 
   __m128   m
 
__f32vec4_abs_mask_cheat = {0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff}
 

Macro Definition Documentation

#define _f32vec4_abs_mask   ((F32vec4)__f32vec4_abs_mask_cheat.m)
#define _VEC_ASSERT (   _Expression)    (void)( (!!(_Expression)) || (_wassert(_CRT_WIDE(#_Expression), _CRT_WIDE(__FILE__), __LINE__), 0) )
#define Fvec32s1_COMP (   op)    friend F32vec1 cmp##op (const F32vec1 &a, const F32vec1 &b) { return _mm_cmp##op##_ss(a,b); }
#define Fvec32s1_SELECT (   op)
Value:
inline F32vec1 select_##op (const F32vec1 &a, const F32vec1 &b, const F32vec1 &c, const F32vec1 &d) \
{ \
F32vec1 mask = _mm_cmp##op##_ss(a,b); \
return( (mask & c) | F32vec1((_mm_andnot_ps(mask,d)))); \
}
Definition: fvec.h:352
__m128 _mm_andnot_ps(__m128 _A, __m128 _B)
return(_PAIR_TYPE(_FwdIt)(_First, _First))
#define Fvec32s4_COMP (   op)    friend F32vec4 cmp##op (const F32vec4 &a, const F32vec4 &b) { return _mm_cmp##op##_ps(a,b); }
#define Fvec32s4_SELECT (   op)
Value:
inline F32vec4 select_##op (const F32vec4 &a, const F32vec4 &b, const F32vec4 &c, const F32vec4 &d) \
{ \
F32vec4 mask = _mm_cmp##op##_ps(a,b); \
return( (mask & c) | F32vec4((_mm_andnot_ps(mask,d)))); \
}
Definition: fvec.h:82
__m128 _mm_andnot_ps(__m128 _A, __m128 _B)
return(_PAIR_TYPE(_FwdIt)(_First, _First))

Function Documentation

const Is16vec4& b return _m_pmaxsw ( ,
 
)
_CRTIMP void __cdecl _wassert ( _In_z_ const wchar_t _Message,
_In_z_ const wchar_t _File,
_In_ unsigned  _Line 
)
int F32vec4ToInt ( const F32vec4 a)
inline
317 {
318 
319  return _mm_cvtt_ss2si(a);
320 
321 }
int _mm_cvtt_ss2si(__m128 _A)
Is32vec2 F32vec4ToIs32vec2 ( const F32vec4 a)
inline
325 {
326 
327  __m64 result;
328  result = _mm_cvtt_ps2pi(a);
329  return Is32vec2(result);
330 
331 }
Definition: ivec.h:195
__m64 _mm_cvtt_ps2pi(__m128 _A)
__m64
Definition: mmintrin.h:42
Fvec32s1_SELECT ( eq  ) const
492 {
493  return _mm_cvtt_ss2si(a);
494 }
int _mm_cvtt_ss2si(__m128 _A)
Fvec32s4_SELECT ( eq  ) const
F32vec4 IntToF32vec4 ( const F32vec4 a,
int  i 
)
inline
335 {
336 
337  __m128 result;
338  result = _mm_cvt_si2ss(a,i);
339  return F32vec4(result);
340 
341 }
Definition: fvec.h:82
__m128
Definition: xmmintrin.h:70
__m128 _mm_cvt_si2ss(__m128, int)
int i[4]
Definition: fvec.h:76
F32vec4 Is32vec2ToF32vec4 ( const F32vec4 a,
const Is32vec2 b 
)
inline
345 {
346 
347  __m128 result;
348  result = _mm_cvt_pi2ps(a,b);
349  return F32vec4(result);
350 }
Definition: fvec.h:82
__m128 _mm_cvt_pi2ps(__m128, __m64)
__m128
Definition: xmmintrin.h:70
void loadu ( F32vec4 a,
float *  p 
)
inline
248 { a = _mm_loadu_ps(p); }
__m128 _mm_loadu_ps(float const *_A)
void mask_move ( const I8vec8 a,
const I8vec8 b,
char *  addr 
)
inline
308 { _m_maskmovq(a, b, addr); }
void _m_maskmovq(__m64, __m64, char *)
int move_mask ( const F32vec4 a)
inline
242 { return _mm_movemask_ps(a);}
int _mm_movemask_ps(__m128 _A)
int move_mask ( const I8vec8 a)
inline
302 { return _m_pmovmskb(a);}
int _m_pmovmskb(__m64)
Iu16vec4 mul_high ( const Iu16vec4 a,
const Iu16vec4 b 
)
inline
305 { return _m_pmulhuw(a,b); }
__m64 _m_pmulhuw(__m64, __m64)
Iu16vec4 simd_avg ( const Iu16vec4 a,
const Iu16vec4 b 
)
inline
298 { return _mm_avg_pu16(a,b); }
#define _mm_avg_pu16
Definition: xmmintrin.h:360
Iu8vec8 simd_avg ( const Iu8vec8 a,
const Iu8vec8 b 
)
inline
299 { return _mm_avg_pu8(a,b); }
#define _mm_avg_pu8
Definition: xmmintrin.h:359
Iu8vec8 simd_max ( const Iu8vec8 a,
const Iu8vec8 b 
)
inline
294 { return _m_pmaxub(a,b);}
__m64 _m_pmaxub(__m64, __m64)
Is16vec4 simd_min ( const Is16vec4 a,
const Is16vec4 b 
)
inline
293 { return _m_pminsw(a,b);}
__m64 _m_pminsw(__m64, __m64)
Iu8vec8 simd_min ( const Iu8vec8 a,
const Iu8vec8 b 
)
inline
295 { return _m_pminub(a,b);}
__m64 _m_pminub(__m64, __m64)
void store_nta ( float *  p,
const F32vec4 a 
)
inline
258 { _mm_stream_ps(p,a);}
void _mm_stream_ps(float *, __m128)
void store_nta ( __m64 p,
const M64 a 
)
inline
311 { _mm_stream_pi(p,a); }
void _mm_stream_pi(__m64 *, __m64)
void storeu ( float *  p,
const F32vec4 a 
)
inline
252 { _mm_storeu_ps(p, a); }
void _mm_storeu_ps(float *_V, __m128 _A)
F32vec4 unpack_high ( const F32vec4 a,
const F32vec4 b 
)
inline
238 { return _mm_unpackhi_ps(a, b); }
__m128 _mm_unpackhi_ps(__m128 _A, __m128 _B)
F32vec4 unpack_low ( const F32vec4 a,
const F32vec4 b 
)
inline
234 { return _mm_unpacklo_ps(a, b); }
__m128 _mm_unpacklo_ps(__m128 _A, __m128 _B)

Variable Documentation

const { ... } __f32vec4_abs_mask_cheat
int i[4]
__m128 m