summaryrefslogtreecommitdiff
path: root/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S')
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S18
1 files changed, 8 insertions, 10 deletions
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S
index 29b56b471c..88f410ec52 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc32 v9 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2013.
@@ -21,6 +21,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -36,20 +37,21 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyint)
+ sllx %o0, 32, %o0
+ or %o0, %o1, %o0
+ stx %o0, [%sp + 72]
+ ldd [%sp + 72], %f0
+ fcmpd %fcc3, %f0, %f0 /* Check for sNaN */
st %fsr, [%sp + 88]
sethi %hi(TWO_FIFTYTWO), %o2
sethi %hi(0xf8003e0), %o5
ld [%sp + 88], %o4
- sllx %o0, 32, %o0
or %o5, %lo(0xf8003e0), %o5
- or %o0, %o1, %o0
andn %o4, %o5, %o4
fzero ZERO
st %o4, [%sp + 80]
- stx %o0, [%sp + 72]
sllx %o2, 32, %o2
fnegd ZERO, SIGN_BIT
- ldd [%sp + 72], %f0
ld [%sp + 80], %fsr
stx %o2, [%sp + 72]
fabsd %f0, %f14
@@ -65,8 +67,4 @@ ENTRY (__nearbyint)
retl
ld [%sp + 88], %fsr
END (__nearbyint)
-weak_alias (__nearbyint, nearbyint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1)
-#endif
+libm_alias_double (__nearbyint, nearbyint)