summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 17:58:54 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 17:58:54 +0000
commit1ba06384fb715fb7732b20911ffc56a61d16cb0d (patch)
tree0fcfaf14f40169b289044495b1984a5fa3e0e965 /sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
parent1af57d5793424a5a6ec542d0a5ef0b7c4f312623 (diff)
parent963c37d5c0eb62b38f8764b23931c0dcdd497a13 (diff)
Merge commit 'refs/top-bases/t/sysvshm' into t/sysvshm
Diffstat (limited to 'sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S')
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S15
1 files changed, 11 insertions, 4 deletions
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S b/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
index 3ba53784a4..4b62ba1e8d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
@@ -1,5 +1,5 @@
/* Round to int floating-point values. PowerPC64 version.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
@@ -21,6 +21,7 @@
when it's coded in C. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* float [fp1] nearbyintf(float [fp1]) */
@@ -32,12 +33,12 @@
.long 0x0
.section ".text"
-EALIGN (__nearbyintf, 4, 0)
+ENTRY (__nearbyintf, 4)
CALL_MCOUNT 0
fabs fp0,fp1
lfs fp13,.LC0@toc(2)
fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */
- bgelr cr7
+ bge cr7,.L10
fsubs fp12,fp13,fp13 /* generate 0.0 */
fcmpu cr7,fp1,fp12 /* if (x > 0.0) */
ble cr7, L(lessthanzero)
@@ -57,6 +58,12 @@ L(lessthanzero):
fnabs fp1,fp1 /* if (x == 0.0) */
mtfsf 0xff,fp11 /* Restore FE_INEXACT state. */
blr /* x = -0.0; */
+.L10:
+ /* Ensure sNaN input is converted to qNaN. */
+ fcmpu cr7,fp1,fp1
+ beqlr cr7
+ fadds fp1,fp1,fp1
+ blr
END (__nearbyintf)
-weak_alias (__nearbyintf, nearbyintf)
+libm_alias_float (__nearbyint, nearbyint)