]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/x86_64/fpu/s_truncl.S
Update copyright dates with scripts/update-copyrights
[thirdparty/glibc.git] / sysdeps / x86_64 / fpu / s_truncl.S
index 8eca6a67c8e5bf9ea7fb92002684dc624a6a4558..a750b3c8fbc2d66cb3724e8908449e84910295a6 100644 (file)
@@ -1,5 +1,5 @@
 /* Truncate long double value.
-   Copyright (C) 1997-2014 Free Software Foundation, Inc.
+   Copyright (C) 1997-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://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)