[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commits] r22221 - in /fsf/trunk/libc: ./ include/ misc/ nptl/ sysdeps/ieee754/dbl-64/ sysdeps/sparc/sparc32/sparcv9/fpu/ sysdeps/spar...



Author: eglibc
Date: Thu Jan 17 00:01:51 2013
New Revision: 22221

Log:
Import glibc-mainline for 2013-01-17

Added:
    fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S
    fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S
    fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S
    fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S
    fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S
    fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S
    fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S
    fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S
    fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S
    fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S
    fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S
    fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_nearbyint.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_trunc.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_truncf.S
Removed:
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa2.h
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpexp.h
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/include/stdlib.h
    fsf/trunk/libc/misc/Versions
    fsf/trunk/libc/misc/mktemp.c
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/sem_open.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/atnat.h
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/atnat2.h
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa.h
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpatan.h
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpatan2.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpexp.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpsqrt.h
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/mptan.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_nearbyint.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/ulog.h
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/utan.h
    fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/Makefile

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Thu Jan 17 00:01:51 2013
@@ -1,3 +1,80 @@
+2013-01-16  Andreas Schwab  <schwab@xxxxxxx>
+
+	[BZ #14327]
+	* include/stdlib.h (__mktemp): Add declaration.
+	* misc/mktemp.c (__mktemp): Renamed from mktemp, add weak alias.
+	* misc/Versions (GLIBC_PRIVATE): Add __mktemp.
+
+2013-01-16  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
+
+        * sysdeps/ieee754/dbl-64/atnat.h: Remove constant value
+        definitions.
+        * sysdeps/ieee754/dbl-64/atnat2.h: Likewise.
+        * sysdeps/ieee754/dbl-64/mpa.c: Do not include mpa2.h.
+        * sysdeps/ieee754/dbl-64/mpa.h: Move all constant value
+        definitions here.
+        * sysdeps/ieee754/dbl-64/mpa2.h: Remove.
+        * sysdeps/ieee754/dbl-64/mpatan.h: Remove constant value
+        definitions.
+        * sysdeps/ieee754/dbl-64/mpatan2.c (__mpatan2): Remove ZERO
+        and ONE.
+        * sysdeps/ieee754/dbl-64/mpexp.c: Do not include mpexp.h.
+        * sysdeps/ieee754/dbl-64/mpexp.h: Remove.
+        * sysdeps/ieee754/dbl-64/mpsqrt.h: Remove constant value
+        definitions.
+        * sysdeps/ieee754/dbl-64/mptan.c (__mptan): Remove MONE.
+        * sysdeps/ieee754/dbl-64/ulog.h: Remove constant value
+        definitions.
+        * sysdeps/ieee754/dbl-64/utan.h: Likewise.
+
+	* sysdeps/ieee754/dbl-64/mpa2.h: Fix the value of TWO.
+
+2013-01-15  David S. Miller  <davem@xxxxxxxxxxxxx>
+
+	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile: Add vis3
+	trunc{,f} to libm-sysdep_routes.
+	* sysdeps/sparc/sparc64/fpu/multiarch/Makefile: Likewise.
+	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S: New
+	file.
+	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S: New file.
+	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S: New
+	file.
+	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S: New
+	file.
+	* sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S: New file.
+	* sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S: New file.
+	* sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S: New file.
+	* sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S: New file.
+	* sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S: New file.
+	* sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S: New file.
+	* sysdeps/sparc/sparc64/fpu/s_trunc.S: New file.
+	* sysdeps/sparc/sparc64/fpu/s_truncf.S: New file.
+
+	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile: Add vis3
+	nearbyint{,f} to libm-sysdep_routes.
+	* sysdeps/sparc/sparc64/fpu/multiarch/Makefile: Likewise.
+	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S:
+	New file.
+	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S: New
+	file.
+	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S:
+	New file.
+	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S: New
+	file.
+	* sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S: New file.
+	* sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S: New file.
+	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S: New
+	file.
+	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S: New file.
+	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S: New
+	file.
+	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S: New file.
+	* sysdeps/sparc/sparc64/fpu/s_nearbyint.S: New file.
+	* sysdeps/sparc/sparc64/fpu/s_nearbyintf.S: New file.
+
+	* sysdeps/ieee754/dbl-64/s_nearbyint.c (__nearbyint): Use
+	libc_feholdexcept and libc_fesetenv.
+
 2013-01-15  Mike Frysinger  <vapier@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/scsi/sg.h: Include stddef.h.

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Thu Jan 17 00:01:51 2013
@@ -9,7 +9,8 @@
 
 * The following bugs are resolved with this release:
 
-  13951, 14200, 14317, 14964, 14981, 14982, 14985, 14994, 14996, 15003.
+  13951, 14200, 14317, 14327, 14964, 14981, 14982, 14985, 14994, 14996,
+  15003.
 
 
 Version 2.17

Modified: fsf/trunk/libc/include/stdlib.h
==============================================================================
--- fsf/trunk/libc/include/stdlib.h (original)
+++ fsf/trunk/libc/include/stdlib.h Thu Jan 17 00:01:51 2013
@@ -77,6 +77,7 @@
 extern int __setenv (const char *__name, const char *__value, int __replace);
 extern int __unsetenv (const char *__name);
 extern int __clearenv (void);
+extern char *__mktemp (char *__template) __THROW __nonnull ((1));
 extern char *__canonicalize_file_name (const char *__name);
 extern char *__realpath (const char *__name, char *__resolved);
 extern int __ptsname_r (int __fd, char *__buf, size_t __buflen);

Modified: fsf/trunk/libc/misc/Versions
==============================================================================
--- fsf/trunk/libc/misc/Versions (original)
+++ fsf/trunk/libc/misc/Versions Thu Jan 17 00:01:51 2013
@@ -151,6 +151,7 @@
   }
   GLIBC_PRIVATE {
     __madvise;
+    __mktemp;
     __libc_ifunc_impl_list;
   }
 }

