summaryrefslogtreecommitdiff
path: root/sysdeps/sparc/sparc64/fpu
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/sparc/sparc64/fpu')
-rw-r--r--sysdeps/sparc/sparc64/fpu/e_sqrtl.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/Makefile44
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S57
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S59
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c (renamed from sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S)15
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S56
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S58
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c (renamed from sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S)15
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S15
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c37
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S15
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c (renamed from sysdeps/sparc/sparc64/fpu/s_fminf.S)33
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S57
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S59
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c (renamed from sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S)16
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S56
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S58
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c (renamed from sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S)16
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c26
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c26
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S15
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c37
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S15
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c (renamed from sysdeps/sparc/sparc64/fpu/s_fmaxf.S)33
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S15
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.c37
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S15
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.c (renamed from sysdeps/sparc/sparc64/fpu/s_fmax.S)33
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S17
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c40
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S17
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c40
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-generic.S4
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S3
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-generic.S4
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S3
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.c (renamed from sysdeps/sparc/sparc64/fpu/s_fmin.S)30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S4
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S4
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-generic.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S23
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.c37
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-generic.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.c28
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S53
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c23
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c2
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S52
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c23
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S12
-rw-r--r--sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c30
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_ceil.S83
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_ceilf.S81
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_copysign.S5
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_copysignf.S5
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_fabs.c4
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_fabsf.c4
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_fabsl.c4
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_fdim.S32
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_fdimf.S31
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_finite.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_finitef.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_floor.S83
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_floorf.S81
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_isinf.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_isinff.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_isnan.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_isnanf.S2
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_lrint.S7
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_lrintf.S7
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_nearbyint.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_nearbyintf.S6
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_rint.S5
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_rintf.S5
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_signbit.S4
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_signbitf.S3
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_trunc.S55
-rw-r--r--sysdeps/sparc/sparc64/fpu/s_truncf.S54
-rw-r--r--sysdeps/sparc/sparc64/fpu/w_sqrt.S48
-rw-r--r--sysdeps/sparc/sparc64/fpu/w_sqrtf.S48
131 files changed, 857 insertions, 1691 deletions
diff --git a/sysdeps/sparc/sparc64/fpu/e_sqrtl.c b/sysdeps/sparc/sparc64/fpu/e_sqrtl.c
index 3a09383daa..68bd584e35 100644
--- a/sysdeps/sparc/sparc64/fpu/e_sqrtl.c
+++ b/sysdeps/sparc/sparc64/fpu/e_sqrtl.c
@@ -1,5 +1,5 @@
/* Long double square root, sparc64 version.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
index 6a9274b4fa..3321e1d916 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
@@ -1,18 +1,30 @@
ifeq ($(subdir),math)
-libm-sysdep_routines += s_ceil-vis2 s_ceilf-vis2 \
- s_floor-vis2 s_floorf-vis2
-ifeq ($(have-as-vis3),yes)
-libm-sysdep_routines += m_signbitf-vis3 m_signbit-vis3 s_ceilf-vis3 \
- s_ceil-vis3 m_finitef-vis3 m_finite-vis3 \
- s_floorf-vis3 s_floor-vis3 m_isinff-vis3 \
- m_isinf-vis3 m_isnanf-vis3 m_isnan-vis3 \
- s_lrintf-vis3 s_lrint-vis3 s_rintf-vis3 \
- s_rint-vis3 s_fminf-vis3 s_fmin-vis3 \
- s_fmaxf-vis3 s_fmax-vis3 s_fmaf-vis3 \
- s_fma-vis3 s_nearbyint-vis3 s_nearbyintf-vis3 \
- s_truncf-vis3 s_trunc-vis3
-sysdep_routines += s_signbitf-vis3 s_signbit-vis3 s_finitef-vis3 \
- s_finite-vis3 s_isinff-vis3 s_isinf-vis3 \
- s_isnanf-vis3 s_isnan-vis3
-endif
+# These functions are built both for libc and libm because they're required
+# by printf. While the libc objects have the prefix s_, the libm ones are
+# prefixed with m_.
+sysdep_calls := s_signbitf-vis3 s_signbit-vis3 s_signbitf-generic \
+ s_signbit-generic s_finitef-vis3 s_finite-vis3 \
+ s_finitef-generic s_finite-generic \
+ s_isinff-vis3 s_isinf-vis3 s_isinff-generic s_isinf-generic \
+ s_isnanf-vis3 s_isnan-vis3 s_isnanf-generic s_isnan-generic
+
+sysdep_routines += $(sysdep_calls)
+libm-sysdep_routines += s_lrintf-vis3 s_lrint-vis3 s_lrintf-generic \
+ s_lrint-generic s_rintf-vis3 s_rint-vis3 \
+ s_rintf-generic s_rint-generic \
+ s_fmaf-vis3 s_fma-vis3 s_fmaf-generic s_fma-generic \
+ s_nearbyint-vis3 s_nearbyintf-vis3 \
+ s_nearbyint-generic s_nearbyintf-generic \
+ s_ceilf-vis3 s_ceil-vis3 s_ceilf-generic \
+ s_ceil-generic s_floorf-vis3 s_floor-vis3 \
+ s_floorf-generic s_floor-generic s_truncf-vis3 \
+ s_trunc-vis3 s_truncf-generic s_trunc-generic \
+ $(sysdep_calls:s_%=m_%)
+
+CFLAGS-s_ceilf-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_ceil-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_floorf-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_floor-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_truncf-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_trunc-vis3.c += -Wa,-Av9d -mvis3
endif
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c
new file mode 100644
index 0000000000..febea745e1
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c
@@ -0,0 +1,2 @@
+#define __ceil __ceil_generic
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S
deleted file mode 100644
index fd1bf38662..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ceil function, sparc64 vis2 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceil_vis2)
- sethi %hi(TWO_FIFTYTWO), %o2
- fzero ZERO
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
- stx %o2, [%sp + STACK_BIAS + 128]
- fabsd %f0, %f14
- ldd [%sp + STACK_BIAS + 128], %f16
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
- for %f16, SIGN_BIT, %f16
- siam (1 << 2) | 2
- faddd %f0, %f16, %f18
- siam (1 << 2) | 0
- fsubd %f18, %f16, %f18
- siam (0 << 2)
- retl
- for %f18, SIGN_BIT, %f0
-END (__ceil_vis2)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S
deleted file mode 100644
index e6fa3f53d2..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ceil function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction.
-
- We also use VIS3 moves to avoid using the stack to transfer
- values between float and integer registers. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceil_vis3)
- sethi %hi(TWO_FIFTYTWO), %o2
- fzero ZERO
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
- movxtod %o2, %f16
- fabsd %f0, %f14
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
- for %f16, SIGN_BIT, %f16
- siam (1 << 2) | 2
- faddd %f0, %f16, %f18
- siam (1 << 2) | 0
- fsubd %f18, %f16, %f18
- siam (0 << 2)
- retl
- for %f18, SIGN_BIT, %f0
-END (__ceil_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c
index 9a5c075375..a03a0090f0 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c
@@ -1,7 +1,6 @@
-/* fmax function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* ceil function, sparc64 vis3 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,10 +16,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
-ENTRY (__fmax_vis3)
- flcmpd %fcc1, %f0, %f2
- retl
- fmovdlg %fcc1, %f2, %f0
-END (__fmax_vis3)
+#define __ceil __ceil_vis3
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S
deleted file mode 100644
index e7822bc307..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_VIS2_IFUNC(ceil)
-
-weak_alias (__ceil, ceil)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __ceil __ceil_generic
-
-#include "../s_ceil.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c
new file mode 100644
index 0000000000..3d34622d43
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c
@@ -0,0 +1,30 @@
+/* ceil function, sparc64 version.
+ Copyright (C) 2016-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-double.h>
+
+extern __typeof (ceil) __ceil_vis3 attribute_hidden;
+extern __typeof (ceil) __ceil_generic attribute_hidden;
+
+sparc_libm_ifunc (__ceil,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __ceil_vis3
+ : __ceil_generic)
+libm_alias_double (__ceil, ceil)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c
new file mode 100644
index 0000000000..ce75035954
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c
@@ -0,0 +1,2 @@
+#define __ceilf __ceilf_generic
+#include <sysdeps/ieee754/flt-32/s_ceilf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S
deleted file mode 100644
index fe57a52a4a..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Float ceil function, sparc64 vis2 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceilf_vis2)
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- st %o2, [%sp + STACK_BIAS + 128]
- fabss %f1, %f14
- ld [%sp + STACK_BIAS + 128], %f16
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f1, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 2
- fadds %f1, %f16, %f5
- siam (1 << 2) | 0
- fsubs %f5, %f16, %f5
- siam (0 << 2)
- retl
- fors %f5, SIGN_BIT, %f0
-END (__ceilf_vis2)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S
deleted file mode 100644
index 9a0f9c567e..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Float ceil function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction.
-
- We also use VIS3 moves to avoid using the stack to transfer
- values between float and integer registers. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceilf_vis3)
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- movwtos %o2, %f16
- fabss %f1, %f14
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f1, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 2
- fadds %f1, %f16, %f5
- siam (1 << 2) | 0
- fsubs %f5, %f16, %f5
- siam (0 << 2)
- retl
- fors %f5, SIGN_BIT, %f0
-END (__ceilf_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c
index b8c3fe0357..eb9ed6f7de 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c
@@ -1,7 +1,6 @@
-/* fmin function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Float ceil function, sparc64 vis3 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,10 +16,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
-ENTRY (__fmin_vis3)
- flcmpd %fcc1, %f0, %f2
- retl
- fmovdge %fcc1, %f2, %f0
-END (__fmin_vis3)
+#define __ceilf __ceilf_vis3
+
+#include <sysdeps/ieee754/flt-32/s_ceilf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S
deleted file mode 100644
index 1c72a5728e..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_VIS2_IFUNC(ceilf)
-
-weak_alias (__ceilf, ceilf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __ceilf __ceilf_generic
-
-#include "../s_ceilf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c
new file mode 100644
index 0000000000..18d2eb565d
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c
@@ -0,0 +1,30 @@
+/* Float ceil function, sparc64 version.
+ Copyright (C) 2016-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-float.h>
+
+extern __typeof (ceilf) __ceilf_vis3 attribute_hidden;
+extern __typeof (ceilf) __ceilf_generic attribute_hidden;
+
+sparc_libm_ifunc (__ceilf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __ceilf_vis3
+ : __ceilf_generic);
+libm_alias_float (__ceil, ceil)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S
new file mode 100644
index 0000000000..dfbf32fc3f
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S
@@ -0,0 +1,6 @@
+#define __finite __finite_generic
+#undef hidden_def
+#define hidden_def(a)
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_finite.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S
index 6d4297b9ed..0cd3fd50c9 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S
@@ -1,5 +1,5 @@
/* finite(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S
deleted file mode 100644
index 78406a62b1..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(finite)
-
-hidden_def (__finite)
-weak_alias (__finite, finite)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef hidden_def
-# define hidden_def(a)
-
-#define __finite __finite_generic
-
-#include "../s_finite.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c
new file mode 100644
index 0000000000..b51ed19438
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c
@@ -0,0 +1,37 @@
+/* finite ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#define __finite __redirect___finite
+#define __finitef __redirect___finitef
+#define __finitel __redirect___finitel
+#include <math.h>
+#undef __finite
+#undef __finitef
+#undef __finitel
+#include <sparc-ifunc.h>
+
+extern __typeof (finite) __finite_vis3 attribute_hidden;
+extern __typeof (finite) __finite_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect___finite, __finite,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __finite_vis3
+ : __finite_generic);
+
+sparc_ifunc_redirected_hidden_def (__redirect___finite, __finite)
+weak_alias (__finite, finite)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S
new file mode 100644
index 0000000000..38880765fe
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S
@@ -0,0 +1,6 @@
+#define __finitef __finitef_generic
+#undef hidden_def
+#define hidden_def(a)
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_finitef.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S
index 8cc6149063..d0391f6dbf 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S
@@ -1,5 +1,5 @@
/* finitef(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S
deleted file mode 100644
index cafd41fd92..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(finitef)
-
-hidden_def (__finitef)
-weak_alias (__finitef, finitef)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef hidden_def
-# define hidden_def(a)
-
-#define __finitef __finitef_generic
-
-#include "../s_finitef.S"
diff --git a/sysdeps/sparc/sparc64/fpu/s_fminf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c
index bfa2e5b7e6..92cc5ef075 100644
--- a/sysdeps/sparc/sparc64/fpu/s_fminf.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c
@@ -1,7 +1,6 @@
-/* fminf function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* finitef ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,20 +16,18 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#define __finitef __redirect___finitef
+#include <math.h>
+#undef __finitef
+#include <sparc-ifunc.h>
-#define SIGN_BIT %f12 /* -0.0 */
+extern __typeof (finitef) __finitef_vis3 attribute_hidden;
+extern __typeof (finitef) __finitef_generic attribute_hidden;
-ENTRY (__fminf)
- fcmps %fcc1, %f3, %f3
- fzeros SIGN_BIT
- fmovsu %fcc1, %f1, %f3
- fnegs SIGN_BIT, SIGN_BIT
- fcmps %fcc2, %f1, %f3
- fmovsug %fcc2, %f3, %f1
- fors %f1, %f3, %f4
- fands %f4, SIGN_BIT, %f4
- retl
- fors %f1, %f4, %f0
-END (__fminf)
-weak_alias (__fminf, fminf)
+sparc_libm_ifunc_redirected (__redirect___finitef, __finitef,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __finitef_vis3
+ : __finitef_generic);
+
+sparc_ifunc_redirected_hidden_def (__redirect___finitef, __finitef)
+weak_alias (__finitef, finitef)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c
new file mode 100644
index 0000000000..0f3361a9fb
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c
@@ -0,0 +1,2 @@
+#define __floor __floor_generic
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S
deleted file mode 100644
index 84fda73d95..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S
+++ /dev/null
@@ -1,57 +0,0 @@
-/* floor function, sparc64 vis2 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floor_vis2)
- sethi %hi(TWO_FIFTYTWO), %o2
- fzero ZERO
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
- stx %o2, [%sp + STACK_BIAS + 128]
- fabsd %f0, %f14
- ldd [%sp + STACK_BIAS + 128], %f16
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
- for %f16, SIGN_BIT, %f16
- siam (1 << 2) | 3
- faddd %f0, %f16, %f18
- siam (1 << 2) | 0
- fsubd %f18, %f16, %f18
- siam (0 << 2)
- retl
- for %f18, SIGN_BIT, %f0
-END (__floor_vis2)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S
deleted file mode 100644
index 1b275c2c63..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/* floor function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction.
-
- We also use VIS3 moves to avoid using the stack to transfer
- values between float and integer registers. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floor_vis3)
- sethi %hi(TWO_FIFTYTWO), %o2
- fzero ZERO
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
- movxtod %o2, %f16
- fabsd %f0, %f14
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
- for %f16, SIGN_BIT, %f16
- siam (1 << 2) | 3
- faddd %f0, %f16, %f18
- siam (1 << 2) | 0
- fsubd %f18, %f16, %f18
- siam (0 << 2)
- retl
- for %f18, SIGN_BIT, %f0
-END (__floor_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c
index 50ee6fe101..d9974161b0 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c
@@ -1,7 +1,6 @@
-/* fmaxf function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* floor function, sparc64 vis3 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,11 +16,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
-ENTRY (__fmaxf_vis3)
- flcmps %fcc1, %f1, %f3
- fmovs %f1, %f0
- retl
- fmovslg %fcc1, %f3, %f0
-END (__fmaxf_vis3)
+#define __floor __floor_vis3
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S
deleted file mode 100644
index 989ccab56d..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_VIS2_IFUNC(floor)
-
-weak_alias (__floor, floor)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __floor __floor_generic
-
-#include "../s_floor.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c
new file mode 100644
index 0000000000..6e5ecd2b5d
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c
@@ -0,0 +1,30 @@
+/* floor function, sparc64 version.
+ Copyright (C) 2016-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-double.h>
+
+extern __typeof (floor) __floor_vis3 attribute_hidden;
+extern __typeof (floor) __floor_generic attribute_hidden;
+
+sparc_libm_ifunc (__floor,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __floor_vis3
+ : __floor_generic);
+libm_alias_double (__floor, floor)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c
new file mode 100644
index 0000000000..28c377b787
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c
@@ -0,0 +1,2 @@
+#define __floorf __floorf_generic
+#include <sysdeps/ieee754/flt-32/s_floorf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S
deleted file mode 100644
index ab7e110ee9..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Float floor function, sparc64 vis2 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floorf_vis2)
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- st %o2, [%sp + STACK_BIAS + 128]
- fabss %f1, %f14
- ld [%sp + STACK_BIAS + 128], %f16
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f1, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 3
- fadds %f1, %f16, %f5
- siam (1 << 2) | 0
- fsubs %f5, %f16, %f5
- siam (0 << 2)
- retl
- fors %f5, SIGN_BIT, %f0
-END (__floorf_vis2)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S
deleted file mode 100644
index b71e1cc2dc..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Float floor function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override
- the rounding mode during this routine.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value and,
- with suitable 'siam' initiated rouding mode settings, round
- the final result in the proper direction.
-
- We also use VIS3 moves to avoid using the stack to transfer
- values between float and integer registers. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floorf_vis3)
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- movwtos %o2, %f16
- fabss %f1, %f14
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f1, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 3
- fadds %f1, %f16, %f5
- siam (1 << 2) | 0
- fsubs %f5, %f16, %f5
- siam (0 << 2)
- retl
- fors %f5, SIGN_BIT, %f0
-END (__floorf_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c
index e716f4ac02..d970da3752 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c
@@ -1,7 +1,6 @@
-/* fminf function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Float floor function, sparc64 vis3 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,11 +16,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
-ENTRY (__fminf_vis3)
- flcmps %fcc1, %f1, %f3
- fmovs %f1, %f0
- retl
- fmovsge %fcc1, %f3, %f0
-END (__fminf_vis3)
+#define __floorf __floorf_vis3
+
+#include <sysdeps/ieee754/flt-32/s_floorf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S
deleted file mode 100644
index d2a83cb9b8..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_VIS2_IFUNC(floorf)
-
-weak_alias (__floorf, floorf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __floorf __floorf_generic
-
-#include "../s_floorf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c
new file mode 100644
index 0000000000..b79fd83fa4
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c
@@ -0,0 +1,30 @@
+/* Float floor function, sparc64 version.
+ Copyright (C) 2016-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-float.h>
+
+extern __typeof (floorf) __floorf_vis3 attribute_hidden;
+extern __typeof (floorf) __floorf_generic attribute_hidden;
+
+sparc_libm_ifunc (__floorf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __floorf_vis3
+ : __floorf_generic);
+libm_alias_float (__floor, floor)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c
new file mode 100644
index 0000000000..e40816facb
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c
@@ -0,0 +1,2 @@
+#define __fma __fma_generic
+#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S
index d43002caa5..ba50b3a657 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S
@@ -1,5 +1,5 @@
/* fma function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c
index 3f2f1622c8..34b4f45150 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c
@@ -1,14 +1,12 @@
-#ifdef HAVE_AS_VIS3_SUPPORT
-# include <sparc-ifunc.h>
-# include <math.h>
-
-extern double __fma_vis3 (double, double, double);
-extern double __fma_generic (double, double, double);
-
-sparc_libm_ifunc(__fma, hwcap & HWCAP_SPARC_FMAF ? __fma_vis3 : __fma_generic);
-weak_alias (__fma, fma)
-
-# define __fma __fma_generic
-#endif
-
-#include <sysdeps/ieee754/dbl-64/s_fma.c>
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-double.h>
+
+extern __typeof (fma) __fma_vis3 attribute_hidden;
+extern __typeof (fma) __fma_generic attribute_hidden;
+
+sparc_libm_ifunc (__fma,
+ hwcap & HWCAP_SPARC_FMAF
+ ? __fma_vis3
+ : __fma_generic);
+libm_alias_double (__fma, fma)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c
new file mode 100644
index 0000000000..218eeb3115
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c
@@ -0,0 +1,2 @@
+#define __fmaf __fmaf_generic
+#include <sysdeps/ieee754/dbl-64/s_fmaf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S
index 4ee6ee407c..fbfa5fd869 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S
@@ -1,5 +1,5 @@
/* fmaf function, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c
index 7a273a3b13..08f71c8bba 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c
@@ -1,14 +1,12 @@
-#ifdef HAVE_AS_VIS3_SUPPORT
-# include <sparc-ifunc.h>
-# include <math.h>
-
-extern float __fmaf_vis3 (float, float, float);
-extern float __fmaf_generic (float, float, float);
-
-sparc_libm_ifunc(__fmaf, hwcap & HWCAP_SPARC_FMAF ? __fmaf_vis3 : __fmaf_generic);
-weak_alias (__fmaf, fmaf)
-
-# define __fmaf __fmaf_generic
-#endif
-
-#include <sysdeps/ieee754/dbl-64/s_fmaf.c>
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-float.h>
+
+extern __typeof (fmaf) __fmaf_vis3 attribute_hidden;
+extern __typeof (fmaf) __fmaf_generic attribute_hidden;
+
+sparc_libm_ifunc (__fmaf,
+ hwcap & HWCAP_SPARC_FMAF
+ ? __fmaf_vis3
+ : __fmaf_generic)
+libm_alias_float (__fma, fma)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S
deleted file mode 100644
index d5e59d8d1e..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fmax)
-
-weak_alias (__fmax, fmax)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fmax __fmax_generic
-
-#include "../s_fmax.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S
deleted file mode 100644
index daa91579c4..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fmaxf)
-
-weak_alias (__fmaxf, fmaxf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fmaxf __fmaxf_generic
-
-#include "../s_fmaxf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S
deleted file mode 100644
index b2aec1bbc0..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fmin)
-
-weak_alias (__fmin, fmin)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fmin __fmin_generic
-
-#include "../s_fmin.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S
deleted file mode 100644
index c4690e1df9..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fminf)
-
-weak_alias (__fminf, fminf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fminf __fminf_generic
-
-#include "../s_fminf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S
new file mode 100644
index 0000000000..ebaf054025
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S
@@ -0,0 +1,6 @@
+#define __isinf __isinf_generic
+#undef hidden_def
+#define hidden_def(a)
+#undef weak_alias
+#define weak_alias(a,b)
+#include <./sysdeps/sparc/sparc64/fpu/s_isinf.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S
index 702de3e938..bb5e6a0772 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S
@@ -1,5 +1,5 @@
/* isinf(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S
deleted file mode 100644
index ed9b62640d..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(isinf)
-
-hidden_def (__isinf)
-weak_alias (__isinf, isinf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef hidden_def
-# define hidden_def(a)
-
-#define __isinf __isinf_generic
-
-#include "../s_isinf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c
new file mode 100644
index 0000000000..2eea299486
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c
@@ -0,0 +1,37 @@
+/* isinf ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#define __isinf __redirect___isinf
+#define __isinff __redirect___isinff
+#define __isinfl __redirect___isinfl
+#include <math.h>
+#undef __isinf
+#undef __isinff
+#undef __isinfl
+#include <sparc-ifunc.h>
+
+extern __typeof (isinf) __isinf_vis3 attribute_hidden;
+extern __typeof (isinf) __isinf_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect___isinf, __isinf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __isinf_vis3
+ : __isinf_generic)
+
+sparc_ifunc_redirected_hidden_def (__redirect___isinf, __isinf)
+weak_alias (__isinf, isinf)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S
new file mode 100644
index 0000000000..d37243f216
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S
@@ -0,0 +1,6 @@
+#define __isinff __isinff_generic
+#undef hidden_def
+#define hidden_def(a)
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_isinff.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S
index 92e6e5c7ae..a80c22905f 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S
@@ -1,5 +1,5 @@
/* isinff(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S
deleted file mode 100644
index 04517398f8..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(isinff)
-
-hidden_def (__isinff)
-weak_alias (__isinff, isinff)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef hidden_def
-# define hidden_def(a)
-
-#define __isinff __isinff_generic
-
-#include "../s_isinff.S"
diff --git a/sysdeps/sparc/sparc64/fpu/s_fmaxf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c
index 1117d7a840..3b814c89fd 100644
--- a/sysdeps/sparc/sparc64/fpu/s_fmaxf.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c
@@ -1,7 +1,6 @@
-/* fmaxf function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* isinff ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,20 +16,18 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#define __isinff __redirect___isinff
+#include <math.h>
+#undef __isinff
+#include <sparc-ifunc.h>
-#define SIGN_BIT %f12 /* -0.0 */
+extern __typeof (isinff) __isinff_vis3 attribute_hidden;
+extern __typeof (isinff) __isinff_generic attribute_hidden;
-ENTRY (__fmaxf)
- fcmps %fcc1, %f3, %f3
- fzeros SIGN_BIT
- fmovsu %fcc1, %f1, %f3
- fnegs SIGN_BIT, SIGN_BIT
- fcmps %fcc2, %f1, %f3
- fmovsul %fcc2, %f3, %f1
- fands %f1, %f3, %f4
- fandnot2s SIGN_BIT, %f4, %f4
- retl
- fandnot2s %f1, %f4, %f0
-END (__fmaxf)
-weak_alias (__fmaxf, fmaxf)
+sparc_libm_ifunc_redirected (__redirect___isinff, __isinff,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __isinff_vis3
+ : __isinff_generic);
+
+sparc_ifunc_redirected_hidden_def (__redirect___isinff, __isinff)
+weak_alias (__isinff, isinff)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-generic.S
new file mode 100644
index 0000000000..64d4430d82
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-generic.S
@@ -0,0 +1,6 @@
+#define __isnan __isnan_generic
+#undef hidden_def
+#define hidden_def(a)
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_isnan.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S
index a891e6be3c..aefb2c77c7 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S
@@ -1,5 +1,5 @@
/* isnan(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S
deleted file mode 100644
index 40e985a5d4..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(isnan)
-
-hidden_def (__isnan)
-weak_alias (__isnan, isnan)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef hidden_def
-# define hidden_def(a)
-
-#define __isnan __isnan_generic
-
-#include "../s_isnan.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.c
new file mode 100644
index 0000000000..ccf6fbe93a
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.c
@@ -0,0 +1,37 @@
+/* isnan ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#define __isnan __redirect___isnan
+#define __isnanf __redirect___isnanf
+#define __isnanl __redirect___isnanl
+#include <math.h>
+#undef __isnan
+#undef __isnanf
+#undef __isnanl
+#include <sparc-ifunc.h>
+
+extern __typeof (isnan) __isnan_vis3 attribute_hidden;
+extern __typeof (isnan) __isnan_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect___isnan, __isnan,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __isnan_vis3
+ : __isnan_generic);
+
+sparc_ifunc_redirected_hidden_def (__redirect___isnan, __isnan)
+weak_alias (__isnan, isnan)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-generic.S
new file mode 100644
index 0000000000..5c82f7d101
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-generic.S
@@ -0,0 +1,6 @@
+#define __isnanf __isnanf_generic
+#undef hidden_def
+#define hidden_def(a)
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_isnanf.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S
index 0efaae016f..74c93aa228 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S
@@ -1,5 +1,5 @@
/* isnanf(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S
deleted file mode 100644
index 6b53b69d2e..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(isnanf)
-
-hidden_def (__isnanf)
-weak_alias (__isnanf, isnanf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef hidden_def
-# define hidden_def(a)
-
-#define __isnanf __isnanf_generic
-
-#include "../s_isnanf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/s_fmax.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.c
index 2082354991..8ad3ccbc64 100644
--- a/sysdeps/sparc/sparc64/fpu/s_fmax.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.c
@@ -1,7 +1,6 @@
-/* fmax function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* isnanf ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,20 +16,18 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#define __isnanf __redirect___isnanf
+#include <math.h>
+#undef __isnanf
+#include <sparc-ifunc.h>
-#define SIGN_BIT %f12 /* -0.0 */
+extern __typeof (isnanf) __isnanf_vis3 attribute_hidden;
+extern __typeof (isnanf) __isnanf_generic attribute_hidden;
-ENTRY (__fmax)
- fcmpd %fcc1, %f2, %f2
- fzero SIGN_BIT
- fmovdu %fcc1, %f0, %f2
- fnegd SIGN_BIT, SIGN_BIT
- fcmpd %fcc2, %f0, %f2
- fmovdul %fcc2, %f2, %f0
- fand %f0, %f2, %f4
- fandnot2 SIGN_BIT, %f4, %f4
- retl
- fandnot2 %f0, %f4, %f0
-END (__fmax)
-weak_alias (__fmax, fmax)
+sparc_libm_ifunc_redirected (__redirect___isnanf, __isnanf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __isnanf_vis3
+ : __isnanf_generic);
+
+sparc_ifunc_redirected_hidden_def (__redirect___isnanf,__isnanf)
+weak_alias (__isnanf, isnanf)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S
new file mode 100644
index 0000000000..e6ab999a66
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S
@@ -0,0 +1,6 @@
+#define __lrint __lrint_generic
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_lrint.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S
index 8ec42ad576..865bc4b9d7 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S
@@ -1,5 +1,5 @@
/* lrint(), sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S
deleted file mode 100644
index 94af8f028c..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(lrint)
-
-weak_alias (__lrint, lrint)
-
-strong_alias (__lrint, __llrint)
-weak_alias (__llrint, llrint)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef strong_alias
-# define strong_alias(a, b)
-
-#define __lrint __lrint_generic
-
-#include "../s_lrint.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c
new file mode 100644
index 0000000000..159bcd9aa6
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c
@@ -0,0 +1,40 @@
+/* lrint/llrint ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#define lrint __redirect_lrint
+#define llrint __redirect_llrint
+#define __lrint __redirect___lrint
+#define __llrint __redirect___llrint
+#include <math.h>
+#undef lrint
+#undef llrint
+#undef __lrint
+#undef __llrint
+#include <sparc-ifunc.h>
+#include <libm-alias-double.h>
+
+extern __typeof (__redirect_lrint) __lrint_vis3 attribute_hidden;
+extern __typeof (__redirect_lrint) __lrint_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect_lrint, __lrint,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __lrint_vis3
+ : __lrint_generic);
+libm_alias_double (__lrint, lrint)
+strong_alias (__lrint, __llrint)
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S
new file mode 100644
index 0000000000..4cfbf4ae72
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S
@@ -0,0 +1,6 @@
+#define __lrintf __lrintf_generic
+#undef weak_alias
+#define weak_alias(a,b)
+#undef strong_alias
+#define strong_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_lrintf.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S
index 943a2b14b2..229205e98a 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S
@@ -1,5 +1,5 @@
/* lrintf(), sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S
deleted file mode 100644
index e6ea4061c3..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(lrintf)
-
-weak_alias (__lrintf, lrintf)
-
-strong_alias (__lrintf, __llrintf)
-weak_alias (__llrintf, llrintf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef strong_alias
-# define strong_alias(a, b)
-
-#define __lrintf __lrintf_generic
-
-#include "../s_lrintf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c
new file mode 100644
index 0000000000..ccb7cd9723
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c
@@ -0,0 +1,40 @@
+/* lrintf/llrintf ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#define lrintf __redirect_lrintf
+#define llrintf __redirect_llrintf
+#define __lrintf __redirect_lrintf
+#define __llrintf __redirect_llrintf
+#include <math.h>
+#undef lrintf
+#undef llrintf
+#undef __lrintf
+#undef __llrintf
+#include <sparc-ifunc.h>
+#include <libm-alias-float.h>
+
+extern __typeof (__redirect_lrintf) __lrintf_vis3 attribute_hidden;
+extern __typeof (__redirect_lrintf) __lrintf_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect_lrintf, __lrintf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __lrintf_vis3
+ : __lrintf_generic);
+libm_alias_float (__lrint, lrint)
+strong_alias (__lrintf, __llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-generic.S
new file mode 100644
index 0000000000..efe238326d
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-generic.S
@@ -0,0 +1,4 @@
+#define __nearbyint __nearbyint_generic
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_nearbyint.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S
index fff277ae49..29b53e917c 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc64 vis3 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.
@@ -35,6 +35,7 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyint_vis3)
+ fcmpd %fcc3, %f0, %f0 /* Check for sNaN */
stx %fsr, [%sp + STACK_BIAS + 144]
sethi %hi(TWO_FIFTYTWO), %o2
sllx %o2, 32, %o2
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S
deleted file mode 100644
index bb75ab3606..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(nearbyint)
-
-weak_alias (__nearbyint, nearbyint)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __nearbyint __nearbyint_generic
-
-#include "../s_nearbyint.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c
new file mode 100644
index 0000000000..b58cbdcc9b
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c
@@ -0,0 +1,30 @@
+/* nearbyint ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#include <math.h>
+#include <sparc-ifunc.h>
+#include <libm-alias-double.h>
+
+extern __typeof (nearbyint) __nearbyint_vis3 attribute_hidden;
+extern __typeof (nearbyint) __nearbyint_generic attribute_hidden;
+
+sparc_libm_ifunc (__nearbyint,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __nearbyint_vis3
+ : __nearbyint_generic);
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-generic.S
new file mode 100644
index 0000000000..a2e38e9983
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-generic.S
@@ -0,0 +1,4 @@
+#define __nearbyintf __nearbyintf_generic
+#undef weak_alias
+#define weak_alias(a,b)
+#include <sysdeps/sparc/sparc64/fpu/s_nearbyintf.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S
index c6e94ba73b..de2dbe9c93 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc64 vis3 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.
@@ -35,6 +35,7 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyintf_vis3)
+ fcmps %fcc3, %f1, %f1 /* Check for sNaN */
stx %fsr, [%sp + STACK_BIAS + 144]
sethi %hi(0xf8003e0), %o5
sethi %hi(TWO_TWENTYTHREE), %o2
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S
deleted file mode 100644
index 95100c1bfc..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(nearbyintf)
-
-weak_alias (__nearbyintf, nearbyintf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __nearbyintf __nearbyintf_generic
-
-#include "../s_nearbyintf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/s_fmin.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.c
index d93f76a38a..bd18ea2fcb 100644
--- a/sysdeps/sparc/sparc64/fpu/s_fmin.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.c
@@ -1,7 +1,6 @@
-/* fmin function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* nearbyintf ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,20 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
+#include <sparc-ifunc.h>
+#include <libm-alias-float.h>
-#define SIGN_BIT %f12 /* -0.0 */
+extern __typeof (nearbyintf) __nearbyintf_vis3 attribute_hidden;
+extern __typeof (nearbyintf) __nearbyintf_generic attribute_hidden;
-ENTRY (__fmin)
- fcmpd %fcc1, %f2, %f2
- fzero SIGN_BIT
- fmovdu %fcc1, %f0, %f2
- fnegd SIGN_BIT, SIGN_BIT
- fcmpd %fcc2, %f0, %f2
- fmovdug %fcc2, %f2, %f0
- for %f0, %f2, %f4
- fand %f4, SIGN_BIT, %f4
- retl
- for %f0, %f4, %f0
-END (__fmin)
-weak_alias (__fmin, fmin)
+sparc_libm_ifunc (__nearbyintf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __nearbyintf_vis3
+ : __nearbyintf_generic);
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S
new file mode 100644
index 0000000000..d92743423e
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S
@@ -0,0 +1,4 @@
+#define __rint __rint_generic
+#undef weak_alias
+#define weak_alias(a, b)
+#include <sysdeps/sparc/sparc64/fpu/s_rint.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S
index c2a8e58cfe..19343c3de9 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S
deleted file mode 100644
index cc980eb8c7..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(rint)
-
-weak_alias (__rint, rint)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __rint __rint_generic
-
-#include "../s_rint.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c
new file mode 100644
index 0000000000..ae782b0b60
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c
@@ -0,0 +1,30 @@
+/* rint ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#include <math.h>
+#include <sparc-ifunc.h>
+#include <libm-alias-double.h>
+
+extern __typeof (rint) __rint_vis3 attribute_hidden;
+extern __typeof (rint) __rint_generic attribute_hidden;
+
+sparc_libm_ifunc (__rint,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __rint_vis3
+ : __rint_generic);
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S
new file mode 100644
index 0000000000..30da5f039d
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S
@@ -0,0 +1,4 @@
+#define __rintf __rintf_generic
+#undef weak_alias
+#define weak_alias(a, b)
+#include <sysdeps/sparc/sparc64/fpu/s_rintf.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S
index 1dde1df91c..86a81c96d2 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S
deleted file mode 100644
index 38fd936086..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(rintf)
-
-weak_alias (__rintf, rintf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __rintf __rintf_generic
-
-#include "../s_rintf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c
new file mode 100644
index 0000000000..e0265c47aa
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c
@@ -0,0 +1,30 @@
+/* rintf ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#include <math.h>
+#include <sparc-ifunc.h>
+#include <libm-alias-float.h>
+
+extern __typeof (rintf) __rintf_vis3 attribute_hidden;
+extern __typeof (rintf) __rintf_generic attribute_hidden;
+
+sparc_libm_ifunc (__rintf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __rintf_vis3
+ : __rintf_generic);
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-generic.S
new file mode 100644
index 0000000000..dfa40aca8f
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-generic.S
@@ -0,0 +1,6 @@
+#define __signbit __signbit_generic
+#undef strong_alias
+#define strong_alias(a, b)
+#undef hidden_def
+#define hidden_def(a)
+#include <sysdeps/sparc/sparc64/fpu/s_signbit.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S
index e2c9f7ddab..4bc1571ce7 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S
@@ -1,5 +1,5 @@
/* signbit(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S
deleted file mode 100644
index e69550c474..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(signbit)
-
-weak_alias (__signbit, signbit)
-
-/* On 64-bit the double version will also always work for
- long-double-precision since in both cases the word with the
- sign bit in it is passed always in register %f0. */
-strong_alias (__signbit, __signbitl)
-hidden_def (__signbitl)
-weak_alias (__signbitl, signbitl)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef strong_alias
-# define strong_alias(a, b)
-# undef hidden_def
-# define hidden_def(a)
-
-#define __signbit __signbit_generic
-
-#include "../s_signbit.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.c
new file mode 100644
index 0000000000..28d18b93af
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.c
@@ -0,0 +1,37 @@
+/* signbit ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#define __signbit __redirect_signbit
+#include <math.h>
+#undef __signbit
+
+#include <sparc-ifunc.h>
+
+extern __typeof (__redirect_signbit) __signbit_vis3 attribute_hidden;
+extern __typeof (__redirect_signbit) __signbit_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect_signbit, __signbit,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __signbit_vis3
+ : __signbit_generic);
+
+/* On 64-bit the double version will also always work for
+ long-double-precision since in both cases the word with the
+ sign bit in it is passed always in register %f0. */
+strong_alias (__signbit, __signbitl)
+sparc_ifunc_redirected_hidden_def (__redirect_signbit, __signbitl)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-generic.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-generic.S
new file mode 100644
index 0000000000..851ff350d1
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-generic.S
@@ -0,0 +1,2 @@
+#define __signbitf __signbitf_generic
+#include <sysdeps/sparc/sparc64/fpu/s_signbitf.S>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S
index 2dab5f9f31..bafa7d1c57 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S
@@ -1,5 +1,5 @@
/* signbitf(). sparc64 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S
deleted file mode 100644
index c35c79f88a..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(signbitf)
-
-weak_alias (__signbitf, signbitf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __signbitf __signbitf_generic
-
-#include "../s_signbitf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.c
new file mode 100644
index 0000000000..b2648ee937
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.c
@@ -0,0 +1,28 @@
+/* signbit ifunc resolver, Linux/sparc64 version.
+ Copyright (C) 2017-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#include <math.h>
+#include <sparc-ifunc.h>
+
+extern int __signbitf_vis3 (float) attribute_hidden;
+extern int __signbitf_generic (float) attribute_hidden;
+
+sparc_libm_ifunc(__signbitf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __signbitf_vis3
+ : __signbitf_generic);
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c
new file mode 100644
index 0000000000..00abd2a643
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c
@@ -0,0 +1,2 @@
+#define __trunc __trunc_generic
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S
deleted file mode 100644
index 63d01485cb..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc64 vis3 version.
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any PIC
- references. We also thus avoid having to allocate a register
- window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__trunc_vis3)
- sethi %hi(TWO_FIFTYTWO), %o2
- sllx %o2, 32, %o2
- fzero ZERO
- fnegd ZERO, SIGN_BIT
- movxtod %o2, %f16
- fabsd %f0, %f14
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f14
- fand %f0, SIGN_BIT, SIGN_BIT
- fdtox %f14, %f14
- fxtod %f14, %f14
- faddd %f0, ZERO, %f18
- fmovduge %fcc3, %f18, %f14
- retl
- for %f14, SIGN_BIT, %f0
-END (__trunc_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c
new file mode 100644
index 0000000000..a89916ba89
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c
@@ -0,0 +1,23 @@
+/* trunc function, sparc64 vis3 version.
+ Copyright (C) 2016-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#include <math.h>
+
+#define __trunc __trunc_vis3
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S
deleted file mode 100644
index 0d6f43a189..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(trunc)
-
-weak_alias (__trunc, trunc)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __trunc __trunc_generic
-
-#include "../s_trunc.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c
new file mode 100644
index 0000000000..82ad6ffcca
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c
@@ -0,0 +1,30 @@
+/* trunc function, sparc64 version.
+ Copyright (C) 2016-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-double.h>
+
+extern __typeof (trunc) __trunc_vis3 attribute_hidden;
+extern __typeof (trunc) __trunc_generic attribute_hidden;
+
+sparc_libm_ifunc (__trunc,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __trunc_vis3
+ : __trunc_generic);
+libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c
new file mode 100644
index 0000000000..7e5d91e742
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c
@@ -0,0 +1,2 @@
+#define __truncf __truncf_generic
+#include <sysdeps/ieee754/flt-32/s_truncf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S
deleted file mode 100644
index 10b09c262c..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc64 vis3 version.
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any PIC
- references. We also thus avoid having to allocate a register
- window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__truncf_vis3)
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- movwtos %o2,%f16
- fabss %f1, %f14
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f14
- fands %f1, SIGN_BIT, SIGN_BIT
- fstoi %f14, %f14
- fitos %f14, %f14
- fadds %f1, ZERO, %f18
- fmovsuge %fcc3, %f18, %f14
- retl
- fors %f14, SIGN_BIT, %f0
-END (__truncf_vis3)
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c
new file mode 100644
index 0000000000..676b1b47aa
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c
@@ -0,0 +1,23 @@
+/* Float trunc function, sparc64 vis3 version.
+ Copyright (C) 2016-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#include <math.h>
+
+#define __truncf __truncf_vis3
+
+#include <sysdeps/ieee754/flt-32/s_truncf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S
deleted file mode 100644
index 2ca2517334..0000000000
--- a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(truncf)
-
-weak_alias (__truncf, truncf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __truncf __truncf_generic
-
-#include "../s_truncf.S"
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c
new file mode 100644
index 0000000000..1c7a4a038f
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c
@@ -0,0 +1,30 @@
+/* Float trunc function, sparc64 version.
+ Copyright (C) 2016-2018 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ 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/>. */
+
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-float.h>
+
+extern __typeof (truncf) __truncf_vis3 attribute_hidden;
+extern __typeof (truncf) __truncf_generic attribute_hidden;
+
+sparc_libm_ifunc (__truncf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __truncf_vis3
+ : __truncf_generic)
+libm_alias_float (__trunc, trunc)
diff --git a/sysdeps/sparc/sparc64/fpu/s_ceil.S b/sysdeps/sparc/sparc64/fpu/s_ceil.S
deleted file mode 100644
index 2c74438de4..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_ceil.S
+++ /dev/null
@@ -1,83 +0,0 @@
-/* ceil function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* Since changing the rounding mode is extremely expensive, we
- try to round up using a method that is rounding mode
- agnostic.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value.
- One of two things will happen for non-whole initial values.
- Either the rounding mode will round it up, or it will be
- rounded down. If the value started out whole, it will be
- equal after the addition and subtraction. This means we
- can accurately detect with one test whether we need to add
- another 1.0 to round it up properly.
-
- We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any
- PIC references. We also thus avoid having to allocate a
- register window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceil)
- sethi %hi(TWO_FIFTYTWO), %o2
- sethi %hi(ONE_DOT_ZERO), %o3
- fzero ZERO
-
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
-
- sllx %o3, 32, %o3
- stx %o2, [%sp + STACK_BIAS + 128]
- fabsd %f0, %f14
-
- ldd [%sp + STACK_BIAS + 128], %f16
- fcmpd %fcc3, %f14, %f16
-
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
-
- for %f16, SIGN_BIT, %f16
- faddd %f0, %f16, %f18
- fsubd %f18, %f16, %f18
- fcmpd %fcc2, %f18, %f0
- stx %o3, [%sp + STACK_BIAS + 128]
-
- ldd [%sp + STACK_BIAS + 128], %f20
- fmovduge %fcc2, ZERO, %f20
- faddd %f18, %f20, %f0
- fabsd %f0, %f0
- retl
- for %f0, SIGN_BIT, %f0
-END (__ceil)
-weak_alias (__ceil, ceil)
diff --git a/sysdeps/sparc/sparc64/fpu/s_ceilf.S b/sysdeps/sparc/sparc64/fpu/s_ceilf.S
deleted file mode 100644
index 5542dc4818..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_ceilf.S
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Float ceil function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* Since changing the rounding mode is extremely expensive, we
- try to round up using a method that is rounding mode
- agnostic.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value.
- One of two things will happen for non-whole initial values.
- Either the rounding mode will round it up, or it will be
- rounded down. If the value started out whole, it will be
- equal after the addition and subtraction. This means we
- can accurately detect with one test whether we need to add
- another 1.0 to round it up properly.
-
- We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any
- PIC references. We also thus avoid having to allocate a
- register window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__ceilf)
- sethi %hi(TWO_TWENTYTHREE), %o2
- sethi %hi(ONE_DOT_ZERO), %o3
- fzeros ZERO
-
- fnegs ZERO, SIGN_BIT
-
- st %o2, [%sp + STACK_BIAS + 128]
- fabss %f1, %f14
-
- ld [%sp + STACK_BIAS + 128], %f16
- fcmps %fcc3, %f14, %f16
-
- fmovsuge %fcc3, ZERO, %f16
- fands %f1, SIGN_BIT, SIGN_BIT
-
- fors %f16, SIGN_BIT, %f16
- fadds %f1, %f16, %f5
- fsubs %f5, %f16, %f5
- fcmps %fcc2, %f5, %f1
- st %o3, [%sp + STACK_BIAS + 128]
-
- ld [%sp + STACK_BIAS + 128], %f9
- fmovsuge %fcc2, ZERO, %f9
- fadds %f5, %f9, %f0
- fabss %f0, %f0
- retl
- fors %f0, SIGN_BIT, %f0
-END (__ceilf)
-weak_alias (__ceilf, ceilf)
diff --git a/sysdeps/sparc/sparc64/fpu/s_copysign.S b/sysdeps/sparc/sparc64/fpu/s_copysign.S
index 390b463525..f3f207dea0 100644
--- a/sysdeps/sparc/sparc64/fpu/s_copysign.S
+++ b/sysdeps/sparc/sparc64/fpu/s_copysign.S
@@ -1,5 +1,5 @@
/* copysign function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-double.h>
ENTRY (__copysign)
fzeros %f7
@@ -27,4 +28,4 @@ ENTRY (__copysign)
retl
fors %f0, %f9, %f0
END (__copysign)
-weak_alias (__copysign, copysign) \ No newline at end of file
+libm_alias_double (__copysign, copysign)
diff --git a/sysdeps/sparc/sparc64/fpu/s_copysignf.S b/sysdeps/sparc/sparc64/fpu/s_copysignf.S
index def4b6bf97..6fb25c3322 100644
--- a/sysdeps/sparc/sparc64/fpu/s_copysignf.S
+++ b/sysdeps/sparc/sparc64/fpu/s_copysignf.S
@@ -1,5 +1,5 @@
/* float copysign function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
ENTRY (__copysignf)
fzeros %f7
@@ -27,4 +28,4 @@ ENTRY (__copysignf)
retl
fors %f1, %f9, %f0
END (__copysignf)
-weak_alias (__copysignf, copysignf) \ No newline at end of file
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fabs.c b/sysdeps/sparc/sparc64/fpu/s_fabs.c
index db5ecf2162..7862290da3 100644
--- a/sysdeps/sparc/sparc64/fpu/s_fabs.c
+++ b/sysdeps/sparc/sparc64/fpu/s_fabs.c
@@ -1,5 +1,7 @@
+#include <libm-alias-double.h>
+
double __fabs (double x)
{
return __builtin_fabs (x);
}
-weak_alias (__fabs, fabs)
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fabsf.c b/sysdeps/sparc/sparc64/fpu/s_fabsf.c
index 8a218e4942..5f54f80bf5 100644
--- a/sysdeps/sparc/sparc64/fpu/s_fabsf.c
+++ b/sysdeps/sparc/sparc64/fpu/s_fabsf.c
@@ -1,5 +1,7 @@
+#include <libm-alias-float.h>
+
float __fabsf (float x)
{
return __builtin_fabsf (x);
}
-weak_alias (__fabsf, fabsf)
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fabsl.c b/sysdeps/sparc/sparc64/fpu/s_fabsl.c
index 67e9f47071..72e1c51340 100644
--- a/sysdeps/sparc/sparc64/fpu/s_fabsl.c
+++ b/sysdeps/sparc/sparc64/fpu/s_fabsl.c
@@ -1,5 +1,7 @@
+#include <libm-alias-ldouble.h>
+
long double __fabsl (long double x)
{
return __builtin_fabsl (x);
}
-weak_alias (__fabsl, fabsl)
+libm_alias_ldouble (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fdim.S b/sysdeps/sparc/sparc64/fpu/s_fdim.S
deleted file mode 100644
index 7fae72a251..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_fdim.S
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Compute positive difference, sparc 64-bit.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
-
-ENTRY(__fdim)
- fcmpd %f0, %f2
- fbug 1f
- nop
- fzero %f0
- fnegd %f0, %f2
-1: retl
- fsubd %f0, %f2, %f0
-END(__fdim)
-weak_alias (__fdim, fdim)
diff --git a/sysdeps/sparc/sparc64/fpu/s_fdimf.S b/sysdeps/sparc/sparc64/fpu/s_fdimf.S
deleted file mode 100644
index 356c23c4e3..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_fdimf.S
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Compute positive difference, sparc 64-bit.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
-ENTRY(__fdimf)
- fcmps %f1, %f3
- fbug 1f
- nop
- fzeros %f1
- fnegs %f1, %f3
-1: retl
- fsubs %f1, %f3, %f0
-END(__fdimf)
-weak_alias (__fdimf, fdimf)
diff --git a/sysdeps/sparc/sparc64/fpu/s_finite.S b/sysdeps/sparc/sparc64/fpu/s_finite.S
index aa80fa0d83..b3018bbbcd 100644
--- a/sysdeps/sparc/sparc64/fpu/s_finite.S
+++ b/sysdeps/sparc/sparc64/fpu/s_finite.S
@@ -1,5 +1,5 @@
/* finite(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/sparc/sparc64/fpu/s_finitef.S b/sysdeps/sparc/sparc64/fpu/s_finitef.S
index cdcdf34417..e82af81079 100644
--- a/sysdeps/sparc/sparc64/fpu/s_finitef.S
+++ b/sysdeps/sparc/sparc64/fpu/s_finitef.S
@@ -1,5 +1,5 @@
/* finitef(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/sparc/sparc64/fpu/s_floor.S b/sysdeps/sparc/sparc64/fpu/s_floor.S
deleted file mode 100644
index aded393595..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_floor.S
+++ /dev/null
@@ -1,83 +0,0 @@
-/* floor function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* Since changing the rounding mode is extremely expensive, we
- try to round up using a method that is rounding mode
- agnostic.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value.
- One of two things will happen for non-whole initial values.
- Either the rounding mode will round it up, or it will be
- rounded down. If the value started out whole, it will be
- equal after the addition and subtraction. This means we
- can accurately detect with one test whether we need to add
- another 1.0 to round it up properly.
-
- We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any
- PIC references. We also thus avoid having to allocate a
- register window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floor)
- sethi %hi(TWO_FIFTYTWO), %o2
- sethi %hi(ONE_DOT_ZERO), %o3
- fzero ZERO
-
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
-
- sllx %o3, 32, %o3
- stx %o2, [%sp + STACK_BIAS + 128]
- fabsd %f0, %f14
-
- ldd [%sp + STACK_BIAS + 128], %f16
- fcmpd %fcc3, %f14, %f16
-
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
-
- for %f16, SIGN_BIT, %f16
- faddd %f0, %f16, %f18
- fsubd %f18, %f16, %f18
- fcmpd %fcc2, %f18, %f0
- stx %o3, [%sp + STACK_BIAS + 128]
-
- ldd [%sp + STACK_BIAS + 128], %f20
- fmovdule %fcc2, ZERO, %f20
- fsubd %f18, %f20, %f0
- fabsd %f0, %f0
- retl
- for %f0, SIGN_BIT, %f0
-END (__floor)
-weak_alias (__floor, floor)
diff --git a/sysdeps/sparc/sparc64/fpu/s_floorf.S b/sysdeps/sparc/sparc64/fpu/s_floorf.S
deleted file mode 100644
index 9f20549d8f..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_floorf.S
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Float floor function, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2012.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* Since changing the rounding mode is extremely expensive, we
- try to round up using a method that is rounding mode
- agnostic.
-
- We add then subtract (or subtract than add if the initial
- value was negative) 2**23 to the value, then subtract it
- back out.
-
- This will clear out the fractional portion of the value.
- One of two things will happen for non-whole initial values.
- Either the rounding mode will round it up, or it will be
- rounded down. If the value started out whole, it will be
- equal after the addition and subtraction. This means we
- can accurately detect with one test whether we need to add
- another 1.0 to round it up properly.
-
- We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any
- PIC references. We also thus avoid having to allocate a
- register window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__floorf)
- sethi %hi(TWO_TWENTYTHREE), %o2
- sethi %hi(ONE_DOT_ZERO), %o3
- fzeros ZERO
-
- fnegs ZERO, SIGN_BIT
-
- st %o2, [%sp + STACK_BIAS + 128]
- fabss %f1, %f14
-
- ld [%sp + STACK_BIAS + 128], %f16
- fcmps %fcc3, %f14, %f16
-
- fmovsuge %fcc3, ZERO, %f16
- fands %f1, SIGN_BIT, SIGN_BIT
-
- fors %f16, SIGN_BIT, %f16
- fadds %f1, %f16, %f5
- fsubs %f5, %f16, %f5
- fcmps %fcc2, %f5, %f1
- st %o3, [%sp + STACK_BIAS + 128]
-
- ld [%sp + STACK_BIAS + 128], %f9
- fmovsule %fcc2, ZERO, %f9
- fsubs %f5, %f9, %f0
- fabss %f0, %f0
- retl
- fors %f0, SIGN_BIT, %f0
-END (__floorf)
-weak_alias (__floorf, floorf)
diff --git a/sysdeps/sparc/sparc64/fpu/s_isinf.S b/sysdeps/sparc/sparc64/fpu/s_isinf.S
index b9da758d71..6365bc438b 100644
--- a/sysdeps/sparc/sparc64/fpu/s_isinf.S
+++ b/sysdeps/sparc/sparc64/fpu/s_isinf.S
@@ -1,5 +1,5 @@
/* isinf(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/sparc/sparc64/fpu/s_isinff.S b/sysdeps/sparc/sparc64/fpu/s_isinff.S
index a68845672f..9737d91102 100644
--- a/sysdeps/sparc/sparc64/fpu/s_isinff.S
+++ b/sysdeps/sparc/sparc64/fpu/s_isinff.S
@@ -1,5 +1,5 @@
/* isinff(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/sparc/sparc64/fpu/s_isnan.S b/sysdeps/sparc/sparc64/fpu/s_isnan.S
index 342b987203..47ac0cf247 100644
--- a/sysdeps/sparc/sparc64/fpu/s_isnan.S
+++ b/sysdeps/sparc/sparc64/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* isnan(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/sparc/sparc64/fpu/s_isnanf.S b/sysdeps/sparc/sparc64/fpu/s_isnanf.S
index 43e232260a..32e80219f7 100644
--- a/sysdeps/sparc/sparc64/fpu/s_isnanf.S
+++ b/sysdeps/sparc/sparc64/fpu/s_isnanf.S
@@ -1,5 +1,5 @@
/* isnanf(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/sparc/sparc64/fpu/s_lrint.S b/sysdeps/sparc/sparc64/fpu/s_lrint.S
index 0e21aba06d..907a466be5 100644
--- a/sysdeps/sparc/sparc64/fpu/s_lrint.S
+++ b/sysdeps/sparc/sparc64/fpu/s_lrint.S
@@ -1,5 +1,5 @@
/* lrint(), sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.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
@@ -57,7 +58,7 @@ ENTRY (__lrint)
retl
ldx [%sp + STACK_BIAS + 128], %o0
END (__lrint)
-weak_alias (__lrint, lrint)
+libm_alias_double (__lrint, lrint)
strong_alias (__lrint, __llrint)
-weak_alias (__llrint, llrint)
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc64/fpu/s_lrintf.S b/sysdeps/sparc/sparc64/fpu/s_lrintf.S
index 275222ff2d..7a341f6fc5 100644
--- a/sysdeps/sparc/sparc64/fpu/s_lrintf.S
+++ b/sysdeps/sparc/sparc64/fpu/s_lrintf.S
@@ -1,5 +1,5 @@
/* lrintf(), sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -56,7 +57,7 @@ ENTRY (__lrintf)
retl
ldx [%sp + STACK_BIAS + 128], %o0
END (__lrintf)
-weak_alias (__lrintf, lrintf)
+libm_alias_float (__lrint, lrint)
strong_alias (__lrintf, __llrintf)
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc64/fpu/s_nearbyint.S b/sysdeps/sparc/sparc64/fpu/s_nearbyint.S
index caf4d729e0..a8f099779f 100644
--- a/sysdeps/sparc/sparc64/fpu/s_nearbyint.S
+++ b/sysdeps/sparc/sparc64/fpu/s_nearbyint.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc64 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.
@@ -20,6 +20,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.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
@@ -35,6 +36,7 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyint)
+ fcmpd %fcc3, %f0, %f0 /* Check for sNaN */
stx %fsr, [%sp + STACK_BIAS + 144]
sethi %hi(TWO_FIFTYTWO), %o2
sllx %o2, 32, %o2
@@ -60,4 +62,4 @@ ENTRY (__nearbyint)
retl
ldx [%sp + STACK_BIAS + 144], %fsr
END (__nearbyint)
-weak_alias (__nearbyint, nearbyint)
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S b/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S
index 4232eca9ad..361ea5800d 100644
--- a/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S
+++ b/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc64 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.
@@ -20,6 +20,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -35,6 +36,7 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyintf)
+ fcmps %fcc3, %f1, %f1 /* Check for sNaN */
stx %fsr, [%sp + STACK_BIAS + 144]
sethi %hi(0xf8003e0), %o5
sethi %hi(TWO_TWENTYTHREE), %o2
@@ -59,4 +61,4 @@ ENTRY (__nearbyintf)
retl
ldx [%sp + STACK_BIAS + 144], %fsr
END (__nearbyintf)
-weak_alias (__nearbyintf, nearbyintf)
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc64/fpu/s_rint.S b/sysdeps/sparc/sparc64/fpu/s_rint.S
index afdb4329fb..23745fb7e5 100644
--- a/sysdeps/sparc/sparc64/fpu/s_rint.S
+++ b/sysdeps/sparc/sparc64/fpu/s_rint.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.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
@@ -54,4 +55,4 @@ ENTRY (__rint)
retl
for %f0, SIGN_BIT, %f0
END (__rint)
-weak_alias (__rint, rint)
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/sparc/sparc64/fpu/s_rintf.S b/sysdeps/sparc/sparc64/fpu/s_rintf.S
index f9448957cf..7eeb175aa7 100644
--- a/sysdeps/sparc/sparc64/fpu/s_rintf.S
+++ b/sysdeps/sparc/sparc64/fpu/s_rintf.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2012.
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <libm-alias-float.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -53,4 +54,4 @@ ENTRY (__rintf)
retl
fors %f0, SIGN_BIT, %f0
END (__rintf)
-weak_alias (__rintf, rintf)
+libm_alias_float (__rint, rint)
diff --git a/sysdeps/sparc/sparc64/fpu/s_signbit.S b/sysdeps/sparc/sparc64/fpu/s_signbit.S
index 1452c90f95..57fc717a48 100644
--- a/sysdeps/sparc/sparc64/fpu/s_signbit.S
+++ b/sysdeps/sparc/sparc64/fpu/s_signbit.S
@@ -1,5 +1,5 @@
/* signbit(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
@@ -24,11 +24,9 @@ ENTRY (__signbit)
retl
srl %o0, 31, %o0
END (__signbit)
-weak_alias (__signbit, signbit)
/* On 64-bit the double version will also always work for
long-double-precision since in both cases the word with the
sign bit in it is passed always in register %f0. */
strong_alias (__signbit, __signbitl)
hidden_def (__signbitl)
-weak_alias (__signbitl, signbitl)
diff --git a/sysdeps/sparc/sparc64/fpu/s_signbitf.S b/sysdeps/sparc/sparc64/fpu/s_signbitf.S
index 40d43d6c91..0b20f0189a 100644
--- a/sysdeps/sparc/sparc64/fpu/s_signbitf.S
+++ b/sysdeps/sparc/sparc64/fpu/s_signbitf.S
@@ -1,5 +1,5 @@
/* signbitf(). sparc64 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
@@ -24,4 +24,3 @@ ENTRY (__signbitf)
retl
srl %o0, 31, %o0
END (__signbitf)
-weak_alias (__signbitf, signbitf)
diff --git a/sysdeps/sparc/sparc64/fpu/s_trunc.S b/sysdeps/sparc/sparc64/fpu/s_trunc.S
deleted file mode 100644
index 34ecb142d4..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_trunc.S
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc64 version.
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any PIC
- references. We also thus avoid having to allocate a register
- window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__trunc)
- sethi %hi(TWO_FIFTYTWO), %o2
- sllx %o2, 32, %o2
- fzero ZERO
- fnegd ZERO, SIGN_BIT
- stx %o2, [%sp + STACK_BIAS + 128]
- fabsd %f0, %f14
- ldd [%sp + STACK_BIAS + 128], %f16
- fcmpd %fcc3, %f14, %f16
- fmovduge %fcc3, ZERO, %f14
- fand %f0, SIGN_BIT, SIGN_BIT
- fdtox %f14, %f14
- fxtod %f14, %f14
- faddd %f0, ZERO, %f18
- fmovduge %fcc3, %f18, %f14
- retl
- for %f14, SIGN_BIT, %f0
-END (__trunc)
-weak_alias (__trunc, trunc)
diff --git a/sysdeps/sparc/sparc64/fpu/s_truncf.S b/sysdeps/sparc/sparc64/fpu/s_truncf.S
deleted file mode 100644
index 7bc7235bec..0000000000
--- a/sysdeps/sparc/sparc64/fpu/s_truncf.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc64 version.
-
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David S. Miller <davem@davemloft.net>, 2013.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
- /* We pop constants into the FPU registers using the incoming
- argument stack slots, since this avoid having to use any PIC
- references. We also thus avoid having to allocate a register
- window.
-
- VIS instructions are used to facilitate the formation of
- easier constants, and the propagation of the sign bit. */
-
-#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
-
-#define ZERO %f10 /* 0.0 */
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__truncf)
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- st %o2, [%sp + STACK_BIAS + 128]
- fabss %f1, %f14
- ld [%sp + STACK_BIAS + 128], %f16
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f14
- fands %f1, SIGN_BIT, SIGN_BIT
- fstoi %f14, %f14
- fitos %f14, %f14
- fadds %f1, ZERO, %f18
- fmovsuge %fcc3, %f18, %f14
- retl
- fors %f14, SIGN_BIT, %f0
-END (__truncf)
-weak_alias (__truncf, truncf)
diff --git a/sysdeps/sparc/sparc64/fpu/w_sqrt.S b/sysdeps/sparc/sparc64/fpu/w_sqrt.S
deleted file mode 100644
index baa7c47fd2..0000000000
--- a/sysdeps/sparc/sparc64/fpu/w_sqrt.S
+++ /dev/null
@@ -1,48 +0,0 @@
-/* sqrt function. sparc64 version.
- Copyright (C) 2012-2016 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
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
-ENTRY (__sqrt)
- fzero %f8
- fcmpd %fcc2, %f0, %f8
- fbl,pn %fcc2, 1f
- nop
-8: retl
- fsqrtd %f0, %f0
-1:
-#ifdef SHARED
- SETUP_PIC_REG_LEAF(o5, g1)
- sethi %gdop_hix22(_LIB_VERSION), %g1
- xor %g1, %gdop_lox10(_LIB_VERSION), %g1
- ldx [%o5 + %g1], %g1, %gdop(_LIB_VERSION)
-#else
- sethi %hi(_LIB_VERSION), %g1
- or %g1, %lo(_LIB_VERSION), %g1
-#endif
- ld [%g1], %g1
- cmp %g1, -1
- be,pt %icc, 8b
- fmovd %f0, %f2
- mov 26, %o2
- mov %o7, %g1
- call __kernel_standard
- mov %g1, %o7
-END (__sqrt)
-
-weak_alias (__sqrt, sqrt)
diff --git a/sysdeps/sparc/sparc64/fpu/w_sqrtf.S b/sysdeps/sparc/sparc64/fpu/w_sqrtf.S
deleted file mode 100644
index 4d1fedbd62..0000000000
--- a/sysdeps/sparc/sparc64/fpu/w_sqrtf.S
+++ /dev/null
@@ -1,48 +0,0 @@
-/* sqrtf function. sparc64 version.
- Copyright (C) 2012-2016 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
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- 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/>. */
-
-#include <sysdep.h>
-
-ENTRY (__sqrtf)
- fzeros %f8
- fcmps %fcc2, %f1, %f8
- fbl,pn %fcc2, 1f
- nop
-8: retl
- fsqrts %f1, %f0
-1:
-#ifdef SHARED
- SETUP_PIC_REG_LEAF(o5, g1)
- sethi %gdop_hix22(_LIB_VERSION), %g1
- xor %g1, %gdop_lox10(_LIB_VERSION), %g1
- ldx [%o5 + %g1], %g1, %gdop(_LIB_VERSION)
-#else
- sethi %hi(_LIB_VERSION), %g1
- or %g1, %lo(_LIB_VERSION), %g1
-#endif
- ld [%g1], %g1
- cmp %g1, -1
- be,pt %icc, 8b
- fmovs %f1, %f3
- mov 126, %o2
- mov %o7, %g1
- call __kernel_standard_f
- mov %g1, %o7
-END (__sqrtf)
-
-weak_alias (__sqrtf, sqrtf)