34 #include <xmmintrin.h>
36 namespace Vectormath {
66 #ifdef _VECTORMATH_NO_SCALAR_CAST
73 inline operator float()
const;
79 inline __m128
get128()
const;
109 inline const floatInVec
operator * (
const floatInVec &vec0,
const floatInVec &vec1);
110 inline const floatInVec
operator / (
const floatInVec &vec0,
const floatInVec &vec1);
111 inline const floatInVec
operator + (
const floatInVec &vec0,
const floatInVec &vec1);
112 inline const floatInVec
operator - (
const floatInVec &vec0,
const floatInVec &vec1);
113 inline const boolInVec
operator < (
const floatInVec &vec0,
const floatInVec &vec1);
114 inline const boolInVec
operator <= (
const floatInVec &vec0,
const floatInVec &vec1);
115 inline const boolInVec
operator > (
const floatInVec &vec0,
const floatInVec &vec1);
116 inline const boolInVec
operator >= (
const floatInVec &vec0,
const floatInVec &vec1);
117 inline const boolInVec
operator == (
const floatInVec &vec0,
const floatInVec &vec1);
118 inline const boolInVec
operator != (
const floatInVec &vec0,
const floatInVec &vec1);
123 inline const floatInVec
select(
const floatInVec &vec0,
const floatInVec &vec1,
const boolInVec &select_vec1);
133 namespace Vectormath {
152 mData = _mm_set1_ps(v.
f[slot]);
158 mData = _mm_set1_ps(scalar);
161 #ifdef _VECTORMATH_NO_SCALAR_CAST
167 floatInVec::operator float() const
170 return *((
float *)&mData);
184 __m128 olddata =
mData;
193 __m128 olddata =
mData;
265 return floatInVec(_mm_mul_ps(vec0.get128(), vec1.get128()));
272 return floatInVec(_mm_div_ps(num.get128(), den.get128()));
279 return floatInVec(_mm_add_ps(vec0.get128(), vec1.get128()));
286 return floatInVec(_mm_sub_ps(vec0.get128(), vec1.get128()));
293 return boolInVec(_mm_cmpgt_ps(vec1.get128(), vec0.get128()));
300 return boolInVec(_mm_cmpge_ps(vec1.get128(), vec0.get128()));
307 return boolInVec(_mm_cmpgt_ps(vec0.get128(), vec1.get128()));
314 return boolInVec(_mm_cmpge_ps(vec0.get128(), vec1.get128()));
321 return boolInVec(_mm_cmpeq_ps(vec0.get128(), vec1.get128()));
328 return boolInVec(_mm_cmpneq_ps(vec0.get128(), vec1.get128()));
340 #endif // floatInVec_h
const boolInVec operator!=(boolInVec vec0, boolInVec vec1)
const floatInVec operator+(floatInVec vec0, floatInVec vec1)
const boolInVec operator<(floatInVec vec0, floatInVec vec1)
floatInVec & operator-=(floatInVec vec)
floatInVec & operator=(floatInVec vec)
friend const floatInVec operator+(const floatInVec &vec0, const floatInVec &vec1)
friend const floatInVec operator*(const floatInVec &vec0, const floatInVec &vec1)
const floatInVec operator*(floatInVec vec0, floatInVec vec1)
const boolInVec operator>=(floatInVec vec0, floatInVec vec1)
friend const floatInVec operator/(const floatInVec &vec0, const floatInVec &vec1)
const floatInVec operator-() const
floatInVec & operator--()
const boolInVec select(boolInVec vec0, boolInVec vec1, boolInVec select_vec1)
friend const floatInVec select(const floatInVec &vec0, const floatInVec &vec1, boolInVec select_vec1)
const boolInVec operator>(floatInVec vec0, floatInVec vec1)
floatInVec & operator++()
floatInVec & operator+=(floatInVec vec)
floatInVec & operator/=(floatInVec vec)
floatInVec & operator*=(floatInVec vec)
const boolInVec operator==(boolInVec vec0, boolInVec vec1)
const boolInVec operator<=(floatInVec vec0, floatInVec vec1)
static __m128 vec_sel(__m128 a, __m128 b, __m128 mask)
const floatInVec operator/(floatInVec vec0, floatInVec vec1)
const floatInVec operator-(floatInVec vec0, floatInVec vec1)