Modified: fsf/trunk/libc/misc/mktemp.c
==============================================================================
--- fsf/trunk/libc/misc/mktemp.c (original)
+++ fsf/trunk/libc/misc/mktemp.c Thu Jan 17 00:01:51 2013
@@ -22,7 +22,7 @@
    The last six characters of TEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the filename unique.  */
 char *
-mktemp (template)
+__mktemp (template)
      char *template;
 {
   if (__gen_tempname (template, 0, 0, __GT_NOCREATE) < 0)
@@ -31,5 +31,6 @@
 
   return template;
 }
+weak_alias (__mktemp, mktemp)
 
 link_warning (mktemp, "the use of `mktemp' is dangerous, better use `mkstemp'")

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Thu Jan 17 00:01:51 2013
@@ -1,3 +1,8 @@
+2013-01-16  Andreas Schwab  <schwab@xxxxxxx>
+
+	[BZ #14327]
+	* sem_open.c (sem_open): Use __mktemp instead of mktemp.
+
 2013-01-11  Carlos O'Donell  <codonell@xxxxxxxxxx>
 
 	* allocatestack.c (allocate_stack): Add comment. Remove assert

Modified: fsf/trunk/libc/nptl/sem_open.c
==============================================================================
--- fsf/trunk/libc/nptl/sem_open.c (original)
+++ fsf/trunk/libc/nptl/sem_open.c Thu Jan 17 00:01:51 2013
@@ -329,7 +329,7 @@
 	     since the file must be opened with a specific mode.  The
 	     mode cannot later be set since then we cannot apply the
 	     file create mask.  */
-	  if (mktemp (tmpfname) == NULL)
+	  if (__mktemp (tmpfname) == NULL)
 	    return SEM_FAILED;
 
 	  /* Open the file.  Make sure we do not overwrite anything.  */

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/atnat.h
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/atnat.h (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/atnat.h Thu Jan 17 00:01:51 2013
@@ -130,8 +130,6 @@
 #endif
 #endif
 
-#define  ZERO      0.0
-#define  ONE       1.0
 #define  A         a.d
 #define  B         b.d
 #define  C         c.d
@@ -152,7 +150,5 @@
 #define  U6        u6.d
 #define  U7        u7.d
 #define  U8        u8.d
-#define  TWO8      0x1.0p8	/* 2^8 */
-#define  TWO52     0x1.0p52	/* 2^52 */
 
 #endif

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/atnat2.h
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/atnat2.h (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/atnat2.h Thu Jan 17 00:01:51 2013
@@ -162,11 +162,4 @@
 #endif
 #endif
 
-#define  ZERO      0.0		/* 0 */
-#define  MZERO     -0.0		/* 0 with the sign bit set */
-#define  ONE       1.0		/* 1 */
-#define  TWO8      0x1.0p8	/* 2^8 */
-#define  TWO52     0x1.0p52	/* 2^52 */
-#define  TWOM1022  0x1.0p-1022	/* 2^-1022 */
-
 #endif

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa.c Thu Jan 17 00:01:51 2013
@@ -44,7 +44,6 @@
 
 #include "endian.h"
 #include "mpa.h"
-#include "mpa2.h"
 #include <sys/param.h>
 
 #ifndef SECTION

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa.h
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa.h (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa.h Thu Jan 17 00:01:51 2013
@@ -82,6 +82,32 @@
 
 #define ABS(x)   ((x) <  0  ? -(x) : (x))
 
+#define  RADIX     0x1.0p24		/* 2^24    */
+#define  RADIXI    0x1.0p-24		/* 2^-24   */
+#define  CUTTER    0x1.0p76		/* 2^76    */
+
+#define  ZERO      0.0			/* 0       */
+#define  MZERO     -0.0			/* 0 with the sign bit set */
+#define  ONE       1.0			/* 1       */
+#define  MONE      -1.0			/* -1      */
+#define  TWO       2.0			/*  2      */
+
+#define  TWO5      0x1.0p5		/* 2^5     */
+#define  TWO8      0x1.0p8		/* 2^52    */
+#define  TWO10     0x1.0p10		/* 2^10    */
+#define  TWO18     0x1.0p18		/* 2^18    */
+#define  TWO19     0x1.0p19		/* 2^19    */
+#define  TWO23     0x1.0p23		/* 2^23    */
+#define  TWO52     0x1.0p52		/* 2^52    */
+#define  TWO57     0x1.0p57		/* 2^57    */
+#define  TWO71     0x1.0p71		/* 2^71    */
+#define  TWOM1032  0x1.0p-1032		/* 2^-1032 */
+#define  TWOM1022  0x1.0p-1022		/* 2^-1022 */
+
+#define  HALF      0x1.0p-1		/* 1/2 */
+#define  MHALF     -0x1.0p-1		/* -1/2 */
+#define  HALFRAD   0x1.0p23		/* 2^23 */
+
 int __acr (const mp_no *, const mp_no *, int);
 void __cpy (const mp_no *, mp_no *, int);
 void __mp_dbl (const mp_no *, double *, int);

Removed: fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa2.h
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa2.h (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa2.h (removed)
@@ -1,50 +1,0 @@
-
-/*
- * IBM Accurate Mathematical Library
- * Written by International Business Machines Corp.
- * Copyright (C) 2001-2013 Free Software Foundation, Inc.
- *
- * This program 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.
- *
- * This program 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 this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-/**************************************************************************/
-/*                                                                        */
-/* MODULE_NAME:mpa2.h                                                     */
-/*                                                                        */
-/*                                                                        */
-/*   variables prototype and definition   according to type of processor  */
-/*   types definition                                                     */
-/**************************************************************************/
-
-#ifndef MPA2_H
-#define MPA2_H
-
-#define  RADIX     0x1.0p24		/* 2^24    */
-#define  RADIXI    0x1.0p-24		/* 2^-24   */
-#define  CUTTER    0x1.0p76		/* 2^76    */
-#define  ZERO      0.0			/* 0       */
-#define  ONE       1.0			/* 1       */
-#define  MONE      -1.0			/* -1      */
-#define  TWO       -2.0			/* -2      */
-#define  TWO5      0x1.0p5		/* 2^5     */
-#define  TWO10     0x1.0p10		/* 2^10    */
-#define  TWO18     0x1.0p18		/* 2^18    */
-#define  TWO19     0x1.0p19		/* 2^19    */
-#define  TWO23     0x1.0p23		/* 2^23    */
-#define  TWO52     0x1.0p52		/* 2^52    */
-#define  TWO57     0x1.0p57		/* 2^57    */
-#define  TWO71     0x1.0p71		/* 2^71    */
-#define  TWOM1032  0x1.0p-1032		/* 2^-1032 */
-
-#endif

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpatan.h
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpatan.h (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpatan.h Thu Jan 17 00:01:51 2013
@@ -143,6 +143,3 @@
 
 #endif
 #endif
-
-#define  ONE       1.0
-#define  TWO       2.0

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpatan2.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpatan2.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpatan2.c Thu Jan 17 00:01:51 2013
@@ -49,8 +49,6 @@
 SECTION
 __mpatan2(mp_no *y, mp_no *x, mp_no *z, int p) {
 
-  static const double ZERO = 0.0, ONE = 1.0;
-
   mp_no mpt1,mpt2,mpt3;
 
 

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpexp.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpexp.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpexp.c Thu Jan 17 00:01:51 2013
@@ -30,7 +30,6 @@
 
 #include "endian.h"
 #include "mpa.h"
-#include "mpexp.h"
 #include <assert.h>
 
 #ifndef SECTION

Removed: fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpexp.h
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpexp.h (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpexp.h (removed)
@@ -1,37 +1,0 @@
-/*
- * IBM Accurate Mathematical Library
- * Written by International Business Machines Corp.
- * Copyright (C) 2001-2013 Free Software Foundation, Inc.
- *
- * This program 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.
- *
- * This program 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 this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-/******************************************************************/
-/*                                                                */
-/* MODULE_NAME:mpexp.h                                            */
-/*                                                                */
-/* common data and variables prototype and definition             */
-/******************************************************************/
-
-#ifndef MPEXP_H
-#define MPEXP_H
-
-#define  RADIX     0x1.0p24		/* 2^24 */
-#define  RADIXI    0x1.0p-24		/* 2^-24 */
-#define  ZERO      0.0			/* 0 */
-#define  ONE       1.0			/* 1 */
-#define  TWO       2.0			/* 2 */
-#define  HALF      0x1.0p-1		/* 1/2 */
-
-#endif

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpsqrt.h
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpsqrt.h (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpsqrt.h Thu Jan 17 00:01:51 2013
@@ -35,7 +35,4 @@
 			     4,4,4,4,4,4,4,4,4};
 #endif
 
-#define  ONE       1.0		/* 1 */
-#define  HALFRAD   0x1.0p23	/* 2^23 */
-
 #endif

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/mptan.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/mptan.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/mptan.c Thu Jan 17 00:01:51 2013
@@ -47,8 +47,6 @@
 SECTION
 __mptan(double x, mp_no *mpy, int p) {
 
-  static const double MONE = -1.0;
-
   int n;
   mp_no mpw, mpc, mps;
 

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_nearbyint.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_nearbyint.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_nearbyint.c Thu Jan 17 00:01:51 2013
@@ -44,10 +44,10 @@
 	j0 = ((i0>>20)&0x7ff)-0x3ff;
 	if(j0<52) {
 	    if(j0<0) {
-		feholdexcept (&env);
+		libc_feholdexcept (&env);
 	        w = TWO52[sx]+x;
 	        t =  w-TWO52[sx];
-		fesetenv (&env);
+		libc_fesetenv (&env);
 		GET_HIGH_WORD(i0,t);
 		SET_HIGH_WORD(t,(i0&0x7fffffff)|(sx<<31));
 	        return t;
@@ -56,10 +56,10 @@
 	    if(j0==0x400) return x+x;	/* inf or NaN */
 	    else return x;		/* x is integral */
 	}
-	feholdexcept (&env);
+	libc_feholdexcept (&env);
 	w = TWO52[sx]+x;
 	t = w-TWO52[sx];
-	fesetenv (&env);
+	libc_fesetenv (&env);
 	return t;
 }
 weak_alias (__nearbyint, nearbyint)

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/ulog.h
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/ulog.h (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/ulog.h Thu Jan 17 00:01:51 2013
@@ -173,10 +173,6 @@
 #endif
 #endif
 
-#define  ZERO      0.0		/* 0 */
-#define  ONE       1.0		/* 1 */
-#define  HALF      0x1.0p-1	/* 1/2 */
-#define  MHALF     -0x1.0p-1	/* -1/2 */
 #define  SQRT_2    sqrt_2.d
 #define  DEL_U     delu.d
 #define  DEL_V     delv.d

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/utan.h
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/utan.h (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/utan.h Thu Jan 17 00:01:51 2013
@@ -262,10 +262,4 @@
 #endif
 #endif
 
-
-#define  ZERO      0.0
-#define  ONE       1.0
-#define  MONE      -1.0
-#define  TWO8      0x1.0p8	/* 2^8 */
-
-#endif
+#endif

Modified: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile (original)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile Thu Jan 17 00:01:51 2013
@@ -7,7 +7,9 @@
 			s_floorf-vis3 s_llrintf-vis3 s_llrint-vis3 \
 			s_rintf-vis3 s_rint-vis3 w_sqrt-vis3 w_sqrtf-vis3 \
 			s_fminf-vis3 s_fmin-vis3 s_fmaxf-vis3 s_fmax-vis3 \
-			s_fmaf-vis3 s_fma-vis3 s_fdimf-vis3 s_fdim-vis3
+			s_fmaf-vis3 s_fma-vis3 s_fdimf-vis3 s_fdim-vis3 \
+			s_nearbyint-vis3 s_nearbyintf-vis3 s_truncf-vis3 \
+			s_trunc-vis3
 sysdep_routines += s_copysignf-vis3 s_copysign-vis3
 endif
 endif

Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,65 @@
+/* Round float to int floating-point values without generating
+   an inexact exception, sparc32 v9 vis3 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2013.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <math_ldbl_opt.h>
+
+	/* We pop constants into the FPU registers using the incoming
+	   argument stack slots, since this avoid having to use any PIC
+	   references.  We also thus avoid having to allocate a register
+	   window.
+
+	   VIS instructions are used to facilitate the formation of
+	   easier constants, and the propagation of the sign bit.  */
+
+#define TWO_FIFTYTWO	0x43300000		/* 2**52 */
+
+#define ZERO		%f10			/* 0.0 */
+#define SIGN_BIT	%f12			/* -0.0 */
+
+ENTRY (__nearbyint_vis3)
+	st	%fsr, [%sp + 88]
+	sethi	%hi(TWO_FIFTYTWO), %o2
+	sethi	%hi(0xf8003e0), %o5
+	ld	[%sp + 88], %o4
+	sllx	%o0, 32, %o0
+	or	%o5, %lo(0xf8003e0), %o5
+	or	%o0, %o1, %o0
+	movxtod	%o0, %f0
+	andn	%o4, %o5, %o4
+	fzero	ZERO
+	st	%o4, [%sp + 80]
+	sllx	%o2, 32, %o2
+	fnegd	ZERO, SIGN_BIT
+	ld	[%sp + 80], %fsr
+	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
+	retl
+	 ld	[%sp + 88], %fsr
+END (__nearbyint_vis3)

Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,19 @@
+#include <sparc-ifunc.h>
+#include <math_ldbl_opt.h>
+
+SPARC_ASM_VIS3_IFUNC(nearbyint)
+
+weak_alias (__nearbyint, nearbyint)
+
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1)
+#endif
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef compat_symbol
+# define compat_symbol(a, b, c, d)
+
+#define __nearbyint __nearbyint_generic
+
+#include "../s_nearbyint.S"

Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,61 @@
+/* Round float to int floating-point values without generating
+   an inexact exception, sparc32 v9 vis3 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 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)
+	st	%fsr, [%sp + 88]
+	movwtos	%o0, %f1
+	sethi	%hi(TWO_TWENTYTHREE), %o2
+	sethi	%hi(0xf8003e0), %o5
+	ld	[%sp + 88], %o4
+	fzeros	ZERO
+	or	%o5, %lo(0xf8003e0), %o5
+	fnegs	ZERO, SIGN_BIT
+	andn	%o4, %o5, %o4
+	st	%o4, [%sp + 80]
+	ld	[%sp + 80], %fsr
+	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
+	retl
+	 ld	[%sp + 88], %fsr
+END (__nearbyintf_vis3)

Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S Thu Jan 17 00:01:51 2013
@@ -1,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"

Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,57 @@
+/* Truncate argument to nearest integral value not larger than
+   the argument, sparc32 v9 vis3 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2013.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <math_ldbl_opt.h>
+
+	/* We pop constants into the FPU registers using the incoming
+	   argument stack slots, since this avoid having to use any PIC
+	   references.  We also thus avoid having to allocate a register
+	   window.
+
+	   VIS instructions are used to facilitate the formation of
+	   easier constants, and the propagation of the sign bit.  */
+
+#define TWO_FIFTYTWO	0x43300000		/* 2**52 */
+
+#define ZERO		%f10			/* 0.0 */
+#define SIGN_BIT	%f12			/* -0.0 */
+
+ENTRY (__trunc_vis3)
+	sethi	%hi(TWO_FIFTYTWO), %o2
+	sllx	%o0, 32, %o0
+	or	%o0, %o1, %o0
+	fzero	ZERO
+	movxtod	%o0, %f0
+	sllx	%o2, 32, %o2
+	fnegd	ZERO, SIGN_BIT
+	movxtod	%o2, %f16
+	fabsd	%f0, %f14
+	fcmpd	%fcc3, %f14, %f16
+	fmovduge %fcc3, ZERO, %f14
+	fand	%f0, SIGN_BIT, SIGN_BIT
+	fdtox	%f14, %f14
+	fxtod	%f14, %f14
+	faddd	%f0, ZERO, %f18
+	fmovduge %fcc3, %f18, %f14
+	retl
+	 for	%f14, SIGN_BIT, %f0
+END (__trunc_vis3)

Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,19 @@
+#include <sparc-ifunc.h>
+#include <math_ldbl_opt.h>
+
+SPARC_ASM_VIS3_IFUNC(trunc)
+
+weak_alias (__trunc, trunc)
+
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
+#endif
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef compat_symbol
+# define compat_symbol(a, b, c, d)
+
+#define __trunc __trunc_generic
+
+#include "../s_trunc.S"

Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,53 @@
+/* Truncate argument to nearest integral value not larger than
+   the argument, sparc32 v9 vis3 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2013.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+	/* We pop constants into the FPU registers using the incoming
+	   argument stack slots, since this avoid having to use any PIC
+	   references.  We also thus avoid having to allocate a register
+	   window.
+
+	   VIS instructions are used to facilitate the formation of
+	   easier constants, and the propagation of the sign bit.  */
+
+#define TWO_TWENTYTHREE	0x4b000000		/* 2**23 */
+
+#define ZERO		%f10			/* 0.0 */
+#define SIGN_BIT	%f12			/* -0.0 */
+
+ENTRY (__truncf_vis3)
+	movwtos	%o0, %f1
+	sethi	%hi(TWO_TWENTYTHREE), %o2
+	fzeros	ZERO
+	fnegs	ZERO, SIGN_BIT
+	movwtos	%o2, %f16
+	fabss	%f1, %f14
+	fcmps	%fcc3, %f14, %f16
+	fmovsuge %fcc3, ZERO, %f14
+	fands	%f1, SIGN_BIT, SIGN_BIT
+	fstoi	%f14, %f14
+	fitos	%f14, %f14
+	fadds	%f1, ZERO, %f18
+	fmovsuge %fcc3, %f18, %f14
+	retl
+	 fors	%f14, SIGN_BIT, %f0
+END (__truncf_vis3)

Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(truncf)
+
+weak_alias (__truncf, truncf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __truncf __truncf_generic
+
+#include "../s_truncf.S"

Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,72 @@
+/* Round float to int floating-point values without generating
+   an inexact exception, sparc32 v9 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2013.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <math_ldbl_opt.h>
+
+	/* We pop constants into the FPU registers using the incoming
+	   argument stack slots, since this avoid having to use any PIC
+	   references.  We also thus avoid having to allocate a register
+	   window.
+
+	   VIS instructions are used to facilitate the formation of
+	   easier constants, and the propagation of the sign bit.  */
+
+#define TWO_FIFTYTWO	0x43300000		/* 2**52 */
+
+#define ZERO		%f10			/* 0.0 */
+#define SIGN_BIT	%f12			/* -0.0 */
+
+ENTRY (__nearbyint)
+	st	%fsr, [%sp + 88]
+	sethi	%hi(TWO_FIFTYTWO), %o2
+	sethi	%hi(0xf8003e0), %o5
+	ld	[%sp + 88], %o4
+	sllx	%o0, 32, %o0
+	or	%o5, %lo(0xf8003e0), %o5
+	or	%o0, %o1, %o0
+	andn	%o4, %o5, %o4
+	fzero	ZERO
+	st	%o4, [%sp + 80]
+	stx	%o0, [%sp + 72]
+	sllx	%o2, 32, %o2
+	fnegd	ZERO, SIGN_BIT
+	ldd	[%sp + 72], %f0
+	ld	[%sp + 80], %fsr
+	stx	%o2, [%sp + 72]
+	fabsd	%f0, %f14
+	ldd	[%sp + 72], %f16
+	fcmpd	%fcc3, %f14, %f16
+	fmovduge %fcc3, ZERO, %f16
+	fand	%f0, SIGN_BIT, SIGN_BIT
+	for	%f16, SIGN_BIT, %f16
+	faddd	%f0, %f16, %f6
+	fsubd	%f6, %f16, %f0
+	fabsd	%f0, %f0
+	for	%f0, SIGN_BIT, %f0
+	retl
+	 ld	[%sp + 88], %fsr
+END (__nearbyint)
+weak_alias (__nearbyint, nearbyint)
+
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1)
+#endif

Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,64 @@
+/* Round float to int floating-point values without generating
+   an inexact exception, sparc32 v9 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 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)
+	st	%fsr, [%sp + 88]
+	st	%o0, [%sp + 68]
+	sethi	%hi(TWO_TWENTYTHREE), %o2
+	sethi	%hi(0xf8003e0), %o5
+	ld	[%sp + 88], %o4
+	fzeros	ZERO
+	or	%o5, %lo(0xf8003e0), %o5
+	fnegs	ZERO, SIGN_BIT
+	andn	%o4, %o5, %o4
+	st	%o4, [%sp + 80]
+	ld	[%sp + 68], %f1
+	ld	[%sp + 80], %fsr
+	st	%o2, [%sp + 68]
+	fabss	%f1, %f14
+	ld	[%sp + 68], %f16
+	fcmps	%fcc3, %f14, %f16
+	fmovsuge %fcc3, ZERO, %f16
+	fands	%f1, SIGN_BIT, SIGN_BIT
+	fors	%f16, SIGN_BIT, %f16
+	fadds	%f1, %f16, %f5
+	fsubs	%f5, %f16, %f0
+	fabss	%f0, %f0
+	fors	%f0, SIGN_BIT, %f0
+	retl
+	 ld	[%sp + 88], %fsr
+END (__nearbyintf)
+weak_alias (__nearbyintf, nearbyintf)

Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,64 @@
+/* Truncate argument to nearest integral value not larger than
+   the argument, sparc32 v9 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2013.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <math_ldbl_opt.h>
+
+	/* We pop constants into the FPU registers using the incoming
+	   argument stack slots, since this avoid having to use any PIC
+	   references.  We also thus avoid having to allocate a register
+	   window.
+
+	   VIS instructions are used to facilitate the formation of
+	   easier constants, and the propagation of the sign bit.  */
+
+#define TWO_FIFTYTWO	0x43300000		/* 2**52 */
+
+#define ZERO		%f10			/* 0.0 */
+#define SIGN_BIT	%f12			/* -0.0 */
+
+ENTRY (__trunc)
+	sethi	%hi(TWO_FIFTYTWO), %o2
+	sllx	%o0, 32, %o0
+	or	%o0, %o1, %o0
+	fzero	ZERO
+	stx	%o0, [%sp + 72]
+	sllx	%o2, 32, %o2
+	fnegd	ZERO, SIGN_BIT
+	ldd	[%sp + 72], %f0
+	stx	%o2, [%sp + 72]
+	fabsd	%f0, %f14
+	ldd	[%sp + 72], %f16
+	fcmpd	%fcc3, %f14, %f16
+	fmovduge %fcc3, ZERO, %f14
+	fand	%f0, SIGN_BIT, SIGN_BIT
+	fdtox	%f14, %f14
+	fxtod	%f14, %f14
+	faddd	%f0, ZERO, %f18
+	fmovduge %fcc3, %f18, %f14
+	retl
+	 for	%f14, SIGN_BIT, %f0
+END (__trunc)
+weak_alias (__trunc, trunc)
+
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
+#endif

Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,56 @@
+/* Truncate argument to nearest integral value not larger than
+   the argument, sparc32 v9 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2013.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+	/* We pop constants into the FPU registers using the incoming
+	   argument stack slots, since this avoid having to use any PIC
+	   references.  We also thus avoid having to allocate a register
+	   window.
+
+	   VIS instructions are used to facilitate the formation of
+	   easier constants, and the propagation of the sign bit.  */
+
+#define TWO_TWENTYTHREE	0x4b000000		/* 2**23 */
+
+#define ZERO		%f10			/* 0.0 */
+#define SIGN_BIT	%f12			/* -0.0 */
+
+ENTRY (__truncf)
+	st	%o0, [%sp + 68]
+	sethi	%hi(TWO_TWENTYTHREE), %o2
+	fzeros	ZERO
+	ld	[%sp + 68], %f1
+	fnegs	ZERO, SIGN_BIT
+	st	%o2, [%sp + 68]
+	fabss	%f1, %f14
+	ld	[%sp + 68], %f16
+	fcmps	%fcc3, %f14, %f16
+	fmovsuge %fcc3, ZERO, %f14
+	fands	%f1, SIGN_BIT, SIGN_BIT
+	fstoi	%f14, %f14
+	fitos	%f14, %f14
+	fadds	%f1, ZERO, %f18
+	fmovsuge %fcc3, %f18, %f14
+	retl
+	 fors	%f14, SIGN_BIT, %f0
+END (__truncf)
+weak_alias (__truncf, truncf)

Modified: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/Makefile (original)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/Makefile Thu Jan 17 00:01:51 2013
@@ -9,7 +9,8 @@
 			s_lrintf-vis3 s_lrint-vis3 s_rintf-vis3 \
 			s_rint-vis3 s_fminf-vis3 s_fmin-vis3 \
 			s_fmaxf-vis3 s_fmax-vis3 s_fmaf-vis3 \
-			s_fma-vis3
+			s_fma-vis3 s_nearbyint-vis3 s_nearbyintf-vis3 \
+			s_truncf-vis3 s_trunc-vis3
 sysdep_routines += s_signbitf-vis3 s_signbit-vis3 s_finitef-vis3 \
 		   s_finite-vis3 s_isinff-vis3 s_isinf-vis3 \
 		   s_isnanf-vis3 s_isnan-vis3

Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,61 @@
+/* Round float to int floating-point values without generating
+   an inexact exception, sparc64 vis3 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 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)
+	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)

Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S Thu Jan 17 00:01:51 2013
@@ -1,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"

Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,60 @@
+/* Round float to int floating-point values without generating
+   an inexact exception, sparc64 vis3 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 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)
+	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)

Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S Thu Jan 17 00:01:51 2013
@@ -1,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"

Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,53 @@
+/* Truncate argument to nearest integral value not larger than
+   the argument, sparc64 vis3 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2013.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+	/* We pop constants into the FPU registers using the incoming
+	   argument stack slots, since this avoid having to use any PIC
+	   references.  We also thus avoid having to allocate a register
+	   window.
+
+	   VIS instructions are used to facilitate the formation of
+	   easier constants, and the propagation of the sign bit.  */
+
+#define TWO_FIFTYTWO	0x43300000		/* 2**52 */
+
+#define ZERO		%f10			/* 0.0 */
+#define SIGN_BIT	%f12			/* -0.0 */
+
+ENTRY (__trunc_vis3)
+	sethi	%hi(TWO_FIFTYTWO), %o2
+	sllx	%o2, 32, %o2
+	fzero	ZERO
+	fnegd	ZERO, SIGN_BIT
+	movxtod	%o2, %f16
+	fabsd	%f0, %f14
+	fcmpd	%fcc3, %f14, %f16
+	fmovduge %fcc3, ZERO, %f14
+	fand	%f0, SIGN_BIT, SIGN_BIT
+	fdtox	%f14, %f14
+	fxtod	%f14, %f14
+	faddd	%f0, ZERO, %f18
+	fmovduge %fcc3, %f18, %f14
+	retl
+	 for	%f14, SIGN_BIT, %f0
+END (__trunc_vis3)

Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(trunc)
+
+weak_alias (__trunc, trunc)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __trunc __trunc_generic
+
+#include "../s_trunc.S"

Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,52 @@
+/* Truncate argument to nearest integral value not larger than
+   the argument, sparc64 vis3 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2013.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+	/* We pop constants into the FPU registers using the incoming
+	   argument stack slots, since this avoid having to use any PIC
+	   references.  We also thus avoid having to allocate a register
+	   window.
+
+	   VIS instructions are used to facilitate the formation of
+	   easier constants, and the propagation of the sign bit.  */
+
+#define TWO_TWENTYTHREE	0x4b000000		/* 2**23 */
+
+#define ZERO		%f10			/* 0.0 */
+#define SIGN_BIT	%f12			/* -0.0 */
+
+ENTRY (__truncf_vis3)
+	sethi	%hi(TWO_TWENTYTHREE), %o2
+	fzeros	ZERO
+	fnegs	ZERO, SIGN_BIT
+	movwtos	%o2,%f16
+	fabss	%f1, %f14
+	fcmps	%fcc3, %f14, %f16
+	fmovsuge %fcc3, ZERO, %f14
+	fands	%f1, SIGN_BIT, SIGN_BIT
+	fstoi	%f14, %f14
+	fitos	%f14, %f14
+	fadds	%f1, ZERO, %f18
+	fmovsuge %fcc3, %f18, %f14
+	retl
+	 fors	%f14, SIGN_BIT, %f0
+END (__truncf_vis3)

Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(truncf)
+
+weak_alias (__truncf, truncf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __truncf __truncf_generic
+
+#include "../s_truncf.S"

Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_nearbyint.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_nearbyint.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_nearbyint.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,63 @@
+/* Round float to int floating-point values without generating
+   an inexact exception, sparc64 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 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)
+	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
+	stx	%o2, [%sp + STACK_BIAS + 128]
+	stx	%o4, [%sp + STACK_BIAS + 136]
+	ldx	[%sp + STACK_BIAS + 136], %fsr
+	fabsd	%f0, %f14
+	ldd	[%sp + STACK_BIAS + 128], %f16
+	fcmpd	%fcc3, %f14, %f16
+	fmovduge %fcc3, ZERO, %f16
+	fand	%f0, SIGN_BIT, SIGN_BIT
+	for	%f16, SIGN_BIT, %f16
+	faddd	%f0, %f16, %f6
+	fsubd	%f6, %f16, %f0
+	fabsd	%f0, %f0
+	for	%f0, SIGN_BIT, %f0
+	retl
+	 ldx	[%sp + STACK_BIAS + 144], %fsr
+END (__nearbyint)
+weak_alias (__nearbyint, nearbyint)

Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,62 @@
+/* Round float to int floating-point values without generating
+   an inexact exception, sparc64 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 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)
+	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
+	st	%o2, [%sp + STACK_BIAS + 128]
+	stx	%o4, [%sp + STACK_BIAS + 136]
+	ldx	[%sp + STACK_BIAS + 136], %fsr
+	fabss	%f1, %f14
+	ld	[%sp + STACK_BIAS + 128], %f16
+	fcmps	%fcc3, %f14, %f16
+	fmovsuge %fcc3, ZERO, %f16
+	fands	%f1, SIGN_BIT, SIGN_BIT
+	fors	%f16, SIGN_BIT, %f16
+	fadds	%f1, %f16, %f5
+	fsubs	%f5, %f16, %f0
+	fabss	%f0, %f0
+	fors	%f0, SIGN_BIT, %f0
+	retl
+	 ldx	[%sp + STACK_BIAS + 144], %fsr
+END (__nearbyintf)
+weak_alias (__nearbyintf, nearbyintf)

Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_trunc.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_trunc.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_trunc.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,55 @@
+/* Truncate argument to nearest integral value not larger than
+   the argument, sparc64 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2013.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+	/* We pop constants into the FPU registers using the incoming
+	   argument stack slots, since this avoid having to use any PIC
+	   references.  We also thus avoid having to allocate a register
+	   window.
+
+	   VIS instructions are used to facilitate the formation of
+	   easier constants, and the propagation of the sign bit.  */
+
+#define TWO_FIFTYTWO	0x43300000		/* 2**52 */
+
+#define ZERO		%f10			/* 0.0 */
+#define SIGN_BIT	%f12			/* -0.0 */
+
+ENTRY (__trunc)
+	sethi	%hi(TWO_FIFTYTWO), %o2
+	sllx	%o2, 32, %o2
+	fzero	ZERO
+	fnegd	ZERO, SIGN_BIT
+	stx	%o2, [%sp + STACK_BIAS + 128]
+	fabsd	%f0, %f14
+	ldd	[%sp + STACK_BIAS + 128], %f16
+	fcmpd	%fcc3, %f14, %f16
+	fmovduge %fcc3, ZERO, %f14
+	fand	%f0, SIGN_BIT, SIGN_BIT
+	fdtox	%f14, %f14
+	fxtod	%f14, %f14
+	faddd	%f0, ZERO, %f18
+	fmovduge %fcc3, %f18, %f14
+	retl
+	 for	%f14, SIGN_BIT, %f0
+END (__trunc)
+weak_alias (__trunc, trunc)

Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_truncf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_truncf.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_truncf.S Thu Jan 17 00:01:51 2013
@@ -1,0 +1,54 @@
+/* Truncate argument to nearest integral value not larger than
+   the argument, sparc64 version.
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2013.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+	/* We pop constants into the FPU registers using the incoming
+	   argument stack slots, since this avoid having to use any PIC
+	   references.  We also thus avoid having to allocate a register
+	   window.
+
+	   VIS instructions are used to facilitate the formation of
+	   easier constants, and the propagation of the sign bit.  */
+
+#define TWO_TWENTYTHREE	0x4b000000		/* 2**23 */
+
+#define ZERO		%f10			/* 0.0 */
+#define SIGN_BIT	%f12			/* -0.0 */
+
+ENTRY (__truncf)
+	sethi	%hi(TWO_TWENTYTHREE), %o2
+	fzeros	ZERO
+	fnegs	ZERO, SIGN_BIT
+	st	%o2, [%sp + STACK_BIAS + 128]
+	fabss	%f1, %f14
+	ld	[%sp + STACK_BIAS + 128], %f16
+	fcmps	%fcc3, %f14, %f16
+	fmovsuge %fcc3, ZERO, %f14
+	fands	%f1, SIGN_BIT, SIGN_BIT
+	fstoi	%f14, %f14
+	fitos	%f14, %f14
+	fadds	%f1, ZERO, %f18
+	fmovsuge %fcc3, %f18, %f14
+	retl
+	 fors	%f14, SIGN_BIT, %f0
+END (__truncf)
+weak_alias (__truncf, truncf)

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits