diff options
Diffstat (limited to 'sysdeps/x86_64/fpu/s_truncl.S')
-rw-r--r-- | sysdeps/x86_64/fpu/s_truncl.S | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sysdeps/x86_64/fpu/s_truncl.S b/sysdeps/x86_64/fpu/s_truncl.S index c37cf00241..22427ece00 100644 --- a/sysdeps/x86_64/fpu/s_truncl.S +++ b/sysdeps/x86_64/fpu/s_truncl.S @@ -1,5 +1,5 @@ /* Truncate long double value. - Copyright (C) 1997-2016 Free Software Foundation, Inc. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -17,17 +17,21 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#include <libm-alias-ldouble.h> #include <machine/asm.h> ENTRY(__truncl) fldt 8(%rsp) - fstcw -4(%rsp) + fnstenv -28(%rsp) movl $0xc00, %edx - orl -4(%rsp), %edx - movl %edx, -8(%rsp) - fldcw -8(%rsp) + orl -28(%rsp), %edx + movl %edx, -32(%rsp) + fldcw -32(%rsp) frndint - fldcw -4(%rsp) + fnstsw + andl $0x1, %eax + orl %eax, -24(%rsp) + fldenv -28(%rsp) ret END(__truncl) -weak_alias (__truncl, truncl) +libm_alias_ldouble (__trunc, trunc) |