]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/i386/fpu/s_trunc.S
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / i386 / fpu / s_trunc.S
index 63532a404b8aa9b609f4b284c7bbafffa156d8e6..54cdbfd8deb773ae5d9f2adcaa9f93bdc930291f 100644 (file)
@@ -1,5 +1,5 @@
 /* Truncate double value.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997-2019 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 <machine/asm.h>
+#include <libm-alias-double.h>
 
 ENTRY(__trunc)
        fldl    4(%esp)
-       subl    $8, %esp
-       fstcw   4(%esp)
+       subl    $32, %esp
+       cfi_adjust_cfa_offset (32)
+       fnstenv 4(%esp)
        movl    $0xc00, %edx
        orl     4(%esp), %edx
        movl    %edx, (%esp)
        fldcw   (%esp)
        frndint
-       fldcw   4(%esp)
-       addl    $8, %esp
+       fldenv  4(%esp)
+       addl    $32, %esp
+       cfi_adjust_cfa_offset (-32)
        ret
 END(__trunc)
-weak_alias (__trunc, trunc)
+libm_alias_double (__trunc, trunc)