]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/x86_64/fpu/math_private.h
Use floor functions not __floor functions in glibc libm.
[thirdparty/glibc.git] / sysdeps / x86_64 / fpu / math_private.h
1 #ifndef X86_64_MATH_PRIVATE_H
2 #define X86_64_MATH_PRIVATE_H 1
3
4 #include_next <math_private.h>
5
6 #ifdef __SSE4_1__
7 extern __always_inline double
8 __rint (double d)
9 {
10 double res;
11 # if defined __AVX__ || defined SSE2AVX
12 asm ("vroundsd $4, %1, %0, %0" : "=x" (res) : "xm" (d));
13 # else
14 asm ("roundsd $4, %1, %0" : "=x" (res) : "xm" (d));
15 # endif
16 return res;
17 }
18
19 extern __always_inline float
20 __rintf (float d)
21 {
22 float res;
23 # if defined __AVX__ || defined SSE2AVX
24 asm ("vroundss $4, %1, %0, %0" : "=x" (res) : "xm" (d));
25 # else
26 asm ("roundss $4, %1, %0" : "=x" (res) : "xm" (d));
27 # endif
28 return res;
29 }
30 #endif /* __SSE4_1__ */
31
32 #endif /* X86_64_MATH_PRIVATE_H */