ReactOS  0.4.15-dev-494-g1d8c567
F32vec4 Class Reference

#include <fvec.h>

Collaboration diagram for F32vec4:

Public Member Functions

 F32vec4 ()
 
 F32vec4 (__m128 m)
 
 F32vec4 (float f3, float f2, float f1, float f0)
 
EXPLICIT F32vec4 (float f)
 
EXPLICIT F32vec4 (double d)
 
F32vec4operator= (float f)
 
F32vec4operator= (double d)
 
 operator __m128 () const
 
F32vec4operator= (const F32vec4 &a)
 
F32vec4operator= (const __m128 &avec)
 
F32vec4operator+= (F32vec4 &a)
 
F32vec4operator -= (F32vec4 &a)
 
F32vec4operator *= (F32vec4 &a)
 
F32vec4operator/= (F32vec4 &a)
 
F32vec4operator &= (F32vec4 &a)
 
F32vec4operator|= (F32vec4 &a)
 
F32vec4operator ^= (F32vec4 &a)
 
 Fvec32s4_COMP (eq) Fvec32s4_COMP(lt) Fvec32s4_COMP(le) Fvec32s4_COMP(gt) Fvec32s4_COMP(ge) Fvec32s4_COMP(neq) Fvec32s4_COMP(nlt) Fvec32s4_COMP(nle) Fvec32s4_COMP(ngt) Fvec32s4_COMP(nge) friend F32vec4 simd_min(const F32vec4 &a
 
const floatoperator[] (int i) const
 
floatoperator[] (int i)
 

Public Attributes

const F32vec4b { return _mm_min_ps(a,b)
 

Protected Attributes

__m128 vec
 

Friends

F32vec4 operator & (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator| (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator ^ (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator+ (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator - (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator * (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator/ (const F32vec4 &a, const F32vec4 &b)
 
float add_horizontal (F32vec4 &a)
 
F32vec4 sqrt (const F32vec4 &a)
 
F32vec4 rcp (const F32vec4 &a)
 
F32vec4 rsqrt (const F32vec4 &a)
 
F32vec4 rcp_nr (const F32vec4 &a)
 
F32vec4 rsqrt_nr (const F32vec4 &a)
 
F32vec4 simd_max (const F32vec4 &a, const F32vec4 &b)
 

Detailed Description

Definition at line 28 of file fvec.h.

Constructor & Destructor Documentation

◆ F32vec4() [1/5]

F32vec4::F32vec4 ( )
inline

Definition at line 32 of file fvec.h.

32 {}

◆ F32vec4() [2/5]

F32vec4::F32vec4 ( __m128  m)
inline

Definition at line 33 of file fvec.h.

33 { vec = m;}
const GLfloat * m
Definition: glext.h:10848
__m128 vec
Definition: fvec.h:30

◆ F32vec4() [3/5]

F32vec4::F32vec4 ( float  f3,
float  f2,
float  f1,
float  f0 
)
inline

Definition at line 34 of file fvec.h.

34 { vec= _mm_set_ps(f3,f2,f1,f0); }
#define f3(x, y, z)
Definition: sha1.c:32
#define f1(x, y, z)
Definition: sha1.c:30
__m128 vec
Definition: fvec.h:30
int f2(S1 &, S2 &)

◆ F32vec4() [4/5]

EXPLICIT F32vec4::F32vec4 ( float  f)
inline

Definition at line 35 of file fvec.h.

35 { vec = _mm_set_ps1(f); }
GLfloat f
Definition: glext.h:7540
__m128 vec
Definition: fvec.h:30

◆ F32vec4() [5/5]

EXPLICIT F32vec4::F32vec4 ( double  d)
inline

Definition at line 36 of file fvec.h.

36 { vec = _mm_set_ps1((float) d); }
#define d
Definition: ke_i.h:81
__m128 vec
Definition: fvec.h:30

Member Function Documentation

◆ Fvec32s4_COMP()

F32vec4::Fvec32s4_COMP ( eq  ) const &

◆ operator &=()

F32vec4& F32vec4::operator &= ( F32vec4 a)
inline

Definition at line 53 of file fvec.h.

53 { return *this = _mm_and_ps(vec,a); }
__m128 vec
Definition: fvec.h:30
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ operator *=()

F32vec4& F32vec4::operator *= ( F32vec4 a)
inline

Definition at line 51 of file fvec.h.

51 { return *this = _mm_mul_ps(vec,a); }
__m128 vec
Definition: fvec.h:30
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ operator -=()

F32vec4& F32vec4::operator -= ( F32vec4 a)
inline

Definition at line 50 of file fvec.h.

50 { return *this = _mm_sub_ps(vec,a); }
__m128 vec
Definition: fvec.h:30
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ operator ^=()

F32vec4& F32vec4::operator ^= ( F32vec4 a)
inline

Definition at line 55 of file fvec.h.

55 { return *this = _mm_xor_ps(vec,a); }
__m128 _mm_xor_ps(__m128 a, __m128 b)
__m128 vec
Definition: fvec.h:30
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ operator __m128()

F32vec4::operator __m128 ( ) const
inline

Definition at line 39 of file fvec.h.

39 { return vec; }
__m128 vec
Definition: fvec.h:30

◆ operator+=()

F32vec4& F32vec4::operator+= ( F32vec4 a)
inline

Definition at line 49 of file fvec.h.

49 { return *this = _mm_add_ps(vec,a); }
__m128 vec
Definition: fvec.h:30
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ operator/=()

F32vec4& F32vec4::operator/= ( F32vec4 a)
inline

Definition at line 52 of file fvec.h.

52 { return *this = _mm_div_ps(vec,a); }
__m128 _mm_div_ps(__m128 a, __m128 b)
__m128 vec
Definition: fvec.h:30
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ operator=() [1/4]

F32vec4& F32vec4::operator= ( float  f)
inline

Definition at line 37 of file fvec.h.

37 { vec = _mm_set_ps1(f); return *this; }
GLfloat f
Definition: glext.h:7540
__m128 vec
Definition: fvec.h:30

◆ operator=() [2/4]

F32vec4& F32vec4::operator= ( double  d)
inline

Definition at line 38 of file fvec.h.

38 { vec = _mm_set_ps1((float) d); return *this; }
#define d
Definition: ke_i.h:81
__m128 vec
Definition: fvec.h:30

◆ operator=() [3/4]

Definition at line 47 of file fvec.h.

47 { vec = a.vec; return *this; }
__m128 vec
Definition: fvec.h:30
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ operator=() [4/4]

F32vec4& F32vec4::operator= ( const __m128 avec)
inline

Definition at line 48 of file fvec.h.

48 { vec = avec; return *this; }
__m128 vec
Definition: fvec.h:30

◆ operator[]() [1/2]

const float& F32vec4::operator[] ( int  i) const
inline

Definition at line 100 of file fvec.h.

100  {
101  assert((0 <= i) && (i <= 3));
102  float *fp = (float*)&vec;
103  return *(fp+i);
104  }
#define assert(x)
Definition: debug.h:53
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
__m128 vec
Definition: fvec.h:30

◆ operator[]() [2/2]

float& F32vec4::operator[] ( int  i)
inline

Definition at line 105 of file fvec.h.

105  {
106  assert((0 <= i) && (i <= 3));
107  float *fp = (float*)&vec;
108  return *(fp+i);
109  }
#define assert(x)
Definition: debug.h:53
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
__m128 vec
Definition: fvec.h:30

◆ operator|=()

F32vec4& F32vec4::operator|= ( F32vec4 a)
inline

Definition at line 54 of file fvec.h.

54 { return *this = _mm_or_ps(vec,a); }
__m128 vec
Definition: fvec.h:30
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Friends And Related Function Documentation

◆ add_horizontal

float add_horizontal ( F32vec4 a)
friend

Definition at line 56 of file fvec.h.

56  {
57  F32vec4 ftemp = _mm_add_ss(a,_mm_add_ss(_mm_shuffle_ps(a,a,1),_mm_add_ss(_mm_shuffle_ps(a,a,2),_mm_shuffle_ps(a,a,3))));
58  return ftemp[0];
59  }
Definition: fvec.h:28
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ operator &

F32vec4 operator & ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 40 of file fvec.h.

40 { return _mm_and_ps(a,b); }
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ operator *

F32vec4 operator * ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 45 of file fvec.h.

45 { return _mm_mul_ps(a,b); }
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ operator -

F32vec4 operator - ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 44 of file fvec.h.

44 { return _mm_sub_ps(a,b); }
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ operator ^

F32vec4 operator ^ ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 42 of file fvec.h.

42 { return _mm_xor_ps(a,b); }
__m128 _mm_xor_ps(__m128 a, __m128 b)
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ operator+

F32vec4 operator+ ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 43 of file fvec.h.

43 { return _mm_add_ps(a,b); }
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ operator/

F32vec4 operator/ ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 46 of file fvec.h.

46 { return _mm_div_ps(a,b); }
__m128 _mm_div_ps(__m128 a, __m128 b)
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ operator|

F32vec4 operator| ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 41 of file fvec.h.

41 { return _mm_or_ps(a,b); }
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ rcp

F32vec4 rcp ( const F32vec4 a)
friend

Definition at line 61 of file fvec.h.

61 { return _mm_rcp_ps(a); }
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ rcp_nr

F32vec4 rcp_nr ( const F32vec4 a)
friend

Definition at line 63 of file fvec.h.

63  {
64  F32vec4 Ra0 = _mm_rcp_ps(a);
65  return _mm_sub_ps(_mm_add_ps(Ra0,Ra0),_mm_mul_ps(_mm_mul_ps(Ra0,a),Ra0));
66  }
Definition: fvec.h:28
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ rsqrt

F32vec4 rsqrt ( const F32vec4 a)
friend

Definition at line 62 of file fvec.h.

62 { return _mm_rsqrt_ps(a); }
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ rsqrt_nr

F32vec4 rsqrt_nr ( const F32vec4 a)
friend

Definition at line 67 of file fvec.h.

67  {
68  static const F32vec4 fvecf0pt5(0.5f);
69  static const F32vec4 fvecf3pt0(3.0f);
70  F32vec4 Ra0 = _mm_rsqrt_ps(a);
71  return (fvecf0pt5 *Ra0) *(fvecf3pt0 - (a *Ra0) *Ra0);
72 
73  }
Definition: fvec.h:28
GLfloat f
Definition: glext.h:7540
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ simd_max

F32vec4 simd_max ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 88 of file fvec.h.

88 { return _mm_max_ps(a,b); }
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ sqrt

F32vec4 sqrt ( const F32vec4 a)
friend

Definition at line 60 of file fvec.h.

60 { return _mm_sqrt_ps(a); }
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Member Data Documentation

◆ b

const F32vec4& F32vec4::b { return _mm_min_ps(a,b)

Definition at line 87 of file fvec.h.

◆ vec


The documentation for this class was generated from the following file: