]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
sparc64: add a VIS3 version of ceil, floor and trunc
authorAurelien Jarno <aurelien@aurel32.net>
Sun, 31 Jul 2016 21:45:52 +0000 (23:45 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Wed, 3 Aug 2016 11:35:22 +0000 (13:35 +0200)
sparc64 passes floating point values in the floating point registers.
As the the generic ceil, floor and trunc functions use integer
instructions, it makes sense to provide a VIS3 version consisting in
the the generic version compiled with -mvis3. GCC will then use
movdtox, movxtod, movwtos and movstow instructions.

sparc32 passes the floating point values in the integer registers, so it
doesn't make sense to do the same.

Changelog:
* sysdeps/ieee754/dbl-64/s_trunc.c: Avoid alias renamed.
* sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c: Likewise.
* sysdeps/ieee754/flt-32/s_truncf.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/Makefile
[$(subdir) = math && $(have-as-vis3) = yes] (libm-sysdep_routines):
Add s_ceilf-vis3, s_ceil-vis3, s_floorf-vis3, s_floor-vis3,
s_truncf-vis3, s_trunc-vis3.
(CFLAGS-s_ceilf-vis3.c): New. Set to -Wa,-Av9d -mvis3.
(CFLAGS-s_ceil-vis3.c): Likewise.
(CFLAGS-s_floorf-vis3.c): Likewise.
(CFLAGS-s_floor-vis3.c): Likewise.
(CFLAGS-s_truncf-vis3.c): Likewise.
(CFLAGS-s_trunc-vis3.c): Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c: Likewise.

17 files changed:
ChangeLog
sysdeps/ieee754/dbl-64/s_trunc.c
sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c
sysdeps/ieee754/flt-32/s_truncf.c
sysdeps/sparc/sparc64/fpu/multiarch/Makefile
sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c [new file with mode: 0644]
sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c [new file with mode: 0644]
sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c [new file with mode: 0644]
sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c [new file with mode: 0644]
sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c [new file with mode: 0644]
sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c [new file with mode: 0644]
sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c [new file with mode: 0644]
sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c [new file with mode: 0644]
sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c [new file with mode: 0644]
sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c [new file with mode: 0644]
sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c [new file with mode: 0644]
sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c [new file with mode: 0644]

index f84b981388e338a123d9c333f146fc518da09f0e..bebb915876fbd07c6e81a8f4eee6b4f24460bd35 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2016-08-03  Aurelien Jarno  <aurelien@aurel32.net>
+
+       * sysdeps/ieee754/dbl-64/s_trunc.c: Avoid alias renamed.
+       * sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c: Likewise.
+       * sysdeps/ieee754/flt-32/s_truncf.c: Likewise.
+       * sysdeps/sparc/sparc64/fpu/multiarch/Makefile
+       [$(subdir) = math && $(have-as-vis3) = yes] (libm-sysdep_routines):
+       Add s_ceilf-vis3, s_ceil-vis3, s_floorf-vis3, s_floor-vis3,
+       s_truncf-vis3, s_trunc-vis3.
+       (CFLAGS-s_ceilf-vis3.c): New. Set to -Wa,-Av9d -mvis3.
+       (CFLAGS-s_ceil-vis3.c): Likewise.
+       (CFLAGS-s_floorf-vis3.c): Likewise.
+       (CFLAGS-s_floor-vis3.c): Likewise.
+       (CFLAGS-s_truncf-vis3.c): Likewise.
+       (CFLAGS-s_trunc-vis3.c): Likewise.
+       * sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c: New file.
+       * sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c: Likewise.
+       * sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c: Likewise.
+       * sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c: Likewise.
+       * sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c: Likewise.
+       * sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c: Likewise.
+       * sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c: Likewise.
+       * sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c: Likewise.
+       * sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c: Likewise.
+       * sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c: Likewise.
+       * sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c: Likewise.
+       * sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c: Likewise.
+
 2016-08-02  David S. Miller  <davem@davemloft.net>
 
        * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S
index f64e097f163371841c1fc3f524c8b122e28673c6..7663f613cd8e91180d3b3775817c0a0cc45213b0 100644 (file)
@@ -53,8 +53,10 @@ __trunc (double x)
 
   return x;
 }
+#ifndef __trunc
 weak_alias (__trunc, trunc)
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 strong_alias (__trunc, __truncl)
 weak_alias (__trunc, truncl)
+# endif
 #endif
