1 #ifndef L1Algo_PSEUDO_F32vec4_H 2 #define L1Algo_PSEUDO_F32vec4_H 14 float min(
float x,
float y);
15 float max(
float x,
float y);
16 float asgnb(
float x,
float y);
45 F32vec4(
const float &f0,
const float &f1,
const float &f2,
const float &f3)
53 #define _f2(A, B, F) \ 55 z.v[0] = F(A.v[0], B.v[0]); \ 56 z.v[1] = F(A.v[1], B.v[1]); \ 57 z.v[2] = F(A.v[2], B.v[2]); \ 58 z.v[3] = F(A.v[3], B.v[3]); \ 67 #define _op(A, B, O) \ 69 z.v[0] = A.v[0] O B.v[0]; \ 70 z.v[1] = A.v[1] O B.v[1]; \ 71 z.v[2] = A.v[2] O B.v[2]; \ 72 z.v[3] = A.v[3] O B.v[3]; \ 106 z[0] = (a[0]) ? b[0] : c[0];
107 z[1] = (a[1]) ? b[1] : c[1];
108 z[2] = (a[2]) ? b[2] : c[2];
109 z[3] = (a[3]) ? b[3] : c[3];
114 #define NotEmpty(a) bool((a)[0]) | bool((a)[1]) | bool((a)[2]) | bool((a)[3]) 115 #define Empty(a) !(bool((a)[0]) | bool((a)[1]) | bool((a)[2]) | bool((a)[3])) 124 friend float min(
float x,
float y) {
return x < y ? x : y; }
125 friend float max(
float x,
float y) {
return x < y ? y : x; }
126 friend float asgnb(
float x,
float y) {
return y >= 0 ?
fabs(x) : -
fabs(x); }
128 friend float rcp(
float x) {
return 1. / x; }
129 friend float sgn(
float x) {
return x >= 0 ? 1 : -1; }
153 strm << a[0] <<
" " << a[1] <<
" " << a[2] <<
" " << a[3];
173 #define _fvecalignment 176 template <
typename T>
185 template <
typename T>
float asgnb(float x, float y)
friend F32vec4 operator!(const F32vec4 &a)
friend F32vec4 log(const F32vec4 &a)
friend float rcp(float x)
float min(float x, float y)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 rsqrt(const F32vec4 &a)
F32vec4(const float &f0, const float &f1, const float &f2, const float &f3)
nsL1::vector< fvec >::TSimd vector_fvec
vec_arithmetic(F32vec4, float)
friend F32vec4 operator>(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 operator+(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 exp(const F32vec4 &a)
friend F32vec4 operator||(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 rcp(const F32vec4 &a)
friend F32vec4 operator/(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 asgnb(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 operator|(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 if3(const F32vec4 &a, const F32vec4 &b, const F32vec4 &c)
friend F32vec4 operator<(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 bool2int(const F32vec4 &a)
friend F32vec4 cos(const F32vec4 &a)
friend F32vec4 operator<=(const F32vec4 &a, const F32vec4 &b)
float & operator[](int i)
friend F32vec4 operator &(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 fabs(const F32vec4 &a)
friend F32vec4 operator-(const F32vec4 &a, const F32vec4 &b)
float max(float x, float y)
friend F32vec4 sgn(const F32vec4 &a)
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 operator>=(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 sqrt(const F32vec4 &a)
friend ostream & operator<<(ostream &strm, const F32vec4 &a)
friend F32vec4 operator*(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 sin(const F32vec4 &a)
friend istream & operator>>(istream &strm, F32vec4 &a)
F32vec4(const F32vec4 &a)