This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.24-15-gbdf20be


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  bdf20beac183c705abef5aef8de2db5fac00bc8b (commit)
      from  3ef3f1b93fdf20143865cc16dd75f39a7f0fac2f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bdf20beac183c705abef5aef8de2db5fac00bc8b

commit bdf20beac183c705abef5aef8de2db5fac00bc8b
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Sun Jul 31 23:45:52 2016 +0200

    sparc64: add a VIS3 version of ceil, floor and trunc
    
    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.

diff --git a/ChangeLog b/ChangeLog
index f84b981..bebb915 100644
--- 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
diff --git a/sysdeps/ieee754/dbl-64/s_trunc.c b/sysdeps/ieee754/dbl-64/s_trunc.c
index f64e097..7663f61 100644
--- a/sysdeps/ieee754/dbl-64/s_trunc.c
+++ b/sysdeps/ieee754/dbl-64/s_trunc.c
@@ -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
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c
index 81ac55e..f961e52 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c
@@ -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
diff --git a/sysdeps/ieee754/flt-32/s_truncf.c b/sysdeps/ieee754/flt-32/s_truncf.c
index 43d35c7..5228ec6 100644
--- a/sysdeps/ieee754/flt-32/s_truncf.c
+++ b/sysdeps/ieee754/flt-32/s_truncf.c
@@ -48,4 +48,6 @@ __truncf (float x)
 
   return x;
 }
+#ifndef __truncf
 weak_alias (__truncf, truncf)
