summaryrefslogtreecommitdiff
path: root/sysdeps/sparc/sparc32/sparcv9
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/sparc/sparc32/sparcv9')
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/Makefile11
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/addmul_1.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/atomic-machine.h5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/cpu_relax.S1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/cpu_relax.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile34
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis2.S61
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S62
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis2.S58
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S59
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-generic.S8
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c (renamed from sysdeps/sparc/sparc32/sparcv9/fpu/s_fmin.S)40
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.c30
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.c32
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.c (renamed from sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S)30
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c4
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c (renamed from sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S)20
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c29
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c3
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c (renamed from sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf-vis3.S)18
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c (renamed from sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax-vis3.S)23
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis2.S61
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S62
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis2.S58
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S59
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-generic.c2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c14
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-generic.c2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c13
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin-vis3.S30
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S24
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.c (renamed from sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S)36
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S17
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.c30
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S9
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.c (renamed from sysdeps/sparc/sparc32/sparcv9/fpu/s_fmaxf.S)36
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c30
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c32
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-generic.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.c30
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S57
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S19
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S53
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt-vis3.S49
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf-vis3.S47
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf.S12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_ceil.S92
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_ceilf.S83
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S6
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S35
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_floor.S92
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_floorf.S83
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_fmax.S45
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_fminf.S40
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S9
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S72
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S18
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S10
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_rint.S9
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_rintf.S5
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S64
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S56
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt.S51
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf.S50
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/hp-timing.h2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/memmove.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/mul_1.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile4
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-memmove-niagara7.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S33
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S4
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memmove-ultra1.S4
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memset-niagara7.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S (renamed from sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf-vis3.S)24
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S4
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memmove.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/rtld-memmove.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/sem_init.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/sem_open.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/sem_wait.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/submul_1.S2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/udiv.S1
128 files changed, 515 insertions, 2084 deletions
diff --git a/sysdeps/sparc/sparc32/sparcv9/Makefile b/sysdeps/sparc/sparc32/sparcv9/Makefile
index fefc742478..45507eabdb 100644
--- a/sysdeps/sparc/sparc32/sparcv9/Makefile
+++ b/sysdeps/sparc/sparc32/sparcv9/Makefile
@@ -1,18 +1,9 @@
-sysdep-CFLAGS += -mcpu=ultrasparc -Wa,-Av9a
+sysdep-CFLAGS += -mcpu=ultrasparc -Wa,-Av9a -mvis
-ifeq ($(have-as-vis3),yes)
ASFLAGS-.o += -Wa,-Av9d
ASFLAGS-.os += -Wa,-Av9d
ASFLAGS-.op += -Wa,-Av9d
-ASFLAGS-.og += -Wa,-Av9d
ASFLAGS-.oS += -Wa,-Av9d
-else
-ASFLAGS-.o += -Wa,-Av9a
-ASFLAGS-.os += -Wa,-Av9a
-ASFLAGS-.op += -Wa,-Av9a
-ASFLAGS-.og += -Wa,-Av9a
-ASFLAGS-.oS += -Wa,-Av9a
-endif
# nscd uses atomic_spin_nop which in turn requires cpu_relax
ifeq ($(subdir),nscd)
diff --git a/sysdeps/sparc/sparc32/sparcv9/addmul_1.S b/sysdeps/sparc/sparc32/sparcv9/addmul_1.S
index 11b73f4195..a85212b29b 100644
--- a/sysdeps/sparc/sparc32/sparcv9/addmul_1.S
+++ b/sysdeps/sparc/sparc32/sparcv9/addmul_1.S
@@ -1,7 +1,7 @@
! SPARC v9 32-bit __mpn_addmul_1 -- Multiply a limb vector with a limb
! and add the result to a second limb vector.
!
-! 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>
!
diff --git a/sysdeps/sparc/sparc32/sparcv9/atomic-machine.h b/sysdeps/sparc/sparc32/sparcv9/atomic-machine.h
index b02ceae95b..c4c5239f51 100644
--- a/sysdeps/sparc/sparc32/sparcv9/atomic-machine.h
+++ b/sysdeps/sparc/sparc32/sparcv9/atomic-machine.h
@@ -1,5 +1,5 @@
/* Atomic operations. sparcv9 version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
@@ -47,6 +47,9 @@ typedef uintmax_t uatomic_max_t;
#define __HAVE_64B_ATOMICS 0
#define USE_ATOMIC_COMPILER_BUILTINS 0
+/* XXX Is this actually correct? */
+#define ATOMIC_EXCHANGE_USES_CAS 0
+
#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
(abort (), (__typeof (*mem)) 0)
diff --git a/sysdeps/sparc/sparc32/sparcv9/cpu_relax.S b/sysdeps/sparc/sparc32/sparcv9/cpu_relax.S
deleted file mode 100644
index 41a5e72b25..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/cpu_relax.S
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/sparc/sparc64/cpu_relax.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/cpu_relax.c b/sysdeps/sparc/sparc32/sparcv9/cpu_relax.c
new file mode 100644
index 0000000000..1670cf6558
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/cpu_relax.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/cpu_relax.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
index 0d92813d7b..1a26ee19c3 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
@@ -1,15 +1,23 @@
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_copysignf-vis3 m_copysign-vis3 s_ceilf-vis3 \
- s_ceil-vis3 s_fabs-vis3 s_fabsf-vis3 s_floor-vis3 \
- s_floorf-vis3 s_llrintf-vis3 s_llrint-vis3 \
- s_rintf-vis3 s_rint-vis3 w_sqrt-vis3 w_sqrtf-vis3 \
- s_fminf-vis3 s_fmin-vis3 s_fmaxf-vis3 s_fmax-vis3 \
- s_fmaf-vis3 s_fma-vis3 s_fdimf-vis3 s_fdim-vis3 \
- s_nearbyint-vis3 s_nearbyintf-vis3 s_truncf-vis3 \
- s_trunc-vis3
-sysdep_routines += s_copysignf-vis3 s_copysign-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_copysignf-vis3 s_copysign-vis3 s_copysignf-generic \
+ s_copysign-generic
+
+sysdep_routines += $(sysdep_calls)
+libm-sysdep_routines += s_fabs-vis3 s_fabsf-vis3 s_fabs-generic \
+ s_fabsf-generic s_llrintf-vis3 s_llrint-vis3 \
+ s_llrintf-generic s_llrint-generic \
+ s_rintf-vis3 s_rint-vis3 s_rintf-generic \
+ s_rint-generic s_fmaf-vis3 s_fma-vis3 s_fma-generic \
+ s_fmaf-generic s_nearbyint-vis3 s_nearbyintf-vis3 \
+ s_nearbyint-generic s_nearbyintf-generic \
+ s_fdimf-vis3 s_fdim-vis3 s_fdim-generic \
+ s_fdimf-generic \
+ $(sysdep_calls:s_%=m_%)
+
+CFLAGS-s_fdimf-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_fdim-vis3.c += -Wa,-Av9d -mvis3
endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis2.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis2.S
deleted file mode 100644
index edc24b3064..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis2.S
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ceil function, sparc32 v9 vis2 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>
-
- /* '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
- sllx %o0, 32, %o0
- or %o0, %o1, %o0
- stx %o0, [%sp + 72]
- sllx %o2, 32, %o2
- fzero ZERO
- ldd [%sp + 72], %f0
- fnegd ZERO, SIGN_BIT
- stx %o2, [%sp + 72]
- fabsd %f0, %f14
- ldd [%sp + 72], %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/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S
deleted file mode 100644
index 8b14c6896a..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ceil function, sparc32 v9 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
- sllx %o0, 32, %o0
- sllx %o2, 32, %o2
- or %o0, %o1, %o0
- movxtod %o0, %f0
- fzero ZERO
- 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/sparc32/sparcv9/fpu/multiarch/s_ceil.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S
deleted file mode 100644
index efc8d49365..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_VIS2_IFUNC(ceil)
-
-weak_alias (__ceil, ceil)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0)
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __ceil __ceil_generic
-
-#include "../s_ceil.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis2.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis2.S
deleted file mode 100644
index 019681b5f2..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis2.S
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Float ceil function, sparc32 v9 vis2 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>
-
- /* '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)
- st %o0, [%sp + 68]
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- ld [%sp + 68], %f0
- fnegs ZERO, SIGN_BIT
- st %o2, [%sp + 68]
- fabss %f0, %f14
- ld [%sp + 68], %f16
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f0, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 2
- fadds %f0, %f16, %f1
- siam (1 << 2) | 0
- fsubs %f1, %f16, %f1
- siam (0 << 2)
- retl
- fors %f1, SIGN_BIT, %f0
-END (__ceilf_vis2)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S
deleted file mode 100644
index 1bf306a115..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Float ceil function, sparc32 v9 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)
- movwtos %o0, %f0
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- movwtos %o2, %f16
- fabss %f0, %f14
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f0, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 2
- fadds %f0, %f16, %f1
- siam (1 << 2) | 0
- fsubs %f1, %f16, %f1
- siam (0 << 2)
- retl
- fors %f1, SIGN_BIT, %f0
-END (__ceilf_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S
deleted file mode 100644
index 1c72a5728e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/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/sparc32/sparcv9/fpu/multiarch/s_copysign-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-generic.S
new file mode 100644
index 0000000000..9aa3486277
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-generic.S
@@ -0,0 +1,8 @@
+#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
+#define __copysign __copysign_generic
+#undef libm_alias_double
+#define libm_alias_double(a, b)
+#undef compat_symbol
+#define compat_symbol(a, b, c, d)
+#include <sysdeps/sparc/sparc32/fpu/s_copysign.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S
index 802c77217d..8d6b047618 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S
@@ -1,5 +1,5 @@
/* copysign function, sparc32 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/sparc32/sparcv9/fpu/multiarch/s_copysign.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S
deleted file mode 100644
index cdd98c00f4..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(copysign)
-
-weak_alias (__copysign, copysign)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __copysign __copysign_generic
-
-#include "../../../fpu/s_copysign.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmin.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c
index 3d929b20b4..291e697d99 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmin.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c
@@ -1,7 +1,6 @@
-/* fmin function, sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* copysign ifunc resolver, Linux/sparc32 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,29 +16,22 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#define __copysign __redirect_copysign
+#include <math.h>
#include <math_ldbl_opt.h>
+#undef __copysign
+#include <libm-alias-double.h>
+#include <sparc-ifunc.h>
-#define SIGN_BIT %f12 /* -0.0 */
+extern __typeof (__redirect_copysign) __copysign_vis3 attribute_hidden;
+extern __typeof (__redirect_copysign) __copysign_generic attribute_hidden;
-ENTRY (__fmin)
- std %o0, [%sp + 72]
- std %o2, [%sp + 80]
- ldd [%sp + 72], %f0
- ldd [%sp + 80], %f2
- 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_redirected (__redirect_copysign, __copysign,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __copysign_vis3
+ : __copysign_generic);
+libm_alias_double (__copysign, copysign)
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmin, fminl, GLIBC_2_1);
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
+compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-generic.S
new file mode 100644
index 0000000000..685027500a
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-float.h>
+#define __copysignf __copysignf_generic
+#undef libm_alias_float
+#define libm_alias_float(a, b)
+#include <sysdeps/sparc/sparc32/fpu/s_copysignf.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S
index 82ce4adf2c..dfe48da8e2 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S
@@ -1,5 +1,5 @@
/* float copysign function, sparc32 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/sparc32/sparcv9/fpu/multiarch/s_copysignf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S
deleted file mode 100644
index cd409550de..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(copysignf)
-
-weak_alias (__copysignf, copysignf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __copysignf __copysignf_generic
-
-#include "../../../fpu/s_copysignf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.c
new file mode 100644
index 0000000000..c051167b48
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.c
@@ -0,0 +1,30 @@
+/* copysign ifunc resolver, Linux/sparc32 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 (copysignf) __copysignf_vis3 attribute_hidden;
+extern __typeof (copysignf) __copysignf_generic attribute_hidden;
+
+sparc_libm_ifunc (__copysignf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __copysignf_vis3
+ : __copysignf_generic);
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-generic.S
new file mode 100644
index 0000000000..267dbd2352
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-double.h>
+#define __fabs __fabs_generic
+#undef libm_alias_double
+#define libm_alias_double(a, b)
+#include <sysdeps/sparc/sparc32/fpu/s_fabs.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S
index ea40b6fb66..e183d7d138 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S
@@ -1,5 +1,5 @@
/* Float absolute value, sparc32+v9 vis3 version.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S
deleted file mode 100644
index 86c63989a4..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fabs)
-
-weak_alias (__fabs, fabs)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fabs __fabs_generic
-
-#include "../s_fabs.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.c
new file mode 100644
index 0000000000..e4edf0124d
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.c
@@ -0,0 +1,32 @@
+/* fabs ifunc resolver, Linux/sparc32 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 __fabs __redirect_fabs
+#include <math.h>
+#undef __fabs
+#include <sparc-ifunc.h>
+#include <libm-alias-double.h>
+
+extern __typeof (__redirect_fabs) __fabs_vis3 attribute_hidden;
+extern __typeof (__redirect_fabs) __fabs_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect_fabs, __fabs,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __fabs_vis3
+ : __fabs_generic);
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-generic.S
new file mode 100644
index 0000000000..b6fb38f34c
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-float.h>
+#define __fabsf __fabsf_generic
+#undef libm_alias_float
+#define libm_alias_float(a, b)
+#include <sysdeps/sparc/sparc32/fpu/s_fabsf.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S
index be44e85719..805da5ed07 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S
@@ -1,5 +1,5 @@
/* Float absolute value, sparc32 vis3 version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S
deleted file mode 100644
index 0f2e11e01f..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fabsf)
-
-weak_alias (__fabsf, fabsf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fabsf __fabsf_generic
-
-#include "../../../fpu/s_fabsf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.c
index 4a479b1a59..252ad8f714 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.c
@@ -1,7 +1,6 @@
-/* Compute positive difference, sparc 32-bit+v9+vis3.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* fabsf ifunc resolver, Linux/sparc32 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>.
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,18 +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>
-ENTRY(__fdim_vis3)
- movwtos %o0, %f0
- movwtos %o1, %f1
- movwtos %o2, %f2
- movwtos %o3, %f3
- fcmpd %f0, %f2
- fbug 1f
- nop
- fzero %f0
- fnegd %f0, %f2
-1: retl
- fsubd %f0, %f2, %f0
-END(__fdim_vis3)
+extern __typeof (fabsf) __fabsf_vis3 attribute_hidden;
+extern __typeof (fabsf) __fabsf_generic attribute_hidden;
+
+sparc_libm_ifunc (__fabsf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __fabsf_vis3
+ : __fabsf_generic);
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c
new file mode 100644
index 0000000000..30ee54b0c1
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c
@@ -0,0 +1,4 @@
+#define __fdim __fdim_generic
+#define declare_mgen_alias(t, f)
+
+#include <math/s_fdim.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c
index 081fc15b62..297f5ab730 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c
@@ -1,7 +1,6 @@
/* Compute positive difference, sparc 32-bit+v9+vis3.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ 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>.
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,16 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
-ENTRY(__fdimf_vis3)
- movwtos %o0, %f0
- movwtos %o1, %f1
- fcmps %f0, %f1
- fbug 1f
- nop
- fzeros %f0
- fnegs %f0, %f1
-1: retl
- fsubs %f0, %f1, %f0
-END(__fdimf_vis3)
+#define __fdim __fdim_vis3
+#define declare_mgen_alias(t, f)
+
+#include <math/s_fdim.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S
deleted file mode 100644
index 4b13408244..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(fdim)
-
-weak_alias (__fdim, fdim)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __fdim __fdim_generic
-
-#include "../s_fdim.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c
new file mode 100644
index 0000000000..5b35daee13
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c
@@ -0,0 +1,29 @@
+/* Compute positive difference, sparc 32-bit.
+ 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_ldbl_opt.h>
+#include <first-versions.h>
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-double.h>
+
+extern double __fdim_vis3 (double, double);
+extern double __fdim_generic (double, double);
+
+sparc_libm_ifunc(__fdim, hwcap & HWCAP_SPARC_VIS3 ? __fdim_vis3 : __fdim_generic);
+libm_alias_double (__fdim, fdim)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c
new file mode 100644
index 0000000000..17090b54df
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c
@@ -0,0 +1,3 @@
+#define __fdimf __fdimf_generic
+#define declare_mgen_alias(t, f)
+#include <math/s_fdimf.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c
index a71af068cd..84aeba3280 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c
@@ -1,7 +1,6 @@
-/* fminf function, sparc32 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Float compute positive difference, sparc 32-bit+v9+vis3.
+ 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,12 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <math.h>
-ENTRY (__fminf_vis3)
- movwtos %o0, %f0
- movwtos %o1, %f1
- flcmps %fcc1, %f0, %f1
- retl
- fmovsge %fcc1, %f1, %f0
-END (__fminf_vis3)
+#define __fdimf __fdimf_vis3
+#define declare_mgen_alias(t, f)
+
+#include <math/s_fdimf.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S
deleted file mode 100644
index 30381d6a59..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(fdimf)
-
-weak_alias (__fdimf, fdimf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __fdimf __fdimf_generic
-
-#include "../s_fdimf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c
index 271a7303d1..7fab2a8163 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c
@@ -1,7 +1,6 @@
-/* fmax function, sparc32 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Float compute positive difference, sparc 32-bit.
+ 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,14 +16,12 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-float.h>
-ENTRY (__fmax_vis3)
- movwtos %o0, %f0
- movwtos %o1, %f1
- movwtos %o2, %f2
- movwtos %o3, %f3
- flcmpd %fcc1, %f0, %f2
- retl
- fmovdlg %fcc1, %f2, %f0
-END (__fmax_vis3)
+extern float __fdimf_vis3 (float, float);
+extern float __fdimf_generic (float, float);
+
+sparc_libm_ifunc(__fdimf, hwcap & HWCAP_SPARC_VIS3 ? __fdimf_vis3 : __fdimf_generic);
+libm_alias_float (__fdim, fdim)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis2.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis2.S
deleted file mode 100644
index 0180d103b6..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis2.S
+++ /dev/null
@@ -1,61 +0,0 @@
-/* floor function, sparc32 v9 vis2 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>
-
- /* '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
- sllx %o0, 32, %o0
- or %o0, %o1, %o0
- stx %o0, [%sp + 72]
- sllx %o2, 32, %o2
- fzero ZERO
- ldd [%sp + 72], %f0
- fnegd ZERO, SIGN_BIT
- stx %o2, [%sp + 72]
- fabsd %f0, %f14
- ldd [%sp + 72], %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/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S
deleted file mode 100644
index 7b91620a42..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S
+++ /dev/null
@@ -1,62 +0,0 @@
-/* floor function, sparc32 v9 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
- sllx %o0, 32, %o0
- sllx %o2, 32, %o2
- or %o0, %o1, %o0
- movxtod %o0, %f0
- fzero ZERO
- 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/sparc32/sparcv9/fpu/multiarch/s_floor.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S
deleted file mode 100644
index 1fe4b95ea6..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_VIS2_IFUNC(floor)
-
-weak_alias (__floor, floor)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0)
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __floor __floor_generic
-
-#include "../s_floor.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis2.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis2.S
deleted file mode 100644
index 77e9f4bcc1..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis2.S
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Float floor function, sparc32 v9 vis2 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>
-
- /* '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)
- st %o0, [%sp + 68]
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- ld [%sp + 68], %f0
- fnegs ZERO, SIGN_BIT
- st %o2, [%sp + 68]
- fabss %f0, %f14
- ld [%sp + 68], %f16
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f0, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 3
- fadds %f0, %f16, %f1
- siam (1 << 2) | 0
- fsubs %f1, %f16, %f1
- siam (0 << 2)
- retl
- fors %f1, SIGN_BIT, %f0
-END (__floorf_vis2)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S
deleted file mode 100644
index bf7da6fbfa..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Float floor function, sparc32 v9 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)
- movwtos %o0, %f0
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- fnegs ZERO, SIGN_BIT
- movwtos %o2, %f16
- fabss %f0, %f14
- fcmps %fcc3, %f14, %f16
- fmovsuge %fcc3, ZERO, %f16
- fands %f0, SIGN_BIT, SIGN_BIT
- fors %f16, SIGN_BIT, %f16
- siam (1 << 2) | 3
- fadds %f0, %f16, %f1
- siam (1 << 2) | 0
- fsubs %f1, %f16, %f1
- siam (0 << 2)
- retl
- fors %f1, SIGN_BIT, %f0
-END (__floorf_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S
deleted file mode 100644
index d2a83cb9b8..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/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/sparc32/sparcv9/fpu/multiarch/s_fma-generic.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-generic.c
new file mode 100644
index 0000000000..e40816facb
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/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/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S
index 2bf5508858..6c27aefca2 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S
@@ -1,5 +1,5 @@
/* fma function, sparc32 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/sparc32/sparcv9/fpu/multiarch/s_fma.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
index 3f2f1622c8..804272ff8e 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
@@ -1,14 +1,10 @@
-#ifdef HAVE_AS_VIS3_SUPPORT
-# include <sparc-ifunc.h>
-# include <math.h>
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <math_ldbl_opt.h>
+#include <libm-alias-double.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>
+libm_alias_double (__fma, fma)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-generic.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-generic.c
new file mode 100644
index 0000000000..218eeb3115
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/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/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S
index 0aca947c25..8aa4b68088 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S
@@ -1,5 +1,5 @@
/* fmaf function, sparc32 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/sparc32/sparcv9/fpu/multiarch/s_fmaf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c
index 7a273a3b13..e82c4a4031 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c
@@ -1,14 +1,9 @@
-#ifdef HAVE_AS_VIS3_SUPPORT
-# include <sparc-ifunc.h>
-# include <math.h>
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <libm-alias-float.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>
+libm_alias_float (__fma, fma)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S
deleted file mode 100644
index e996860485..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(fmax)
-
-weak_alias (__fmax, fmax)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1);
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __fmax __fmax_generic
-
-#include "../s_fmax.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf.S
deleted file mode 100644
index daa91579c4..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/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/sparc32/sparcv9/fpu/multiarch/s_fmin-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin-vis3.S
deleted file mode 100644
index 6d7991cf6e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin-vis3.S
+++ /dev/null
@@ -1,30 +0,0 @@
-/* fmin function, sparc32 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>
-
-ENTRY (__fmin_vis3)
- movwtos %o0, %f0
- movwtos %o1, %f1
- movwtos %o2, %f2
- movwtos %o3, %f3
- flcmpd %fcc1, %f0, %f2
- retl
- fmovdge %fcc1, %f2, %f0
-END (__fmin_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S
deleted file mode 100644
index b7ea51f475..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(fmin)
-
-weak_alias (__fmin, fmin)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmin, fminl, GLIBC_2_1);
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __fmin __fmin_generic
-
-#include "../s_fmin.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf.S
deleted file mode 100644
index c4690e1df9..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/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/sparc32/sparcv9/fpu/multiarch/s_llrint-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-generic.S
new file mode 100644
index 0000000000..1aedc80f4f
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-double.h>
+#define __llrint __llrint_generic
+#undef libm_alias_double
+#define libm_alias_double(a,b)
+#include <sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S
index f070fbcaf3..f3be7b978a 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S
@@ -1,5 +1,5 @@
/* llrint(), sparc32 v9 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/sparc32/sparcv9/fpu/multiarch/s_llrint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S
deleted file mode 100644
index fd23041404..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(llrint)
-
-weak_alias (__llrint, llrint)
-
-strong_alias (__llrint, __lllrint)
-weak_alias (__lllrint, lllrint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef strong_alias
-# define strong_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __llrint __llrint_generic
-
-#include "../s_llrint.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.c
index 37f7f44dfa..599a76c59d 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.c
@@ -1,7 +1,6 @@
-/* Compute positive difference, sparc 32-bit+v9.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* llrint ifunc resolver, Linux/sparc32 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>.
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,24 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#define __llrint __redirect_llrint
+#include <math.h>
+#undef __llrint
+#include <sparc-ifunc.h>
+#include <libm-alias-double.h>
-ENTRY(__fdim)
- std %o0, [%sp + 72]
- std %o2, [%sp + 80]
- ldd [%sp + 72], %f0
- ldd [%sp + 80], %f2
- fcmpd %f0, %f2
- fbug 1f
- nop
- fzero %f0
- fnegd %f0, %f2
-1: retl
- fsubd %f0, %f2, %f0
-END(__fdim)
-weak_alias (__fdim, fdim)
+extern __typeof (__redirect_llrint) __llrint_vis3 attribute_hidden;
+extern __typeof (__redirect_llrint) __llrint_generic attribute_hidden;
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
-#endif
+sparc_libm_ifunc_redirected (__redirect_llrint, __llrint,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __llrint_vis3
+ : __llrint_generic);
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S
new file mode 100644
index 0000000000..af4e752be3
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-float.h>
+#define __llrintf __llrintf_generic
+#undef libm_alias_float
+#define libm_alias_float(a, b)
+#include <sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S
index 0cb2eb3f34..f295a19158 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S
@@ -1,5 +1,5 @@
/* llrintf(), sparc32 v9 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/sparc32/sparcv9/fpu/multiarch/s_llrintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S
deleted file mode 100644
index 8af5244e7e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(llrintf)
-
-weak_alias (__llrintf, llrintf)
-
-strong_alias (__llrintf, __lllrintf)
-weak_alias (__lllrintf, lllrintf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef strong_alias
-# define strong_alias(a, b)
-
-#define __llrintf __llrintf_generic
-
-#include "../s_llrintf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.c
new file mode 100644
index 0000000000..46802c22c8
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.c
@@ -0,0 +1,30 @@
+/* llrintf ifunc resolver, Linux/sparc32 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 (llrintf) __llrintf_vis3 attribute_hidden;
+extern __typeof (llrintf) __llrintf_generic attribute_hidden;
+
+sparc_libm_ifunc (__llrintf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __llrintf_vis3
+ : __llrintf_generic);
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-generic.S
new file mode 100644
index 0000000000..b869bbb6b9
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-double.h>
+#define __nearbyint __nearbyint_generic
+#undef libm_alias_double
+#define libm_alias_double(a, b)
+#include <sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S
index 4475e8c315..1edeb93d2f 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc32 v9 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.
@@ -36,14 +36,15 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyint_vis3)
+ sllx %o0, 32, %o0
+ or %o0, %o1, %o0
+ movxtod %o0, %f0
+ fcmpd %fcc3, %f0, %f0 /* Check for sNaN */
st %fsr, [%sp + 88]
sethi %hi(TWO_FIFTYTWO), %o2
sethi %hi(0xf8003e0), %o5
ld [%sp + 88], %o4
- sllx %o0, 32, %o0
or %o5, %lo(0xf8003e0), %o5
- or %o0, %o1, %o0
- movxtod %o0, %f0
andn %o4, %o5, %o4
fzero ZERO
st %o4, [%sp + 80]
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S
deleted file mode 100644
index 47da9eaafe..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(nearbyint)
-
-weak_alias (__nearbyint, nearbyint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1)
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __nearbyint __nearbyint_generic
-
-#include "../s_nearbyint.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmaxf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.c
index e18553714e..3db79bb975 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmaxf.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.c
@@ -1,7 +1,6 @@
-/* fmaxf function, sparc32 v9 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* nearbyint ifunc resolver, Linux/sparc32 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,24 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#define __nearbyint __redirect_nearbyint
+#include <math.h>
+#undef __nearbyint
+#include <sparc-ifunc.h>
+#include <libm-alias-double.h>
-#define SIGN_BIT %f12 /* -0.0 */
+extern __typeof (__redirect_nearbyint) __nearbyint_vis3 attribute_hidden;
+extern __typeof (__redirect_nearbyint) __nearbyint_generic attribute_hidden;
-ENTRY (__fmaxf)
- st %o0, [%sp + 72]
- st %o1, [%sp + 76]
- ld [%sp + 72], %f1
- ld [%sp + 76], %f3
- 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_nearbyint, __nearbyint,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __nearbyint_vis3
+ : __nearbyint_generic);
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S
new file mode 100644
index 0000000000..302fb94c80
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-float.h>
+#define __nearbyintf __nearbyintf_generic
+#undef libm_alias_float
+#define libm_alias_float(a, b)
+#include <sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S
index e39134b686..8ce15647c5 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc32 v9 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,8 +35,9 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyintf_vis3)
- st %fsr, [%sp + 88]
movwtos %o0, %f1
+ fcmps %fcc3, %f1, %f1 /* Check for sNaN */
+ st %fsr, [%sp + 88]
sethi %hi(TWO_TWENTYTHREE), %o2
sethi %hi(0xf8003e0), %o5
ld [%sp + 88], %o4
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S
deleted file mode 100644
index 95100c1bfc..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/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/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c
new file mode 100644
index 0000000000..f899932a34
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c
@@ -0,0 +1,30 @@
+/* nearbyintf ifunc resolver, Linux/sparc32 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 (nearbyintf) __nearbyintf_vis3 attribute_hidden;
+extern __typeof (nearbyintf) __nearbyintf_generic attribute_hidden;
+
+sparc_libm_ifunc (__nearbyintf,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __nearbyintf_vis3
+ : __nearbyintf_generic);
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-generic.S
new file mode 100644
index 0000000000..b122ba2739
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-double.h>
+#define __rint __rint_generic
+#undef libm_alias_double
+#define libm_alias_double(a, b)
+#include <sysdeps/sparc/sparc32/sparcv9/fpu/s_rint.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S
index 7610f38070..fe70d49f07 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc32 v9 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/sparc32/sparcv9/fpu/multiarch/s_rint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S
deleted file mode 100644
index de893faebf..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(rint)
-
-weak_alias (__rint, rint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0)
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __rint __rint_generic
-
-#include "../s_rint.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c
new file mode 100644
index 0000000000..bba7228355
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c
@@ -0,0 +1,32 @@
+/* rint ifunc resolver, Linux/sparc32 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 __rint __redirect_rint
+#include <math.h>
+#undef __rint
+#include <sparc-ifunc.h>
+#include <libm-alias-double.h>
+
+extern __typeof (__redirect_rint) __rint_vis3 attribute_hidden;
+extern __typeof (__redirect_rint) __rint_generic attribute_hidden;
+
+sparc_libm_ifunc_redirected (__redirect_rint, __rint,
+ hwcap & HWCAP_SPARC_VIS3
+ ? __rint_vis3
+ : __rint_generic);
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-generic.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-generic.S
new file mode 100644
index 0000000000..dce957aa9b
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-generic.S
@@ -0,0 +1,5 @@
+#include <libm-alias-float.h>
+#define __rintf __rintf_generic
+#undef libm_alias_float
+#define libm_alias_float(a, b)
+#include <sysdeps/sparc/sparc32/sparcv9/fpu/s_rintf.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S
index 68b4a17ca7..63b9c67846 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc32 v9 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/sparc32/sparcv9/fpu/multiarch/s_rintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S
deleted file mode 100644
index 38fd936086..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/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/sparc32/sparcv9/fpu/multiarch/s_rintf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.c
new file mode 100644
index 0000000000..74c5e25359
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.c
@@ -0,0 +1,30 @@
+/* rintf ifunc resolver, Linux/sparc32 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/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S
deleted file mode 100644
index 7f212d927e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc32 v9 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>
-#include <math_ldbl_opt.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 %o0, 32, %o0
- or %o0, %o1, %o0
- fzero ZERO
- movxtod %o0, %f0
- sllx %o2, 32, %o2
- 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/sparc32/sparcv9/fpu/multiarch/s_trunc.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S
deleted file mode 100644
index 3787fa1f11..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sparc-ifunc.h>
-#include <math_ldbl_opt.h>
-
-SPARC_ASM_VIS3_IFUNC(trunc)
-
-weak_alias (__trunc, trunc)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
-#endif
-
-# undef weak_alias
-# define weak_alias(a, b)
-# undef compat_symbol
-# define compat_symbol(a, b, c, d)
-
-#define __trunc __trunc_generic
-
-#include "../s_trunc.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S
deleted file mode 100644
index 2acd04dae8..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc32 v9 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)
- movwtos %o0, %f1
- 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/sparc32/sparcv9/fpu/multiarch/s_truncf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S
deleted file mode 100644
index 2ca2517334..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/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/sparc32/sparcv9/fpu/multiarch/w_sqrt-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt-vis3.S
deleted file mode 100644
index 8ccee58ef1..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt-vis3.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* sqrt function. sparc32 v9 vis3 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_vis3)
- movwtos %o0, %f0
- fzero %f8
- movwtos %o1, %f1
- fcmpd %f0, %f8
- fbl 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
- ld [%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 8b
- mov %o0, %o2
- mov %o1, %o3
- mov 26, %o4
- mov %o7, %g1
- call __kernel_standard
- mov %g1, %o7
-END (__sqrt_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt.S
deleted file mode 100644
index 3b070721d2..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(sqrt)
-
-weak_alias (__sqrt, sqrt)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __sqrt __sqrt_generic
-
-#include "../w_sqrt.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf-vis3.S
deleted file mode 100644
index 7b388833b9..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf-vis3.S
+++ /dev/null
@@ -1,47 +0,0 @@
-/* sqrtf function. sparc32 v9 vis3 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_vis3)
- movwtos %o0, %f0
- fzeros %f8
- fcmps %f0, %f8
- fbl 1f
- nop
-8: retl
- fsqrts %f0, %f0
-1:
-#ifdef SHARED
- SETUP_PIC_REG_LEAF(o5, g1)
- sethi %gdop_hix22(_LIB_VERSION), %g1
- xor %g1, %gdop_lox10(_LIB_VERSION), %g1
- ld [%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 8b
- mov %o0, %o1
- mov 126, %o2
- mov %o7, %g1
- call __kernel_standard_f
- mov %g1, %o7
-END (__sqrtf_vis3)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf.S
deleted file mode 100644
index 777a04058c..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf.S
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sparc-ifunc.h>
-
-SPARC_ASM_VIS3_IFUNC(sqrtf)
-
-weak_alias (__sqrtf, sqrtf)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-#define __sqrtf __sqrtf_generic
-
-#include "../w_sqrtf.S"
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceil.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceil.S
deleted file mode 100644
index 0c477eeeb7..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceil.S
+++ /dev/null
@@ -1,92 +0,0 @@
-/* ceil function, sparc32 v9 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>
-#include <math_ldbl_opt.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
- sllx %o0, 32, %o0
- sethi %hi(ONE_DOT_ZERO), %o3
- or %o0, %o1, %o0
- stx %o0, [%sp + 72]
- sllx %o2, 32, %o2
- fzero ZERO
- sllx %o3, 32, %o3
-
- ldd [%sp + 72], %f0
- fnegd ZERO, SIGN_BIT
-
- stx %o2, [%sp + 72]
- fabsd %f0, %f14
-
- ldd [%sp + 72], %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 + 72]
-
- ldd [%sp + 72], %f20
- fmovduge %fcc2, ZERO, %f20
- faddd %f18, %f20, %f0
- fabsd %f0, %f0
- retl
- for %f0, SIGN_BIT, %f0
-END (__ceil)
-weak_alias (__ceil, ceil)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0)
-#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceilf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceilf.S
deleted file mode 100644
index 08612617cb..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceilf.S
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Float ceil function, sparc32 v9 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)
- st %o0, [%sp + 68]
- sethi %hi(TWO_TWENTYTHREE), %o2
- sethi %hi(ONE_DOT_ZERO), %o3
- fzeros ZERO
-
- ld [%sp + 68], %f0
- fnegs ZERO, SIGN_BIT
-
- st %o2, [%sp + 68]
- fabss %f0, %f14
-
- ld [%sp + 68], %f16
- fcmps %fcc3, %f14, %f16
-
- fmovsuge %fcc3, ZERO, %f16
- fands %f0, SIGN_BIT, SIGN_BIT
-
- fors %f16, SIGN_BIT, %f16
- fadds %f0, %f16, %f1
- fsubs %f1, %f16, %f1
- fcmps %fcc2, %f1, %f0
- st %o3, [%sp + 68]
-
- ld [%sp + 68], %f9
- fmovsuge %fcc2, ZERO, %f9
- fadds %f1, %f9, %f0
- fabss %f0, %f0
- retl
- fors %f0, SIGN_BIT, %f0
-END (__ceilf)
-weak_alias (__ceilf, ceilf)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S
index e1d02b8dfe..bdc453da0d 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S
@@ -1,5 +1,5 @@
/* Float absolute value, sparc32+v9 version.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,8 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
ENTRY (__fabs)
st %o0, [%sp+72]
@@ -25,4 +27,4 @@ ENTRY (__fabs)
retl
fabsd %f0, %f0
END (__fabs)
-weak_alias (__fabs, fabs)
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S
deleted file mode 100644
index 9e0e3f21be..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Compute positive difference, sparc 32-bit+v9.
- 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)
- st %o0, [%sp + 72]
- st %o1, [%sp + 76]
- ld [%sp + 72], %f0
- ld [%sp + 76], %f1
- fcmps %f0, %f1
- fbug 1f
- nop
- fzeros %f0
- fnegs %f0, %f1
-1: retl
- fsubs %f0, %f1, %f0
-END(__fdimf)
-weak_alias (__fdimf, fdimf)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_floor.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_floor.S
deleted file mode 100644
index c59f864d0e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_floor.S
+++ /dev/null
@@ -1,92 +0,0 @@
-/* floor function, sparc32 v9 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>
-#include <math_ldbl_opt.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
- sllx %o0, 32, %o0
- sethi %hi(ONE_DOT_ZERO), %o3
- or %o0, %o1, %o0
- stx %o0, [%sp + 72]
- sllx %o2, 32, %o2
- fzero ZERO
- sllx %o3, 32, %o3
-
- ldd [%sp + 72], %f0
- fnegd ZERO, SIGN_BIT
-
- stx %o2, [%sp + 72]
- fabsd %f0, %f14
-
- ldd [%sp + 72], %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 + 72]
-
- ldd [%sp + 72], %f20
- fmovdule %fcc2, ZERO, %f20
- fsubd %f18, %f20, %f0
- fabsd %f0, %f0
- retl
- for %f0, SIGN_BIT, %f0
-END (__floor)
-weak_alias (__floor, floor)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0)
-#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_floorf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_floorf.S
deleted file mode 100644
index 64b1042940..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_floorf.S
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Float floor function, sparc32 v9 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)
- st %o0, [%sp + 68]
- sethi %hi(TWO_TWENTYTHREE), %o2
- sethi %hi(ONE_DOT_ZERO), %o3
- fzeros ZERO
-
- ld [%sp + 68], %f0
- fnegs ZERO, SIGN_BIT
-
- st %o2, [%sp + 68]
- fabss %f0, %f14
-
- ld [%sp + 68], %f16
- fcmps %fcc3, %f14, %f16
-
- fmovsuge %fcc3, ZERO, %f16
- fands %f0, SIGN_BIT, SIGN_BIT
-
- fors %f16, SIGN_BIT, %f16
- fadds %f0, %f16, %f1
- fsubs %f1, %f16, %f1
- fcmps %fcc2, %f1, %f0
- st %o3, [%sp + 68]
-
- ld [%sp + 68], %f9
- fmovsule %fcc2, ZERO, %f9
- fsubs %f1, %f9, %f0
- fabss %f0, %f0
- retl
- fors %f0, SIGN_BIT, %f0
-END (__floorf)
-weak_alias (__floorf, floorf)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmax.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmax.S
deleted file mode 100644
index 37b664c602..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmax.S
+++ /dev/null
@@ -1,45 +0,0 @@
-/* fmax function, sparc32 v9 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>
-#include <math_ldbl_opt.h>
-
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__fmax)
- std %o0, [%sp + 72]
- std %o2, [%sp + 80]
- ldd [%sp + 72], %f0
- ldd [%sp + 80], %f2
- 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)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fminf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_fminf.S
deleted file mode 100644
index 5343583a57..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fminf.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/* fminf function, sparc32 v9 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>
-
-#define SIGN_BIT %f12 /* -0.0 */
-
-ENTRY (__fminf)
- st %o0, [%sp + 72]
- st %o1, [%sp + 76]
- ld [%sp + 72], %f1
- ld [%sp + 76], %f3
- 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)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S
index 4e4362cac5..29ae8c6a29 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S
@@ -1,5 +1,5 @@
/* isnan(). sparc32 v9 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/sparc32/sparcv9/fpu/s_llrint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S
index e1fe6245d2..8e645eaaec 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S
@@ -1,5 +1,5 @@
/* llrint(), sparc32 v9 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.
@@ -19,6 +19,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -65,8 +66,4 @@ ENTRY (__llrint)
retl
ldd [%sp + 72], %o0
END (__llrint)
-weak_alias (__llrint, llrint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-#endif
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S
index 36a95d4bcf..501a09c8b2 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S
@@ -1,5 +1,5 @@
/* llrintf(), sparc32 v9 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
@@ -59,4 +60,4 @@ ENTRY (__llrintf)
retl
ldd [%sp + 72], %o0
END (__llrintf)
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S
deleted file mode 100644
index fb653037ea..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S
+++ /dev/null
@@ -1,72 +0,0 @@
-/* lrint(), sparc32 v9 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>
-#include <math_ldbl_opt.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 (__lrint)
- sethi %hi(TWO_FIFTYTWO), %o2
- sllx %o0, 32, %o0
-
- or %o0, %o1, %o0
- fzero ZERO
-
- stx %o0, [%sp + 72]
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
-
- ldd [%sp + 72], %f0
-
- stx %o2, [%sp + 72]
- fabsd %f0, %f14
-
- ldd [%sp + 72], %f16
- fcmpd %fcc3, %f14, %f16
-
- fmovduge %fcc3, ZERO, %f16
- fand %f0, SIGN_BIT, SIGN_BIT
-
- for %f16, SIGN_BIT, %f16
- faddd %f0, %f16, %f6
- fsubd %f6, %f16, %f0
- fabsd %f0, %f0
- for %f0, SIGN_BIT, %f0
- fdtoi %f0, %f3
- st %f3, [%sp + 72]
- retl
- ld [%sp + 72], %o0
-END (__lrint)
-weak_alias (__lrint, lrint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S
index 54085f1cde..dbd6c9347e 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S
@@ -1,5 +1,5 @@
/* lrintf(), sparc32 v9 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
@@ -59,4 +60,4 @@ ENTRY (__lrintf)
retl
ld [%sp + 68], %o0
END (__lrintf)
-weak_alias (__lrintf, lrintf)
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S
index 29b56b471c..88f410ec52 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc32 v9 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2013.
@@ -21,6 +21,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -36,20 +37,21 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyint)
+ sllx %o0, 32, %o0
+ or %o0, %o1, %o0
+ stx %o0, [%sp + 72]
+ ldd [%sp + 72], %f0
+ fcmpd %fcc3, %f0, %f0 /* Check for sNaN */
st %fsr, [%sp + 88]
sethi %hi(TWO_FIFTYTWO), %o2
sethi %hi(0xf8003e0), %o5
ld [%sp + 88], %o4
- sllx %o0, 32, %o0
or %o5, %lo(0xf8003e0), %o5
- or %o0, %o1, %o0
andn %o4, %o5, %o4
fzero ZERO
st %o4, [%sp + 80]
- stx %o0, [%sp + 72]
sllx %o2, 32, %o2
fnegd ZERO, SIGN_BIT
- ldd [%sp + 72], %f0
ld [%sp + 80], %fsr
stx %o2, [%sp + 72]
fabsd %f0, %f14
@@ -65,8 +67,4 @@ ENTRY (__nearbyint)
retl
ld [%sp + 88], %fsr
END (__nearbyint)
-weak_alias (__nearbyint, nearbyint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1)
-#endif
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S
index e2188b20a4..00af8a8889 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S
@@ -1,7 +1,7 @@
/* Round float to int floating-point values without generating
an inexact exception, sparc32 v9 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2013.
@@ -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,8 +36,10 @@
#define SIGN_BIT %f12 /* -0.0 */
ENTRY (__nearbyintf)
- st %fsr, [%sp + 88]
st %o0, [%sp + 68]
+ ld [%sp + 68], %f1
+ fcmps %fcc3, %f1, %f1 /* Check for sNaN */
+ st %fsr, [%sp + 88]
sethi %hi(TWO_TWENTYTHREE), %o2
sethi %hi(0xf8003e0), %o5
ld [%sp + 88], %o4
@@ -45,7 +48,6 @@ ENTRY (__nearbyintf)
fnegs ZERO, SIGN_BIT
andn %o4, %o5, %o4
st %o4, [%sp + 80]
- ld [%sp + 68], %f1
ld [%sp + 80], %fsr
st %o2, [%sp + 68]
fabss %f1, %f14
@@ -61,4 +63,4 @@ ENTRY (__nearbyintf)
retl
ld [%sp + 88], %fsr
END (__nearbyintf)
-weak_alias (__nearbyintf, nearbyintf)
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_rint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_rint.S
index e44bd7edb5..c65f0c1f59 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_rint.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_rint.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc32 v9 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.
@@ -19,6 +19,7 @@
#include <sysdep.h>
#include <math_ldbl_opt.h>
+#include <libm-alias-double.h>
/* We pop constants into the FPU registers using the incoming
argument stack slots, since this avoid having to use any PIC
@@ -62,8 +63,4 @@ ENTRY (__rint)
retl
for %f0, SIGN_BIT, %f0
END (__rint)
-weak_alias (__rint, rint)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0)
-#endif
+libm_alias_double (__rint, rint)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_rintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_rintf.S
index bbf9f7b32a..df8bc450a1 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_rintf.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_rintf.S
@@ -1,5 +1,5 @@
/* Round float to int floating-point values, sparc32 v9 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,4 +57,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/sparc32/sparcv9/fpu/s_trunc.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S
deleted file mode 100644
index 6f2ed8a515..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc32 v9 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>
-#include <math_ldbl_opt.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 %o0, 32, %o0
- or %o0, %o1, %o0
- fzero ZERO
- stx %o0, [%sp + 72]
- sllx %o2, 32, %o2
- fnegd ZERO, SIGN_BIT
- ldd [%sp + 72], %f0
- stx %o2, [%sp + 72]
- fabsd %f0, %f14
- ldd [%sp + 72], %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)
-
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
-#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S
deleted file mode 100644
index eab9cfd0db..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Truncate argument to nearest integral value not larger than
- the argument, sparc32 v9 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)
- st %o0, [%sp + 68]
- sethi %hi(TWO_TWENTYTHREE), %o2
- fzeros ZERO
- ld [%sp + 68], %f1
- fnegs ZERO, SIGN_BIT
- st %o2, [%sp + 68]
- fabss %f1, %f14
- ld [%sp + 68], %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/sparc32/sparcv9/fpu/w_sqrt.S b/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt.S
deleted file mode 100644
index 55e29a2958..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt.S
+++ /dev/null
@@ -1,51 +0,0 @@
-/* sqrt function. sparc32 v9 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)
- std %o0, [%sp + 80]
- fzero %f8
- ldd [%sp + 80], %f0
- fcmpd %f0, %f8
- fbl 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
- ld [%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 8b
- mov %o0, %o2
- mov %o1, %o3
- mov 26, %o4
- mov %o7, %g1
- call __kernel_standard
- mov %g1, %o7
-END (__sqrt)
-
-weak_alias (__sqrt, sqrt)
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf.S
deleted file mode 100644
index 9e4f29434e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf.S
+++ /dev/null
@@ -1,50 +0,0 @@
-/* sqrtf function. sparc32 v9 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)
- st %o0, [%sp + 72]
- fzeros %f8
- ld [%sp + 72], %f0
- fcmps %f0, %f8
- fbl 1f
- nop
-8: retl
- fsqrts %f0, %f0
-1:
-#ifdef SHARED
- SETUP_PIC_REG_LEAF(o5, g1)
- sethi %gdop_hix22(_LIB_VERSION), %g1
- xor %g1, %gdop_lox10(_LIB_VERSION), %g1
- ld [%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 8b
- mov %o0, %o1
- mov 126, %o2
- mov %o7, %g1
- call __kernel_standard_f
- mov %g1, %o7
-END (__sqrtf)
-
-weak_alias (__sqrtf, sqrtf)
diff --git a/sysdeps/sparc/sparc32/sparcv9/hp-timing.h b/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
index 8ff96fe614..42451966f6 100644
--- a/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
+++ b/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
@@ -1,5 +1,5 @@
/* High precision, low overhead timing functions. sparcv9 version.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@redhat.com>, 2001.
diff --git a/sysdeps/sparc/sparc32/sparcv9/memmove.S b/sysdeps/sparc/sparc32/sparcv9/memmove.S
new file mode 100644
index 0000000000..39adeb2f99
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/memmove.S
@@ -0,0 +1,2 @@
+#define XCC icc
+#include <sparc64/memmove.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/mul_1.S b/sysdeps/sparc/sparc32/sparcv9/mul_1.S
index 37c8540edf..8bfe3318c8 100644
--- a/sysdeps/sparc/sparc32/sparcv9/mul_1.S
+++ b/sysdeps/sparc/sparc32/sparcv9/mul_1.S
@@ -1,7 +1,7 @@
! SPARC v9 32-bit __mpn_mul_1 -- Multiply a limb vector with a single
! limb and store the product in a second limb vector.
!
-! 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>
!
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
index 4ad7aff914..a6d08f3a00 100644
--- a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
@@ -8,5 +8,7 @@ endif
ifeq ($(subdir),string)
sysdep_routines += memcpy-ultra3 memcpy-niagara1 memcpy-niagara2 \
- memset-niagara1 memcpy-niagara4 memset-niagara4
+ memset-niagara1 memcpy-niagara4 memset-niagara4 \
+ memcpy-ultra1 memset-ultra1 memcpy-memmove-niagara7 \
+ memmove-ultra1 memset-niagara7
endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c
new file mode 100644
index 0000000000..cf6803ef44
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/multiarch/bzero.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-memmove-niagara7.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-memmove-niagara7.S
new file mode 100644
index 0000000000..16da150717
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-memmove-niagara7.S
@@ -0,0 +1,2 @@
+#define XCC icc
+#include <sparc64/multiarch/memcpy-memmove-niagara7.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S
new file mode 100644
index 0000000000..65604eb3a8
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S
@@ -0,0 +1,33 @@
+/* Default SPARC32 memcpy implementation.
+ 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/>. */
+
+#if IS_IN (libc)
+# include <sysdep.h>
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+# undef weak_alias
+# define weak_alias(x, y)
+# undef libc_hidden_def
+# define libc_hidden_def(name)
+
+# define memcpy __memcpy_ultra1
+# define __memcpy_large __memcpy_large_ultra1
+# define __mempcpy __mempcpy_ultra1
+# include <sysdeps/sparc/sparc32/sparcv9/memcpy.S>
+#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S
deleted file mode 100644
index 14df91e005..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#define ASI_PNF 0x82
-#define ASI_BLK_P 0xf0
-#define XCC icc
-#include <sparc64/multiarch/memcpy.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c
new file mode 100644
index 0000000000..369acac087
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/multiarch/memcpy.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memmove-ultra1.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memmove-ultra1.S
new file mode 100644
index 0000000000..35ba76beff
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memmove-ultra1.S
@@ -0,0 +1,4 @@
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+#define memmove __memmove_ultra1
+#include <sysdeps/sparc/sparc32/sparcv9/memmove.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c
new file mode 100644
index 0000000000..616a538cb4
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/multiarch/mempcpy.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-niagara7.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-niagara7.S
new file mode 100644
index 0000000000..de91aa4d5a
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-niagara7.S
@@ -0,0 +1,2 @@
+#define XCC icc
+#include <sparc64/multiarch/memset-niagara7.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S
index 3ee159b306..dd8343478a 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf-vis3.S
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S
@@ -1,7 +1,6 @@
-/* fmaxf function, sparc32 vis3 version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Default SPARC memset implementation.
+ 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,12 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#if IS_IN (libc)
+# include <sysdep.h>
-ENTRY (__fmaxf_vis3)
- movwtos %o0, %f0
- movwtos %o1, %f1
- flcmps %fcc1, %f0, %f1
- retl
- fmovslg %fcc1, %f1, %f0
-END (__fmaxf_vis3)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+# undef weak_alias
+# define weak_alias(x, y)
+
+# define memset __memset_ultra1
+# define __bzero __bzero_ultra1
+# include <sysdeps/sparc/sparc32/sparcv9/memset.S>
+#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S
deleted file mode 100644
index 8f8264337d..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#define ASI_PNF 0x82
-#define ASI_BLK_P 0xf0
-#define XCC icc
-#include <sparc64/multiarch/memset.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c
new file mode 100644
index 0000000000..a6c57342fa
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/multiarch/memset.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memmove.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memmove.c
new file mode 100644
index 0000000000..2c880612f3
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memmove.c
@@ -0,0 +1 @@
+#include <sparc64/multiarch/rtld-memmove.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/rtld-memmove.c b/sysdeps/sparc/sparc32/sparcv9/rtld-memmove.c
new file mode 100644
index 0000000000..a2fe190bf3
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/rtld-memmove.c
@@ -0,0 +1 @@
+#include <sparc64/rtld-memmove.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/sem_init.c b/sysdeps/sparc/sparc32/sparcv9/sem_init.c
deleted file mode 100644
index c90d1b599a..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/sem_init.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <nptl/sem_init.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/sem_open.c b/sysdeps/sparc/sparc32/sparcv9/sem_open.c
deleted file mode 100644
index bff2d2db6a..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/sem_open.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <nptl/sem_open.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/sem_wait.c b/sysdeps/sparc/sparc32/sparcv9/sem_wait.c
deleted file mode 100644
index bccdaed92e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/sem_wait.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <nptl/sem_wait.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/submul_1.S b/sysdeps/sparc/sparc32/sparcv9/submul_1.S
index 3dc864b706..7df0a08054 100644
--- a/sysdeps/sparc/sparc32/sparcv9/submul_1.S
+++ b/sysdeps/sparc/sparc32/sparcv9/submul_1.S
@@ -1,7 +1,7 @@
! SPARC v9 32-bit __mpn_submul_1 -- Multiply a limb vector with a limb
! and subtract the result from a second limb vector.
!
-! 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>
!
diff --git a/sysdeps/sparc/sparc32/sparcv9/udiv.S b/sysdeps/sparc/sparc32/sparcv9/udiv.S
index de79899756..368f85ede2 100644
--- a/sysdeps/sparc/sparc32/sparcv9/udiv.S
+++ b/sysdeps/sparc/sparc32/sparcv9/udiv.S
@@ -15,3 +15,4 @@ ENTRY(.udiv)
udiv %o0, %o1, %o0
END(.udiv)
+strong_alias (.udiv, __wrap_.udiv)