36 point(
const __m128& rhs);
39 void load(
const scalar* ptr);
41 void loadu(
const scalar* ptr);
43 void store(
scalar* ptr)
const;
45 void storeu(
scalar* ptr)
const;
47 void store3(
scalar* ptr)
const;
49 void storeu3(
scalar* ptr)
const;
52 void operator=(
const point& rhs);
54 void operator=(
const __m128& rhs);
56 void operator+=(
const vector& rhs);
58 void operator-=(
const vector& rhs);
64 float operator[](
int index)
const;
66 float& operator[](
int index);
68 operator vec4()
const;
89 this->
vec = _mm_setr_ps(0, 0, 0, 1);
98 this->
vec = _mm_setr_ps(
x,
y,
z, 1);
107 this->
vec = _mm_setr_ps(v, v, v, 1);
148 this->
vec = _mm_insert_ps(rhs,
_id_w, 0b11110000);
166 this->
vec = _mm_insert_ps(rhs,
_id_w, 0b11110000);
175 this->
vec = _mm_add_ps(this->
vec, rhs.
vec);
184 this->
vec = _mm_sub_ps(this->
vec, rhs.
vec);
194 this->
vec = _mm_load_ps(ptr);
204 this->
vec = _mm_loadu_ps(ptr);
214 _mm_store_ps(ptr, this->
vec);
224 _mm_storeu_ps(ptr, this->
vec);
234 __m128 v = _mm_permute_ps(this->
vec, _MM_SHUFFLE(2, 2, 2, 2));
235 _mm_storel_epi64(
reinterpret_cast<__m128i*
>(ptr), _mm_castps_si128(this->
vec));
236 _mm_store_ss(&ptr[2], v);
246 __m128 t1 = _mm_permute_ps(this->
vec, _MM_SHUFFLE(1, 1, 1, 1));
247 __m128 t2 = _mm_permute_ps(this->
vec, _MM_SHUFFLE(2, 2, 2, 2));
248 _mm_store_ss(&ptr[0], this->
vec);
249 _mm_store_ss(&ptr[1], t1);
250 _mm_store_ss(&ptr[2], t2);
258 return _mm_add_ps(lhs.
vec, rhs.
vec);
267 return _mm_sub_ps(lhs.
vec, rhs.
vec);
276 return _mm_sub_ps(lhs.
vec, rhs.
vec);
285 __m128 vTemp = _mm_cmpeq_ps(this->
vec, rhs.
vec);
286 return ((_mm_movemask_ps(vTemp) == 0x0f) != 0);
295 __m128 vTemp = _mm_cmpeq_ps(this->
vec, rhs.
vec);
296 return ((_mm_movemask_ps(vTemp) == 0x0f) == 0);
306 return *((&this->
x) + index);
316 return *((&this->
x) + index);
325 return vec4(this->vec);
334 this->
vec = _mm_setr_ps(
x,
y,
z, 1);
343 return _mm_cvtss_f32(_mm_dp_ps(p0.
vec, p1.
vec, 0x71));
352 return _mm_cvtss_f32(_mm_dp_ps(v.
vec, p.
vec, 0x71));
361 return _mm_cvtss_f32(_mm_dp_ps(p.
vec, v.
vec, 0x71));
370 return _mm_max_ps(v0.
vec, v1.
vec);
379 return _mm_min_ps(v0.
vec, v1.
vec);
388 __m128 vTemp = _mm_cmpge_ps(v0.
vec, v1.
vec);
389 int res = _mm_movemask_ps(vTemp) & 7;
399 __m128 vTemp = _mm_cmpge_ps(v0.
vec, v1.
vec);
400 int res = _mm_movemask_ps(vTemp) & 7;
410 __m128 vTemp = _mm_cmpgt_ps(v0.
vec, v1.
vec);
411 int res = _mm_movemask_ps(vTemp) & 7;
421 __m128 vTemp = _mm_cmpgt_ps(v0.
vec, v1.
vec);
422 int res = _mm_movemask_ps(vTemp) & 7;
432 __m128 vTemp = _mm_cmpgt_ps(v0.
vec, v1.
vec);
433 int res = _mm_movemask_ps(vTemp) & 7;
443 __m128 vTemp = _mm_cmpgt_ps(v0.
vec, v1.
vec);
444 int res = _mm_movemask_ps(vTemp) & 7;
454 __m128 vTemp = _mm_cmpge_ps(v0.
vec, v1.
vec);
455 int res = _mm_movemask_ps(vTemp) & 7;
465 __m128 vTemp = _mm_cmpge_ps(v0.
vec, v1.
vec);
466 int res = _mm_movemask_ps(vTemp) & 7;
476 __m128 vTemp = _mm_cmpeq_ps(v0.
vec, v1.
vec);
477 int res = _mm_movemask_ps(vTemp) & 7;
487 __m128 eps = _mm_set1_ps(epsilon);
488 __m128 delta = _mm_sub_ps(v0.
vec, v1.
vec);
489 __m128 temp = _mm_setzero_ps();
490 temp = _mm_sub_ps(temp, delta);
491 temp = _mm_max_ps(temp, delta);
492 temp = _mm_cmple_ps(temp, eps);
494 return (_mm_movemask_ps(temp) == 0x7) != 0;
503 return _mm_min_ps(_mm_cmplt_ps(v0.
vec, v1.
vec),
_plus1);
512 return _mm_min_ps(_mm_cmpgt_ps(v0.
vec, v1.
vec),
_plus1);
521 return _mm_min_ps(_mm_cmpeq_ps(v0.
vec, v1.
vec),
_plus1);
#define n_assert(exp)
Definition debug.h:50
Different curves.
Definition angularpfeedbackloop.h:17
__forceinline point less(const point &v0, const point &v1)
Definition point.h:501
__forceinline point maximize(const point &v0, const point &v1)
Definition point.h:368
__forceinline bool equal_any(const point &v0, const point &v1)
Definition point.h:474
__forceinline bool greaterequal_any(const point &v0, const point &v1)
Definition point.h:452
__forceinline point equal(const point &v0, const point &v1)
Definition point.h:519
__forceinline scalar dot(const plane &p, const vec4 &v1)
Definition plane.h:246
__forceinline bool greaterequal_all(const point &v0, const point &v1)
Definition point.h:463
__forceinline bool greater_any(const point &v0, const point &v1)
Definition point.h:430
half operator-(half one, half two)
Definition half.h:114
__forceinline bool less_any(const point &v0, const point &v1)
Definition point.h:386
static const __m128 _id_w
Definition vec3.h:32
__forceinline bool less_all(const point &v0, const point &v1)
Definition point.h:397
__forceinline bool lessequal_all(const point &v0, const point &v1)
Definition point.h:419
__forceinline point minimize(const point &v0, const point &v1)
Definition point.h:377
float scalar
Definition scalar.h:45
__forceinline point greater(const point &v0, const point &v1)
Definition point.h:510
half operator+(half one, half two)
Definition half.h:105
__forceinline bool greater_all(const point &v0, const point &v1)
Definition point.h:441
__forceinline bool nearequal(const point &v0, const point &v1, float epsilon)
Definition point.h:485
static const __m128 _mask_xyz
Definition vec3.h:37
__forceinline bool lessequal_any(const point &v0, const point &v1)
Definition point.h:408
__forceinline vec3 xyz(const point &v)
Definition point.h:528
static const __m128 _plus1
Definition vec3.h:34
Represents a 3D point in space.
Definition point.h:22
void set(scalar x, scalar y, scalar z)
set content
Definition point.h:332
float z
Definition point.h:78
void operator=(const point &rhs)
assignment operator
Definition point.h:155
bool operator==(const point &rhs) const
equality operator
Definition point.h:283
void storeu(scalar *ptr) const
write content to unaligned memory through the write cache
Definition point.h:222
bool operator!=(const point &rhs) const
inequality operator
Definition point.h:293
void operator+=(const vector &rhs)
inplace add
Definition point.h:173
__m128 vec
Definition point.h:75
void store(scalar *ptr) const
write content to 16-byte-aligned memory through the write cache
Definition point.h:212
void store3(scalar *ptr) const
write content to 16-byte-aligned memory through the write cache
Definition point.h:232
float x
Definition point.h:78
void load(const scalar *ptr)
load content from 16-byte-aligned memory
Definition point.h:192
point()
default constructor
Definition point.h:87
void operator-=(const vector &rhs)
inplace sub
Definition point.h:182
void loadu(const scalar *ptr)
load content from unaligned memory
Definition point.h:202
float y
Definition point.h:78
void storeu3(scalar *ptr) const
write content to unaligned memory through the write cache
Definition point.h:244
float operator[](int index) const
Definition point.h:303
A 3D vector.
Definition vec3.h:40
float __w
Definition vec3.h:94
__m128 vec
Definition vec3.h:96
A 4D vector.
Definition vec4.h:24
__m128 vec
Definition vec4.h:95
A vector is a 3D direction in space.
Definition vector.h:22
__m128 vec
Definition vector.h:82
bool operator==(const TiXmlString &a, const TiXmlString &b)
Definition tinystr.h:272
bool operator!=(const TiXmlString &a, const TiXmlString &b)
Definition tinystr.h:282
#define NEBULA_ALIGN16
Definition types.h:154