Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
y
z
Variables
a
b
c
d
e
f
h
i
k
l
m
n
s
t
v
w
Typedefs
a
b
c
d
e
f
h
i
l
m
n
p
q
s
u
v
w
Enumerations
Enumerator
c
d
f
h
l
m
n
r
s
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
h
i
m
n
o
p
r
s
t
u
v
Enumerations
b
c
d
f
l
n
o
p
r
s
t
v
Enumerator
_
c
d
f
h
k
n
q
r
s
t
v
x
y
Related Functions
b
c
d
o
r
s
u
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
y
Enumerations
Enumerator
b
c
d
e
f
k
l
n
p
s
t
u
w
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
app
android
jni
third-party
include
glm
detail
intrinsic_exponential.hpp
Go to the documentation of this file.
1
29
#pragma once
30
31
#include "
setup.hpp
"
32
33
#if(!(GLM_ARCH & GLM_ARCH_SSE2))
34
# error "SSE2 instructions not supported or enabled"
35
#else
36
37
namespace
glm
{
38
namespace
detail
39
{
40
/*
41
GLM_FUNC_QUALIFIER __m128 sse_rsqrt_nr_ss(__m128 const x)
42
{
43
__m128 recip = _mm_rsqrt_ss( x ); // "estimate" opcode
44
const static __m128 three = { 3, 3, 3, 3 }; // aligned consts for fast load
45
const static __m128 half = { 0.5,0.5,0.5,0.5 };
46
__m128 halfrecip = _mm_mul_ss( half, recip );
47
__m128 threeminus_xrr = _mm_sub_ss( three, _mm_mul_ss( x, _mm_mul_ss ( recip, recip ) ) );
48
return _mm_mul_ss( halfrecip, threeminus_xrr );
49
}
50
51
GLM_FUNC_QUALIFIER __m128 sse_normalize_fast_ps( float * RESTRICT vOut, float * RESTRICT vIn )
52
{
53
__m128 x = _mm_load_ss(&vIn[0]);
54
__m128 y = _mm_load_ss(&vIn[1]);
55
__m128 z = _mm_load_ss(&vIn[2]);
56
57
const __m128 l = // compute x*x + y*y + z*z
58
_mm_add_ss(
59
_mm_add_ss( _mm_mul_ss(x,x),
60
_mm_mul_ss(y,y)
61
),
62
_mm_mul_ss( z, z )
63
);
64
65
66
const __m128 rsqt = _mm_rsqrt_nr_ss( l );
67
_mm_store_ss( &vOut[0] , _mm_mul_ss( rsqt, x ) );
68
_mm_store_ss( &vOut[1] , _mm_mul_ss( rsqt, y ) );
69
_mm_store_ss( &vOut[2] , _mm_mul_ss( rsqt, z ) );
70
71
return _mm_mul_ss( l , rsqt );
72
}
73
*/
74
}
//namespace detail
75
}
//namespace glm
76
77
#endif//GLM_ARCH
detail
setup.hpp
glm
Definition:
_literals.hpp:31
rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Feb 13 2025 03:44:55