+#endif
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
index 47859f0..51f3709 100644
--- a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
@@ -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
index 0000000..77d3537
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c
@@ -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/ieee754/flt-32/s_truncf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c
similarity index 51%
copy from sysdeps/ieee754/flt-32/s_truncf.c
copy to sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c
index 43d35c7..6d04b78 100644
--- a/sysdeps/ieee754/flt-32/s_truncf.c
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c
@@ -1,7 +1,6 @@
-/* Truncate argument to nearest integral value not larger than the argument.
-   Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* ceil function, sparc64 version.
+   Copyright (C) 2016 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
    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,35 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-
-#include <math_private.h>
-
-
-float
-__truncf (float x)
-{
-  int32_t i0, j0;
-  int sx;
-
-  GET_FLOAT_WORD (i0, x);
-  sx = i0 & 0x80000000;
-  j0 = ((i0 >> 23) & 0xff) - 0x7f;
-  if (j0 < 23)
-    {
-      if (j0 < 0)
-	/* The magnitude of the number is < 1 so the result is +-0.  */
-	SET_FLOAT_WORD (x, sx);
-      else
-	SET_FLOAT_WORD (x, sx | (i0 & ~(0x007fffff >> j0)));
-    }
-  else
-    {
-      if (j0 == 0x80)
-	/* x is inf or NaN.  */
-	return x + x;
-    }
-
-  return x;
-}
-weak_alias (__truncf, truncf)
+#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
index 0000000..119fe46
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c
@@ -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/ieee754/flt-32/s_truncf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c
similarity index 51%
copy from sysdeps/ieee754/flt-32/s_truncf.c
copy to sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c
index 43d35c7..5eca59f 100644
--- a/sysdeps/ieee754/flt-32/s_truncf.c
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c
@@ -1,7 +1,6 @@
-/* Truncate argument to nearest integral value not larger than the argument.
-   Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Float ceil function, sparc64 version.
+   Copyright (C) 2016 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
    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,35 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-
-#include <math_private.h>
-
-
-float
-__truncf (float x)
-{
-  int32_t i0, j0;
-  int sx;
-
-  GET_FLOAT_WORD (i0, x);
-  sx = i0 & 0x80000000;
-  j0 = ((i0 >> 23) & 0xff) - 0x7f;
-  if (j0 < 23)
-    {
-      if (j0 < 0)
-	/* The magnitude of the number is < 1 so the result is +-0.  */
-	SET_FLOAT_WORD (x, sx);
-      else
-	SET_FLOAT_WORD (x, sx | (i0 & ~(0x007fffff >> j0)));
-    }
-  else
-    {
-      if (j0 == 0x80)
-	/* x is inf or NaN.  */
-	return x + x;
-    }
-
-  return x;
-}
-weak_alias (__truncf, truncf)
+#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
index 0000000..39af6b9
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c
@@ -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/ieee754/flt-32/s_truncf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c
similarity index 51%
copy from sysdeps/ieee754/flt-32/s_truncf.c
copy to sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c
index 43d35c7..3edd8a9 100644
--- a/sysdeps/ieee754/flt-32/s_truncf.c
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c
@@ -1,7 +1,6 @@
-/* Truncate argument to nearest integral value not larger than the argument.
-   Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* floor function, sparc64 version.
+   Copyright (C) 2016 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
    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,35 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-
-#include <math_private.h>
-
-
-float
-__truncf (float x)
-{
-  int32_t i0, j0;
-  int sx;
-
-  GET_FLOAT_WORD (i0, x);
-  sx = i0 & 0x80000000;
-  j0 = ((i0 >> 23) & 0xff) - 0x7f;
-  if (j0 < 23)
-    {
-      if (j0 < 0)
-	/* The magnitude of the number is < 1 so the result is +-0.  */
-	SET_FLOAT_WORD (x, sx);
-      else
-	SET_FLOAT_WORD (x, sx | (i0 & ~(0x007fffff >> j0)));
-    }
-  else
-    {
-      if (j0 == 0x80)
-	/* x is inf or NaN.  */
-	return x + x;
-    }
-
-  return x;
-}
-weak_alias (__truncf, truncf)
+#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
index 0000000..4e525f6
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c
@@ -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/ieee754/flt-32/s_truncf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c
similarity index 51%
copy from sysdeps/ieee754/flt-32/s_truncf.c
copy to sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c
index 43d35c7..d86f313 100644
--- a/sysdeps/ieee754/flt-32/s_truncf.c
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c
@@ -1,7 +1,6 @@
-/* Truncate argument to nearest integral value not larger than the argument.
-   Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Float floor function, sparc64 version.
+   Copyright (C) 2016 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
    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,35 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-
-#include <math_private.h>
-
-
-float
-__truncf (float x)
-{
-  int32_t i0, j0;
-  int sx;
-
-  GET_FLOAT_WORD (i0, x);
-  sx = i0 & 0x80000000;
-  j0 = ((i0 >> 23) & 0xff) - 0x7f;
-  if (j0 < 23)
-    {
-      if (j0 < 0)
-	/* The magnitude of the number is < 1 so the result is +-0.  */
-	SET_FLOAT_WORD (x, sx);
-      else
-	SET_FLOAT_WORD (x, sx | (i0 & ~(0x007fffff >> j0)));
-    }
-  else
-    {
-      if (j0 == 0x80)
-	/* x is inf or NaN.  */
-	return x + x;
-    }
-
-  return x;
-}
-weak_alias (__truncf, truncf)
+#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
index 0000000..2451034
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c
@@ -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/ieee754/flt-32/s_truncf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c
similarity index 51%
copy from sysdeps/ieee754/flt-32/s_truncf.c
copy to sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c
index 43d35c7..7ae9a97 100644
--- a/sysdeps/ieee754/flt-32/s_truncf.c
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c
@@ -1,7 +1,6 @@
-/* Truncate argument to nearest integral value not larger than the argument.
-   Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* trunc function, sparc64 version.
+   Copyright (C) 2016 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
    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,35 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-
-#include <math_private.h>
-
-
-float
-__truncf (float x)
-{
-  int32_t i0, j0;
-  int sx;
-
-  GET_FLOAT_WORD (i0, x);
-  sx = i0 & 0x80000000;
-  j0 = ((i0 >> 23) & 0xff) - 0x7f;
-  if (j0 < 23)
-    {
-      if (j0 < 0)
-	/* The magnitude of the number is < 1 so the result is +-0.  */
-	SET_FLOAT_WORD (x, sx);
-      else
-	SET_FLOAT_WORD (x, sx | (i0 & ~(0x007fffff >> j0)));
-    }
-  else
-    {
-      if (j0 == 0x80)
-	/* x is inf or NaN.  */
-	return x + x;
-    }
-
-  return x;
-}
-weak_alias (__truncf, truncf)
+#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
index 0000000..6253efc
--- /dev/null
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c
@@ -0,0 +1,23 @@
+/* Float trunc function, sparc64 vis3 version.
+   Copyright (C) 2016 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/ieee754/flt-32/s_truncf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c
similarity index 53%
copy from sysdeps/ieee754/flt-32/s_truncf.c
copy to sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c
index 43d35c7..e36ffca 100644
--- a/sysdeps/ieee754/flt-32/s_truncf.c
+++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c
@@ -1,7 +1,6 @@
-/* Truncate argument to nearest integral value not larger than the argument.
-   Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Float trunc function, sparc64 version.
+   Copyright (C) 2016 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
    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,35 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-
-#include <math_private.h>
-
-
-float
-__truncf (float x)
-{
-  int32_t i0, j0;
-  int sx;
-
-  GET_FLOAT_WORD (i0, x);
-  sx = i0 & 0x80000000;
-  j0 = ((i0 >> 23) & 0xff) - 0x7f;
-  if (j0 < 23)
-    {
-      if (j0 < 0)
-	/* The magnitude of the number is < 1 so the result is +-0.  */
-	SET_FLOAT_WORD (x, sx);
-      else
-	SET_FLOAT_WORD (x, sx | (i0 & ~(0x007fffff >> j0)));
-    }
-  else
-    {
-      if (j0 == 0x80)
-	/* x is inf or NaN.  */
-	return x + x;
-    }
-
-  return x;
-}
+#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>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |   28 +++++++++++++++++
 sysdeps/ieee754/dbl-64/s_trunc.c                   |    4 ++-
 sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c       |    4 ++-
 sysdeps/ieee754/flt-32/s_truncf.c                  |    2 +
 sysdeps/sparc/sparc64/fpu/multiarch/Makefile       |   11 ++++++-
 sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c  |   23 ++++++++++++++
 sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c       |   32 ++++++++++++++++++++
 sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c |   23 ++++++++++++++
 sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c      |   32 ++++++++++++++++++++
 sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c |   23 ++++++++++++++
 sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c      |   32 ++++++++++++++++++++
 .../sparc/sparc64/fpu/multiarch/s_floorf-vis3.c    |   23 ++++++++++++++
 sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c     |   32 ++++++++++++++++++++
 sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c |   23 ++++++++++++++
 sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c      |   32 ++++++++++++++++++++
 .../sparc/sparc64/fpu/multiarch/s_truncf-vis3.c    |   23 ++++++++++++++
 sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c     |   32 ++++++++++++++++++++
 17 files changed, 376 insertions(+), 3 deletions(-)
 create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c
 create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c
 create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c
 create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c
 create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c
 create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c
 create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c
 create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c
 create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c
 create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c
 create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c
 create mode 100644 sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]