index 81ac55e2f6bb1e697a376b4a8e2c9a05c488f4bf..f961e52f383eaa84f558c666cb85144bbb18f08b 100644 (file)
@@ -48,8 +48,10 @@ __trunc (double x)
 
   return x;
 }
+#ifndef __trunc
 weak_alias (__trunc, trunc)
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 strong_alias (__trunc, __truncl)
 weak_alias (__trunc, truncl)
+# endif
 #endif
index 43d35c7f6aa663b30b15f5ddea4ef8b88d923628..5228ec647f6eaa08da6b2d9c934806666e731303 100644 (file)
@@ -48,4 +48,6 @@ __truncf (float x)
 
   return x;
 }
+#ifndef __truncf
 weak_alias (__truncf, truncf)
+#endif
index 47859f0ec25c5d3223e721628cc9c994180e357b..51f37093d8ffe11c07b42b71459257330ee7eadf 100644 (file)
@@ -6,9 +6,18 @@ libm-sysdep_routines += m_signbitf-vis3 m_signbit-vis3 m_finitef-vis3 \
                        s_lrint-vis3 s_rintf-vis3 s_rint-vis3 \
                        s_fminf-vis3 s_fmin-vis3 s_fmaxf-vis3 \
                        s_fmax-vis3 s_fmaf-vis3 s_fma-vis3 \
-                       s_nearbyint-vis3 s_nearbyintf-vis3
+                       s_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/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c
new file mode 100644 (file)
index 0000000..77d3537
--- /dev/null
@@ -0,0 +1,23 @@
+/* ceil function, sparc64 vis3 version.
+   Copyright (C) 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 <math.h>
+
+#define __ceil __ceil_vis3
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c
new file mode 100644 (file)
index 0000000..6d04b78
--- /dev/null
@@ -0,0 +1,32 @@
+/* ceil function, sparc64 version.
+   Copyright (C) 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/>.  */
+
+#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/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c
new file mode 100644 (file)
index 0000000..119fe46
--- /dev/null
@@ -0,0 +1,23 @@
+/* Float ceil function, sparc64 vis3 version.
+   Copyright (C) 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 <math.h>
+
+#define __ceilf __ceilf_vis3
+
+#include <sysdeps/ieee754/flt-32/s_ceilf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c
new file mode 100644 (file)
index 0000000..5eca59f
--- /dev/null
@@ -0,0 +1,32 @@
+/* Float ceil function, sparc64 version.
+   Copyright (C) 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/>.  */
+
+#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/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c
new file mode 100644 (file)
index 0000000..39af6b9
--- /dev/null
@@ -0,0 +1,23 @@
+/* floor function, sparc64 vis3 version.
+   Copyright (C) 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 <math.h>
+
+#define __floor __floor_vis3
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c
new file mode 100644 (file)
index 0000000..3edd8a9
--- /dev/null
@@ -0,0 +1,32 @@
+/* floor function, sparc64 version.
+   Copyright (C) 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/>.  */
+
+#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/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c
new file mode 100644 (file)
index 0000000..4e525f6
--- /dev/null
@@ -0,0 +1,23 @@
+/* Float floor function, sparc64 vis3 version.
+   Copyright (C) 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 <math.h>
+
+#define __floorf __floorf_vis3
+
+#include <sysdeps/ieee754/flt-32/s_floorf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c
new file mode 100644 (file)
index 0000000..d86f313
--- /dev/null
@@ -0,0 +1,32 @@
+/* Float floor function, sparc64 version.
+   Copyright (C) 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/>.  */
+
+#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/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c
new file mode 100644 (file)
index 0000000..2451034
--- /dev/null
@@ -0,0 +1,23 @@
+/* trunc function, sparc64 vis3 version.
+   Copyright (C) 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 <math.h>
+
+#define __trunc __trunc_vis3
+
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c
new file mode 100644 (file)
index 0000000..7ae9a97
--- /dev/null
@@ -0,0 +1,32 @@
+/* trunc function, sparc64 version.
+   Copyright (C) 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/>.  */
+
+#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/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c
new file mode 100644 (file)
index 0000000..6253efc
--- /dev/null
@@ -0,0 +1,23 @@
+/* Float trunc function, sparc64 vis3 version.
+   Copyright (C) 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 <math.h>
+
+#define __truncf __truncf_vis3
+
+#include <sysdeps/ieee754/flt-32/s_truncf.c>
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c
new file mode 100644 (file)
index 0000000..e36ffca
--- /dev/null
@@ -0,0 +1,32 @@
+/* Float trunc function, sparc64 version.
+   Copyright (C) 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/>.  */
+
+#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>