]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/powerpc/powerpc32/fpu/s_rint.S
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / powerpc / powerpc32 / fpu / s_rint.S
index dbe14ccaa07e98267ed3e4c025f2dd921a2c22bf..0b50b6f05312b5fcadbdb7382931f16cc2914e72 100644 (file)
@@ -1,5 +1,5 @@
 /* Round to int floating-point values.  PowerPC32 version.
-   Copyright (C) 2004-2015 Free Software Foundation, Inc.
+   Copyright (C) 2004-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
 
 #include <sysdep.h>
 #include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
 
        .section        .rodata.cst4,"aM",@progbits,4
        .align  2
@@ -45,7 +46,7 @@ ENTRY (__rint)
        fsub    fp12,fp13,fp13  /* generate 0.0  */
        fcmpu   cr7,fp0,fp13    /* if (fabs(x) > TWO52)  */
        fcmpu   cr6,fp1,fp12    /* if (x > 0.0)  */
-       bnllr   cr7
+       bnl     cr7,.L10
        bng     cr6,.L4
        fadd    fp1,fp1,fp13    /* x+= TWO52;  */
        fsub    fp1,fp1,fp13    /* x-= TWO52;  */
@@ -57,14 +58,12 @@ ENTRY (__rint)
        fadd    fp1,fp1,fp13    /* x+= TWO52;  */
        fnabs   fp1,fp1         /* if (x == 0.0)  */
        blr                     /* x = -0.0; */
+.L10:
+       /* Ensure sNaN input is converted to qNaN.  */
+       fcmpu   cr7,fp1,fp1
+       beqlr   cr7
+       fadd    fp1,fp1,fp1
+       blr
        END (__rint)
 
-weak_alias (__rint, rint)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__rint, rintl)
-strong_alias (__rint, __rintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0)
-#endif
+libm_alias_double (__rint, rint)