aboutsummaryrefslogtreecommitdiff
path: root/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch
diff options
context:
space:
mode:
Diffstat (limited to 'REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch')
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/Makefile22
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c23
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c32
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c23
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c32
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S28
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S15
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S28
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S15
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c23
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c32
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c23
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c32
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S25
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c14
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S25
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c14
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S31
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S15
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S30
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S15
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S30
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S15
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S29
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S15
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S52
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S17
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S51
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S17
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S62
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S12
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S61
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S12
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S50
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S12
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S49
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S12
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S25
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S20
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S25
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S10
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c23
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c32
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c23
-rw-r--r--REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c32
45 files changed, 1183 insertions, 0 deletions
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/Makefile b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
new file mode 100644
index 0000000000..03a271dfa4
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
@@ -0,0 +1,22 @@
+ifeq ($(subdir),math)
+ifeq ($(have-as-vis3),yes)
+libm-sysdep_routines += m_signbitf-vis3 m_signbit-vis3 m_finitef-vis3 \
+ m_finite-vis3 m_isinff-vis3 m_isinf-vis3 \
+ m_isnanf-vis3 m_isnan-vis3 s_lrintf-vis3 \
+ s_lrint-vis3 s_rintf-vis3 s_rint-vis3 \
+ s_fmaf-vis3 s_fma-vis3 \
+ s_nearbyint-vis3 s_nearbyintf-vis3 \
+ s_ceilf-vis3 s_ceil-vis3 s_floorf-vis3 \
+ s_floor-vis3 s_truncf-vis3 s_trunc-vis3
+sysdep_routines += s_signbitf-vis3 s_signbit-vis3 s_finitef-vis3 \
+ s_finite-vis3 s_isinff-vis3 s_isinf-vis3 \
+ s_isnanf-vis3 s_isnan-vis3
+
+CFLAGS-s_ceilf-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_ceil-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_floorf-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_floor-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_truncf-vis3.c += -Wa,-Av9d -mvis3
+CFLAGS-s_trunc-vis3.c += -Wa,-Av9d -mvis3
+endif
+endif
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c
new file mode 100644
index 0000000000..fa9c5d33ea
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c
@@ -0,0 +1,23 @@
+/* ceil function, sparc64 vis3 version.
+ Copyright (C) 2016-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+#define __ceil __ceil_vis3
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c>
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c
new file mode 100644
index 0000000000..efa05e94df
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c
@@ -0,0 +1,32 @@
+/* ceil function, sparc64 version.
+ Copyright (C) 2016-2017 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/>. */
+
+#ifdef HAVE_AS_VIS3_SUPPORT
+# include <sparc-ifunc.h>
+# include <math.h>
+
+extern double __ceil_vis3 (double);
+extern double __ceil_generic (double);
+
+sparc_libm_ifunc(__ceil, hwcap & HWCAP_SPARC_VIS3 ? __ceil_vis3 : __ceil_generic);
+weak_alias (__ceil, ceil)
+
+# define __ceil __ceil_generic
+#endif
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c>
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c
new file mode 100644
index 0000000000..1d918de7af
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c
@@ -0,0 +1,23 @@
+/* Float ceil function, sparc64 vis3 version.
+ Copyright (C) 2016-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+#define __ceilf __ceilf_vis3
+
+#include <sysdeps/ieee754/flt-32/s_ceilf.c>
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c
new file mode 100644
index 0000000000..62ada7fd2a
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c
@@ -0,0 +1,32 @@
+/* Float ceil function, sparc64 version.
+ Copyright (C) 2016-2017 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/>. */
+
+#ifdef HAVE_AS_VIS3_SUPPORT
+# include <sparc-ifunc.h>
+# include <math.h>
+
+extern float __ceilf_vis3 (float);
+extern float __ceilf_generic (float);
+
+sparc_libm_ifunc(__ceilf, hwcap & HWCAP_SPARC_VIS3 ? __ceilf_vis3 : __ceilf_generic);
+weak_alias (__ceilf, ceilf)
+
+# define __ceilf __ceilf_generic
+#endif
+
+#include <sysdeps/ieee754/flt-32/s_ceilf.c>
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S
new file mode 100644
index 0000000000..0e2b5f6b00
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S
@@ -0,0 +1,28 @@
+/* finite(). sparc64 vis3 version.
+ Copyright (C) 2012-2017 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 (__finite_vis3)
+ fabsd %f0, %f0
+ movstouw %f0, %o0
+ sethi %hi(0x7ff00000), %o2
+ sub %o0, %o2, %o0
+ retl
+ srl %o0, 31, %o0
+END (__finite_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S
new file mode 100644
index 0000000000..78406a62b1
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S
@@ -0,0 +1,15 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(finite)
+
+hidden_def (__finite)
+weak_alias (__finite, finite)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef hidden_def
+# define hidden_def(a)
+
+#define __finite __finite_generic
+
+#include "../s_finite.S"
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S
new file mode 100644
index 0000000000..59e17bc75c
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S
@@ -0,0 +1,28 @@
+/* finitef(). sparc64 vis3 version.
+ Copyright (C) 2012-2017 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 (__finitef_vis3)
+ fabss %f1, %f0
+ movstouw %f0, %o0
+ sethi %hi(0x7f800000), %o2
+ sub %o0, %o2, %o0
+ retl
+ srl %o0, 31, %o0
+END (__finitef_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S
new file mode 100644
index 0000000000..cafd41fd92
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S
@@ -0,0 +1,15 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(finitef)
+
+hidden_def (__finitef)
+weak_alias (__finitef, finitef)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef hidden_def
+# define hidden_def(a)
+
+#define __finitef __finitef_generic
+
+#include "../s_finitef.S"
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c
new file mode 100644
index 0000000000..04f6183664
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c
@@ -0,0 +1,23 @@
+/* floor function, sparc64 vis3 version.
+ Copyright (C) 2016-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+#define __floor __floor_vis3
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c>
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c
new file mode 100644
index 0000000000..d097f68866
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c
@@ -0,0 +1,32 @@
+/* floor function, sparc64 version.
+ Copyright (C) 2016-2017 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/>. */
+
+#ifdef HAVE_AS_VIS3_SUPPORT
+# include <sparc-ifunc.h>
+# include <math.h>
+
+extern double __floor_vis3 (double);
+extern double __floor_generic (double);
+
+sparc_libm_ifunc(__floor, hwcap & HWCAP_SPARC_VIS3 ? __floor_vis3 : __floor_generic);
+weak_alias (__floor, floor)
+
+# define __floor __floor_generic
+#endif
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c>
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c
new file mode 100644
index 0000000000..0ff49e6802
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c
@@ -0,0 +1,23 @@
+/* Float floor function, sparc64 vis3 version.
+ Copyright (C) 2016-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+#define __floorf __floorf_vis3
+
+#include <sysdeps/ieee754/flt-32/s_floorf.c>
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c
new file mode 100644
index 0000000000..2a6c710349
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c
@@ -0,0 +1,32 @@
+/* Float floor function, sparc64 version.
+ Copyright (C) 2016-2017 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/>. */
+
+#ifdef HAVE_AS_VIS3_SUPPORT
+# include <sparc-ifunc.h>
+# include <math.h>
+
+extern float __floorf_vis3 (float);
+extern float __floorf_generic (float);
+
+sparc_libm_ifunc(__floorf, hwcap & HWCAP_SPARC_VIS3 ? __floorf_vis3 : __floorf_generic);
+weak_alias (__floorf, floorf)
+
+# define __floorf __floorf_generic
+#endif
+
+#include <sysdeps/ieee754/flt-32/s_floorf.c>
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S
new file mode 100644
index 0000000000..343ce37de9
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S
@@ -0,0 +1,25 @@
+/* fma function, sparc64 vis3 version.
+ Copyright (C) 2012-2017 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 (__fma_vis3)
+ retl
+ fmaddd %f0, %f2, %f4, %f0
+END (__fma_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c
new file mode 100644
index 0000000000..3f2f1622c8
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c
@@ -0,0 +1,14 @@
+#ifdef HAVE_AS_VIS3_SUPPORT
+# include <sparc-ifunc.h>
+# include <math.h>
+
+extern double __fma_vis3 (double, double, double);
+extern double __fma_generic (double, double, double);
+
+sparc_libm_ifunc(__fma, hwcap & HWCAP_SPARC_FMAF ? __fma_vis3 : __fma_generic);
+weak_alias (__fma, fma)
+
+# define __fma __fma_generic
+#endif
+
+#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S
new file mode 100644
index 0000000000..c2fa72a211
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S
@@ -0,0 +1,25 @@
+/* fmaf function, sparc64 vis3 version.
+ Copyright (C) 2012-2017 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 (__fmaf_vis3)
+ retl
+ fmadds %f1, %f3, %f5, %f0
+END (__fmaf_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c
new file mode 100644
index 0000000000..7a273a3b13
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c
@@ -0,0 +1,14 @@
+#ifdef HAVE_AS_VIS3_SUPPORT
+# include <sparc-ifunc.h>
+# include <math.h>
+
+extern float __fmaf_vis3 (float, float, float);
+extern float __fmaf_generic (float, float, float);
+
+sparc_libm_ifunc(__fmaf, hwcap & HWCAP_SPARC_FMAF ? __fmaf_vis3 : __fmaf_generic);
+weak_alias (__fmaf, fmaf)
+
+# define __fmaf __fmaf_generic
+#endif
+
+#include <sysdeps/ieee754/dbl-64/s_fmaf.c>
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S
new file mode 100644
index 0000000000..54ff556eb8
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S
@@ -0,0 +1,31 @@
+/* isinf(). sparc64 vis3 version.
+ Copyright (C) 2012-2017 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 (__isinf_vis3)
+ movdtox %f0, %g1
+ sethi %hi(0x7ff00000), %o2
+ sllx %o2, 32, %o2
+ sllx %g1, 1, %o4
+ srlx %o4, 1, %o5
+ srax %g1, 62, %o0
+ xor %o5, %o2, %o3
+ retl
+ movrne %o3, %g0, %o0
+END (__isinf_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S
new file mode 100644
index 0000000000..ed9b62640d
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S
@@ -0,0 +1,15 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(isinf)
+
+hidden_def (__isinf)
+weak_alias (__isinf, isinf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef hidden_def
+# define hidden_def(a)
+
+#define __isinf __isinf_generic
+
+#include "../s_isinf.S"
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S
new file mode 100644
index 0000000000..853bfc64e4
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S
@@ -0,0 +1,30 @@
+/* isinff(). sparc64 vis3 version.
+ Copyright (C) 2012-2017 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 (__isinff_vis3)
+ movstouw %f1, %g1
+ sethi %hi(0x7f800000), %o2
+ sll %g1, 1, %o4
+ srl %o4, 1, %o5
+ sra %g1, 30, %o0
+ xor %o5, %o2, %o3
+ retl
+ movrne %o3, %g0, %o0
+END (__isinff_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S
new file mode 100644
index 0000000000..04517398f8
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S
@@ -0,0 +1,15 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(isinff)
+
+hidden_def (__isinff)
+weak_alias (__isinff, isinff)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef hidden_def
+# define hidden_def(a)
+
+#define __isinff __isinff_generic
+
+#include "../s_isinff.S"
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S
new file mode 100644
index 0000000000..6dbb8dee2c
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S
@@ -0,0 +1,30 @@
+/* isnan(). sparc64 vis3 version.
+ Copyright (C) 2012-2017 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 (__isnan_vis3)
+ movdtox %f0, %o0
+ sethi %hi(0x7ff00000), %g1
+ sllx %g1, 32, %g1
+ sllx %o0, 1, %o0
+ srlx %o0, 1, %o0
+ sub %g1, %o0, %o0
+ retl
+ srlx %o0, 63, %o0
+END (__isnan_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S
new file mode 100644
index 0000000000..40e985a5d4
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S
@@ -0,0 +1,15 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(isnan)
+
+hidden_def (__isnan)
+weak_alias (__isnan, isnan)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef hidden_def
+# define hidden_def(a)
+
+#define __isnan __isnan_generic
+
+#include "../s_isnan.S"
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S
new file mode 100644
index 0000000000..46fbf6de9f
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S
@@ -0,0 +1,29 @@
+/* isnanf(). sparc64 vis3 version.
+ Copyright (C) 2012-2017 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 (__isnanf_vis3)
+ movstouw %f1, %o0
+ sethi %hi(0x7f800000), %g1
+ sll %o0, 1, %o0
+ srl %o0, 1, %o0
+ sub %g1, %o0, %o0
+ retl
+ srl %o0, 31, %o0
+END (__isnanf_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S
new file mode 100644
index 0000000000..6b53b69d2e
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S
@@ -0,0 +1,15 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(isnanf)
+
+hidden_def (__isnanf)
+weak_alias (__isnanf, isnanf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef hidden_def
+# define hidden_def(a)
+
+#define __isnanf __isnanf_generic
+
+#include "../s_isnanf.S"
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S
new file mode 100644
index 0000000000..87895371dd
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S
@@ -0,0 +1,52 @@
+/* lrint(), sparc64 vis3 version.
+ Copyright (C) 2012-2017 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>
+
+ /* 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_vis3)
+ sethi %hi(TWO_FIFTYTWO), %o2
+ sllx %o2, 32, %o2
+ fzero ZERO
+
+ fnegd ZERO, SIGN_BIT
+ movxtod %o2, %f16
+ fabsd %f0, %f14
+
+ fcmpd %fcc3, %f14, %f16
+
+ fmovduge %fcc3, ZERO, %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
+ fdtox %f0, %f4
+ retl
+ movdtox %f4, %o0
+END (__lrint_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S
new file mode 100644
index 0000000000..94af8f028c
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S
@@ -0,0 +1,17 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(lrint)
+
+weak_alias (__lrint, lrint)
+
+strong_alias (__lrint, __llrint)
+weak_alias (__llrint, llrint)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef strong_alias
+# define strong_alias(a, b)
+
+#define __lrint __lrint_generic
+
+#include "../s_lrint.S"
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S
new file mode 100644
index 0000000000..3ef005d433
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S
@@ -0,0 +1,51 @@
+/* lrintf(), sparc64 vis3 version.
+ Copyright (C) 2012-2017 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>
+
+ /* 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 (__lrintf_vis3)
+ sethi %hi(TWO_TWENTYTHREE), %o2
+ fzeros ZERO
+
+ fnegs ZERO, SIGN_BIT
+ movwtos %o2, %f16
+ fabss %f1, %f14
+
+ fcmps %fcc3, %f14, %f16
+
+ fmovsuge %fcc3, ZERO, %f16
+ fands %f1, SIGN_BIT, SIGN_BIT
+
+ fors %f16, SIGN_BIT, %f16
+ fadds %f1, %f16, %f5
+ fsubs %f5, %f16, %f0
+ fabss %f0, %f0
+ fors %f0, SIGN_BIT, %f0
+ fstox %f0, %f4
+ retl
+ movdtox %f4, %o0
+END (__lrintf_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S
new file mode 100644
index 0000000000..e6ea4061c3
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S
@@ -0,0 +1,17 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(lrintf)
+
+weak_alias (__lrintf, lrintf)
+
+strong_alias (__lrintf, __llrintf)
+weak_alias (__llrintf, llrintf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef strong_alias
+# define strong_alias(a, b)
+
+#define __lrintf __lrintf_generic
+
+#include "../s_lrintf.S"
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S
new file mode 100644
index 0000000000..67e570a800
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S
@@ -0,0 +1,62 @@
+/* Round float to int floating-point values without generating
+ an inexact exception, sparc64 vis3 version.
+
+ Copyright (C) 2013-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2013.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* We pop constants into the FPU registers using the incoming
+ argument stack slots, since this avoid having to use any PIC
+ references. We also thus avoid having to allocate a register
+ window.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__nearbyint_vis3)
+ fcmpd %fcc3, %f0, %f0 /* Check for sNaN */
+ stx %fsr, [%sp + STACK_BIAS + 144]
+ sethi %hi(TWO_FIFTYTWO), %o2
+ sllx %o2, 32, %o2
+ ldx [%sp + STACK_BIAS + 144], %o4
+ sethi %hi(0xf8003e0), %o5
+ fzero ZERO
+ or %o5, %lo(0xf8003e0), %o5
+ fnegd ZERO, SIGN_BIT
+ andn %o4, %o5, %o4
+ movxtod %o2, %f16
+ stx %o4, [%sp + STACK_BIAS + 136]
+ ldx [%sp + STACK_BIAS + 136], %fsr
+ fabsd %f0, %f14
+ 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
+ retl
+ ldx [%sp + STACK_BIAS + 144], %fsr
+END (__nearbyint_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S
new file mode 100644
index 0000000000..bb75ab3606
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(nearbyint)
+
+weak_alias (__nearbyint, nearbyint)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __nearbyint __nearbyint_generic
+
+#include "../s_nearbyint.S"
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S
new file mode 100644
index 0000000000..208af37d0d
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S
@@ -0,0 +1,61 @@
+/* Round float to int floating-point values without generating
+ an inexact exception, sparc64 vis3 version.
+
+ Copyright (C) 2013-2017 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 (__nearbyintf_vis3)
+ fcmps %fcc3, %f1, %f1 /* Check for sNaN */
+ stx %fsr, [%sp + STACK_BIAS + 144]
+ sethi %hi(0xf8003e0), %o5
+ sethi %hi(TWO_TWENTYTHREE), %o2
+ ldx [%sp + STACK_BIAS + 144], %o4
+ or %o5, %lo(0xf8003e0), %o5
+ fzeros ZERO
+ andn %o4, %o5, %o4
+ fnegs ZERO, SIGN_BIT
+ movwtos %o2, %f16
+ stx %o4, [%sp + STACK_BIAS + 136]
+ ldx [%sp + STACK_BIAS + 136], %fsr
+ fabss %f1, %f14
+ fcmps %fcc3, %f14, %f16
+ fmovsuge %fcc3, ZERO, %f16
+ fands %f1, SIGN_BIT, SIGN_BIT
+ fors %f16, SIGN_BIT, %f16
+ fadds %f1, %f16, %f5
+ fsubs %f5, %f16, %f0
+ fabss %f0, %f0
+ fors %f0, SIGN_BIT, %f0
+ retl
+ ldx [%sp + STACK_BIAS + 144], %fsr
+END (__nearbyintf_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S
new file mode 100644
index 0000000000..95100c1bfc
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S
@@ -0,0 +1,12 @@
+#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/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S
new file mode 100644
index 0000000000..495a02222e
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S
@@ -0,0 +1,50 @@
+/* Round float to int floating-point values, sparc64 vis3 version.
+ Copyright (C) 2012-2017 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>
+
+ /* 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 (__rint_vis3)
+ sethi %hi(TWO_FIFTYTWO), %o2
+ sllx %o2, 32, %o2
+ fzero ZERO
+
+ fnegd ZERO, SIGN_BIT
+ movxtod %o2, %f16
+ fabsd %f0, %f14
+
+ fcmpd %fcc3, %f14, %f16
+
+ fmovduge %fcc3, ZERO, %f16
+ fand %f0, SIGN_BIT, SIGN_BIT
+
+ for %f16, SIGN_BIT, %f16
+ faddd %f0, %f16, %f6
+ fsubd %f6, %f16, %f0
+ fabsd %f0, %f0
+ retl
+ for %f0, SIGN_BIT, %f0
+END (__rint_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S
new file mode 100644
index 0000000000..cc980eb8c7
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(rint)
+
+weak_alias (__rint, rint)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __rint __rint_generic
+
+#include "../s_rint.S"
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S
new file mode 100644
index 0000000000..521c0b21ec
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S
@@ -0,0 +1,49 @@
+/* Round float to int floating-point values, sparc64 vis3 version.
+ Copyright (C) 2012-2017 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>
+
+ /* 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 (__rintf_vis3)
+ sethi %hi(TWO_TWENTYTHREE), %o2
+ fzeros ZERO
+
+ fnegs ZERO, SIGN_BIT
+ movwtos %o2, %f16
+ fabss %f1, %f14
+
+ fcmps %fcc3, %f14, %f16
+
+ fmovsuge %fcc3, ZERO, %f16
+ fands %f1, SIGN_BIT, SIGN_BIT
+
+ fors %f16, SIGN_BIT, %f16
+ fadds %f1, %f16, %f5
+ fsubs %f5, %f16, %f0
+ fabss %f0, %f0
+ retl
+ fors %f0, SIGN_BIT, %f0
+END (__rintf_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S
new file mode 100644
index 0000000000..38fd936086
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S
@@ -0,0 +1,12 @@
+#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/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S
new file mode 100644
index 0000000000..bce7c9795a
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S
@@ -0,0 +1,25 @@
+/* signbit(). sparc64 vis3 version.
+ Copyright (C) 2012-2017 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 (__signbit_vis3)
+ movdtox %f0, %o0
+ retl
+ srlx %o0, 63, %o0
+END (__signbit_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S
new file mode 100644
index 0000000000..b8ff64a547
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S
@@ -0,0 +1,20 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(signbit)
+
+/* On 64-bit the double version will also always work for
+ long-double-precision since in both cases the word with the
+ sign bit in it is passed always in register %f0. */
+strong_alias (__signbit, __signbitl)
+hidden_def (__signbitl)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef strong_alias
+# define strong_alias(a, b)
+# undef hidden_def
+# define hidden_def(a)
+
+#define __signbit __signbit_generic
+
+#include "../s_signbit.S"
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S
new file mode 100644
index 0000000000..7833e725e6
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S
@@ -0,0 +1,25 @@
+/* signbitf(). sparc64 vis3 version.
+ Copyright (C) 2012-2017 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 (__signbitf_vis3)
+ movstouw %f1, %o0
+ retl
+ srl %o0, 31, %o0
+END (__signbitf_vis3)
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S
new file mode 100644
index 0000000000..d57e999b90
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S
@@ -0,0 +1,10 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(signbitf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __signbitf __signbitf_generic
+
+#include "../s_signbitf.S"
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c
new file mode 100644
index 0000000000..38ee29a8d3
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c
@@ -0,0 +1,23 @@
+/* trunc function, sparc64 vis3 version.
+ Copyright (C) 2016-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+#define __trunc __trunc_vis3
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c>
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c
new file mode 100644
index 0000000000..dc67f423f1
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c
@@ -0,0 +1,32 @@
+/* trunc function, sparc64 version.
+ Copyright (C) 2016-2017 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/>. */
+
+#ifdef HAVE_AS_VIS3_SUPPORT
+# include <sparc-ifunc.h>
+# include <math.h>
+
+extern double __trunc_vis3 (double);
+extern double __trunc_generic (double);
+
+sparc_libm_ifunc(__trunc, hwcap & HWCAP_SPARC_VIS3 ? __trunc_vis3 : __trunc_generic);
+weak_alias (__trunc, trunc)
+
+# define __trunc __trunc_generic
+#endif
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c>
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c
new file mode 100644
index 0000000000..302aa56047
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c
@@ -0,0 +1,23 @@
+/* Float trunc function, sparc64 vis3 version.
+ Copyright (C) 2016-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+#define __truncf __truncf_vis3
+
+#include <sysdeps/ieee754/flt-32/s_truncf.c>
diff --git a/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c
new file mode 100644
index 0000000000..980a313ae1
--- /dev/null
+++ b/REORG.TODO/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c
@@ -0,0 +1,32 @@
+/* Float trunc function, sparc64 version.
+ Copyright (C) 2016-2017 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/>. */
+
+#ifdef HAVE_AS_VIS3_SUPPORT
+# include <sparc-ifunc.h>
+# include <math.h>
+
+extern float __truncf_vis3 (float);
+extern float __truncf_generic (float);
+
+sparc_libm_ifunc(__truncf, hwcap & HWCAP_SPARC_VIS3 ? __truncf_vis3 : __truncf_generic);
+weak_alias (__truncf, truncf)
+
+# define __truncf __truncf_generic
+#endif
+
+#include <sysdeps/ieee754/flt-32/s_truncf.c>