Nebula
Loading...
Searching...
No Matches
sse.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
11//------------------------------------------------------------------------------
12
13
14namespace Math
15{
16
17//------------------------------------------------------------------------------
21__forceinline __m128
22fmadd(__m128 a, __m128 b, __m128 c)
23{
24#if N_USE_FMA
25 return _mm_fmadd_ps(a, b, c);
26#else
27 return _mm_add_ps(_mm_mul_ps(a, b), c);
28#endif
29}
30
31//------------------------------------------------------------------------------
35__forceinline __m128
36less(__m128 a, __m128 b)
37{
38 return _mm_min_ps(_mm_cmplt_ps(a, b), _mm_set1_ps(1));
39}
40
41//------------------------------------------------------------------------------
45__forceinline __m128
46greater(__m128 a, __m128 b)
47{
48 return _mm_min_ps(_mm_cmpgt_ps(a, b), _mm_set1_ps(1));
49}
50
51//------------------------------------------------------------------------------
54__forceinline __m128
55recip(__m128 a)
56{
57 return _mm_div_ps(_mm_set1_ps(1), a);
58}
59
60//------------------------------------------------------------------------------
63__forceinline __m128
64mul(__m128 a, __m128 b)
65{
66 return _mm_mul_ps(a, b);
67}
68
69//------------------------------------------------------------------------------
72__forceinline __m128
73div(__m128 a, __m128 b)
74{
75 return _mm_div_ps(a, b);
76}
77
78//------------------------------------------------------------------------------
81template<int x, int y, int z, int w>
82__forceinline __m128
83swizzle(__m128 v)
84{
85 return _mm_shuffle_ps(v, v, _MM_SHUFFLE(x, y, z, w));
86}
87
88} // namespace Math
Different curves.
Definition angularpfeedbackloop.h:17
__forceinline point less(const point &v0, const point &v1)
Definition point.h:501
__forceinline __m128 recip(__m128 a)
Definition sse.h:55
__forceinline __m128 div(__m128 a, __m128 b)
Definition sse.h:73
__forceinline __m128 swizzle(__m128 v)
Definition sse.h:83
__forceinline __m128 mul(__m128 a, __m128 b)
Definition sse.h:64
__forceinline point greater(const point &v0, const point &v1)
Definition point.h:510
__forceinline __m128 fmadd(__m128 a, __m128 b, __m128 c)
Fused multiply-add operation, (a * b) + c.
Definition sse.h:22