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]

Community source repository for glibc add-on ports branch, master, updated. glibc-2.11-93-g9f99a41


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 "Community source repository for glibc add-on ports".

The branch, master has been updated
       via  9f99a411e6a5b94cf14cecefccb12515c487ddfa (commit)
       via  200b5faee1cfac10d831e9b278ef294ca3119f53 (commit)
       via  2ec03f509faf40847d3b18b3dd51d0b003e935c8 (commit)
       via  116ff9ad1801108d084fd9ff94241f26a33dff1c (commit)
       via  6a84c77c7162a3bef67c5faf7e27457e2fb5fff7 (commit)
      from  b1ab8c5fd986325e22aba86ec54aa4df6695b555 (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://sources.redhat.com/git/gitweb.cgi?p=glibc-ports.git;a=commitdiff;h=9f99a411e6a5b94cf14cecefccb12515c487ddfa

commit 9f99a411e6a5b94cf14cecefccb12515c487ddfa
Author: Richard Henderson <rth@twiddle.net>
Date:   Tue May 4 09:12:27 2010 -0700

    Add BZ markers.

diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index 39d5816..769be8b 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -5,12 +5,14 @@
 
 2010-05-03  Aurelien Jarno  <aurelien@aurel32.net>
 
+ 	[BZ #6827]
 	* sysdeps/alpha/dl-machine.h: Add dl-procinfo support.
 	* sysdeps/alpha/dl-procinfo.c: New.
 	* sysdeps/alpha/dl-procinfo.h: New.
 
 2010-05-03  Aurelien Jarno  <aurelien@aurel32.net>
 
+	[BZ #5350]
 	* sysdeps/alpha/fpu/s_ceil.c: Fix corner cases.
 	* sysdeps/alpha/fpu/s_ceilf.c: Likewise.
 	* sysdeps/alpha/fpu/s_floor.c: Likewise.
@@ -20,6 +22,7 @@
 
 2010-05-03  GOTO Masanori  <gotom@debian.or.jp>
 
+	[BZ #1026]
 	* sysdeps/unix/sysv/linux/alpha/kernel-features.h: Define
 	__ASSUME_STAT64_SYSCALL.
 	* sysdeps/unix/sysv/linux/alpha/fxstat.c: Check

http://sources.redhat.com/git/gitweb.cgi?p=glibc-ports.git;a=commitdiff;h=200b5faee1cfac10d831e9b278ef294ca3119f53

commit 200b5faee1cfac10d831e9b278ef294ca3119f53
Author: Richard Henderson <rth@twiddle.net>
Date:   Tue May 4 09:06:15 2010 -0700

    alpha: fix memchr to not cause memory faults.
    
    http://www.mail-archive.com/debian-alpha@lists.debian.org/msg25088.html
    
    Signed-off-by: Matt Turner <mattst88@gmail.com>

diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index c3bbe12..39d5816 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,4 +1,9 @@
 2010-05-03  Aurelien Jarno  <aurelien@aurel32.net>
+ 
+	* sysdeps/alpha/memchr.S: Use prefetch load.
+	* sysdeps/alpha/alphaev6/memchr.S: Likewise.
+
+2010-05-03  Aurelien Jarno  <aurelien@aurel32.net>
 
 	* sysdeps/alpha/dl-machine.h: Add dl-procinfo support.
 	* sysdeps/alpha/dl-procinfo.c: New.
diff --git a/sysdeps/alpha/alphaev6/memchr.S b/sysdeps/alpha/alphaev6/memchr.S
index 88e91fa..fe77cd8 100644
--- a/sysdeps/alpha/alphaev6/memchr.S
+++ b/sysdeps/alpha/alphaev6/memchr.S
@@ -127,7 +127,7 @@ $first_quad:
         cmpbge  $31, $1, $2	# E :
         bne     $2, $found_it	# U :
 	# At least one byte left to process.
-	ldq	$1, 8($0)	# L :
+	ldq	$31, 8($0)	# L :
 	subq	$5, 1, $18	# E : U L U L
 
 	addq	$0, 8, $0	# E :
@@ -143,38 +143,38 @@ $first_quad:
 	and	$4, 8, $4	# E : odd number of quads?
 	bne	$4, $odd_quad_count # U :
 	# At least three quads remain to be accessed
-	mov	$1, $4		# E : L U L U : move prefetched value to correct reg
+	nop			# E : L U L U : move prefetched value to correct reg
 
 	.align	4
 $unrolled_loop:
-	ldq	$1, 8($0)	# L : prefetch $1
-	xor	$17, $4, $2	# E :
-	cmpbge	$31, $2, $2	# E :
-	bne	$2, $found_it	# U : U L U L
+	ldq	$1, 0($0)	# L : load quad
+	xor	$17, $1, $2	# E :
+	ldq	$31, 8($0)	# L : prefetch next quad
+	cmpbge	$31, $2, $2	# E : U L U L
 
+	bne	$2, $found_it	# U :
 	addq	$0, 8, $0	# E :
 	nop			# E :
 	nop			# E :
-	nop			# E :
 
 $odd_quad_count:
+	ldq	$1, 0($0)	# L : load quad
 	xor	$17, $1, $2	# E :
-	ldq	$4, 8($0)	# L : prefetch $4
+	ldq	$31, 8($0)	# L : prefetch $4
 	cmpbge	$31, $2, $2	# E :
-	addq	$0, 8, $6	# E :
 
+	addq	$0, 8, $6	# E :
 	bne	$2, $found_it	# U :
 	cmpult	$6, $18, $6	# E :
 	addq	$0, 8, $0	# E :
-	nop			# E :
 
 	bne	$6, $unrolled_loop # U :
-	mov	$4, $1		# E : move prefetched value into $1
 	nop			# E :
 	nop			# E :
-
-$final:	subq	$5, $0, $18	# E : $18 <- number of bytes left to do
 	nop			# E :
+
+$final:	ldq	$1, 0($0)	# L : load last quad
+	subq	$5, $0, $18	# E : $18 <- number of bytes left to do
 	nop			# E :
 	bne	$18, $last_quad	# U :
 
diff --git a/sysdeps/alpha/memchr.S b/sysdeps/alpha/memchr.S
index 5d713d5..87c7fb1 100644
--- a/sysdeps/alpha/memchr.S
+++ b/sysdeps/alpha/memchr.S
@@ -119,7 +119,7 @@ $first_quad:
 
 	# At least one byte left to process.
 
-	ldq	t0, 8(v0)	# e0	:
+	ldq	zero, 8(v0)	# e0	: prefetch next quad
 	subq	t4, 1, a2	# .. e1 :
 	addq	v0, 8, v0	#-e0	:
 
@@ -138,19 +138,19 @@ $first_quad:
 
 	# At least three quads remain to be accessed
 
-	mov	t0, t3		# e0	: move prefetched value to correct reg
-
 	.align	4
 $unrolled_loop:
-	ldq	t0, 8(v0)	#-e0	: prefetch t0
-	xor	a1, t3, t1	# .. e1 :
-	cmpbge	zero, t1, t1	# e0	:
-	bne	t1, $found_it	# .. e1 :
+	ldq	t0, 0(v0)	# e0	: load quad
+	xor	a1, t0, t1	# .. e1 :
+	ldq	zero, 8(v0)	# e0	: prefetch next quad
+	cmpbge	zero, t1, t1	# .. e1:
+	bne	t1, $found_it	# e0    :
 
-	addq	v0, 8, v0	#-e0	:
+	addq	v0, 8, v0	#    e1	:
 $odd_quad_count:
+	ldq	t0, 0(v0)	# e0	: load quad
 	xor	a1, t0, t1	# .. e1 :
-	ldq	t3, 8(v0)	# e0	: prefetch t3
+	ldq	zero, 8(v0)	# e0	: prefetch next quad
 	cmpbge	zero, t1, t1	# .. e1 :
 	addq	v0, 8, t5	#-e0	:
 	bne	t1, $found_it	# .. e1	:
@@ -159,8 +159,8 @@ $odd_quad_count:
 	addq	v0, 8, v0	# .. e1 :
 	bne	t5, $unrolled_loop #-e1 :
 
-	mov	t3, t0		# e0	: move prefetched value into t0
-$final:	subq	t4, v0, a2	# .. e1	: a2 <- number of bytes left to do
+$final:	ldq	t0, 0(v0)	# e0	: load last quad
+	subq	t4, v0, a2	# .. e1	: a2 <- number of bytes left to do
 	bne	a2, $last_quad	# e1	:
 
 $not_found:

http://sources.redhat.com/git/gitweb.cgi?p=glibc-ports.git;a=commitdiff;h=2ec03f509faf40847d3b18b3dd51d0b003e935c8

commit 2ec03f509faf40847d3b18b3dd51d0b003e935c8
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Mon May 3 23:25:06 2010 -0400

    alpha: add dl-procinfo support.
    
    Fixes glibc bug 6827.
    
    Signed-off-by: Matt Turner <mattst88@gmail.com>

diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index 8b0a824..c3bbe12 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,5 +1,11 @@
 2010-05-03  Aurelien Jarno  <aurelien@aurel32.net>
 
+	* sysdeps/alpha/dl-machine.h: Add dl-procinfo support.
+	* sysdeps/alpha/dl-procinfo.c: New.
+	* sysdeps/alpha/dl-procinfo.h: New.
+
+2010-05-03  Aurelien Jarno  <aurelien@aurel32.net>
+
 	* sysdeps/alpha/fpu/s_ceil.c: Fix corner cases.
 	* sysdeps/alpha/fpu/s_ceilf.c: Likewise.
 	* sysdeps/alpha/fpu/s_floor.c: Likewise.
diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h
index 29f500b..e4a5022 100644
--- a/sysdeps/alpha/dl-machine.h
+++ b/sysdeps/alpha/dl-machine.h
@@ -249,6 +249,18 @@ $fixup_stack:							\n\
 /* The alpha never uses Elf64_Rel relocations.  */
 #define ELF_MACHINE_NO_REL 1
 
+/* We define an initialization functions.  This is called very early in
+ *    _dl_sysdep_start.  */
+#define DL_PLATFORM_INIT dl_platform_init ()
+
+static inline void __attribute__ ((unused))
+dl_platform_init (void)
+{
+	if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
+	/* Avoid an empty string which would disturb us.  */
+		GLRO(dl_platform) = NULL;
+}
+
 /* Fix up the instructions of a PLT entry to invoke the function
    rather than the dynamic linker.  */
 static inline Elf64_Addr
diff --git a/sysdeps/alpha/dl-procinfo.c b/sysdeps/alpha/dl-procinfo.c
new file mode 100644
index 0000000..d280cb2
--- /dev/null
+++ b/sysdeps/alpha/dl-procinfo.c
@@ -0,0 +1,64 @@
+/* Data for Alpha version of processor capability information.
+   Copyright (C) 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2008.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* This information must be kept in sync with the _DL_PLATFORM_COUNT
+   definitions in procinfo.h.
+
+   If anything should be added here check whether the size of each string
+   is still ok with the given array size.
+
+   All the #ifdefs in the definitions are quite irritating but
+   necessary if we want to avoid duplicating the information.  There
+   are three different modes:
+
+   - PROCINFO_DECL is defined.  This means we are only interested in
+     declarations.
+
+   - PROCINFO_DECL is not defined:
+
+     + if SHARED is defined the file is included in an array
+       initializer.  The .element = { ... } syntax is needed.
+
+     + if SHARED is not defined a normal array initialization is
+       needed.
+  */
+
+#ifndef PROCINFO_CLASS
+#define PROCINFO_CLASS
+#endif
+
+#if !defined PROCINFO_DECL && defined SHARED
+  ._dl_alpha_platforms
+#else
+PROCINFO_CLASS const char _dl_alpha_platforms[5][5]
+#endif
+#ifndef PROCINFO_DECL
+= {
+    "ev4", "ev5", "ev56", "ev6", "ev67"
+  }
+#endif
+#if !defined SHARED || defined PROCINFO_DECL
+;
+#else
+,
+#endif
+
+#undef PROCINFO_DECL
+#undef PROCINFO_CLASS
diff --git a/sysdeps/alpha/dl-procinfo.h b/sysdeps/alpha/dl-procinfo.h
new file mode 100644
index 0000000..1372f0a
--- /dev/null
+++ b/sysdeps/alpha/dl-procinfo.h
@@ -0,0 +1,68 @@
+/* Alpha version of processor capability information handling macros.
+   Copyright (C) 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2008.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _DL_PROCINFO_H
+#define _DL_PROCINFO_H	1
+
+#include <ldsodefs.h>
+
+
+/* Mask to filter out platforms.  */
+#define _DL_HWCAP_PLATFORM    (-1ULL)
+
+#define _DL_PLATFORMS_COUNT   5
+
+static inline const char *
+__attribute__ ((unused))
+_dl_platform_string (int idx)
+{
+  return GLRO(dl_alpha_platforms)[idx];
+};
+
+static inline int
+__attribute__ ((unused, always_inline))
+_dl_string_platform (const char *str)
+{
+  int i;
+
+  if (str != NULL)
+    for (i = 0; i < _DL_PLATFORMS_COUNT; ++i)
+      {
+        if (strcmp (str, _dl_platform_string (i)) == 0)
+          return i;
+      }
+  return -1;
+};
+
+/* We cannot provide a general printing function.  */
+#define _dl_procinfo(word) -1
+
+/* There are no hardware capabilities defined.  */
+#define _dl_hwcap_string(idx) ""
+
+/* By default there is no important hardware capability.  */
+#define HWCAP_IMPORTANT (0)
+
+/* We don't have any hardware capabilities.  */
+#define _DL_HWCAP_COUNT	0
+
+#define _dl_string_hwcap(str) (-1)
+
+#endif /* dl-procinfo.h */

http://sources.redhat.com/git/gitweb.cgi?p=glibc-ports.git;a=commitdiff;h=116ff9ad1801108d084fd9ff94241f26a33dff1c

commit 116ff9ad1801108d084fd9ff94241f26a33dff1c
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Mon May 3 23:25:05 2010 -0400

    alpha: fix corner cases in ceil, floor, rint.
    
    Partial revert of bebc49030c15. Even with the revert, ceil and floor are
    still faster than libcpml's equivalent.
    
    Fixes bug 5350.
    
    Signed-off-by: Matt Turner <mattst88@gmail.com>

diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index 80236fe..8b0a824 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,3 +1,12 @@
+2010-05-03  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/alpha/fpu/s_ceil.c: Fix corner cases.
+	* sysdeps/alpha/fpu/s_ceilf.c: Likewise.
+	* sysdeps/alpha/fpu/s_floor.c: Likewise.
+	* sysdeps/alpha/fpu/s_floorf.c: Likewise.
+	* sysdeps/alpha/fpu/s_rint.c: Likewise.
+	* sysdeps/alpha/fpu/s_rintf.c: Likewise.
+
 2010-05-03  GOTO Masanori  <gotom@debian.or.jp>
 
 	* sysdeps/unix/sysv/linux/alpha/kernel-features.h: Define
diff --git a/sysdeps/alpha/fpu/s_ceil.c b/sysdeps/alpha/fpu/s_ceil.c
index 40c2379..fe20902 100644
--- a/sysdeps/alpha/fpu/s_ceil.c
+++ b/sysdeps/alpha/fpu/s_ceil.c
@@ -27,20 +27,25 @@
 double
 __ceil (double x)
 {
-  double two52 = copysign (0x1.0p52, x);
-  double r, tmp;
-  
-  __asm (
+  if (isless (fabs (x), 9007199254740992.0))	/* 1 << DBL_MANT_DIG */
+    {
+      double tmp1, new_x;
+
+      new_x = -x;
+      __asm (
 #ifdef _IEEE_FP_INEXACT
-	 "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
+	     "cvttq/svim %2,%1\n\t"
 #else
-	 "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
+	     "cvttq/svm %2,%1\n\t"
 #endif
-	 : "=&f"(r), "=&f"(tmp)
-	 : "f"(-x), "f"(-two52));
-
-  /* Fix up the negation we did above, as well as handling -0 properly. */
-  return copysign (r, x);
+	     "cvtqt/m %1,%0\n\t"
+	     : "=f"(new_x), "=&f"(tmp1)
+	     : "f"(new_x));
+
+      /* Fix up the negation we did above, as well as handling -0 properly. */
+      x = copysign(new_x, x);
+    }
+  return x;
 }
 
 weak_alias (__ceil, ceil)
diff --git a/sysdeps/alpha/fpu/s_ceilf.c b/sysdeps/alpha/fpu/s_ceilf.c
index 0df651f..c722e72 100644
--- a/sysdeps/alpha/fpu/s_ceilf.c
+++ b/sysdeps/alpha/fpu/s_ceilf.c
@@ -26,20 +26,30 @@
 float
 __ceilf (float x)
 {
-  float two23 = copysignf (0x1.0p23, x);
-  float r, tmp;
-  
-  __asm (
+  if (isless (fabsf (x), 16777216.0f))	/* 1 << FLT_MANT_DIG */
+    {
+      /* Note that Alpha S_Floating is stored in registers in a
+	 restricted T_Floating format, so we don't even need to
+	 convert back to S_Floating in the end.  The initial
+	 conversion to T_Floating is needed to handle denormals.  */
+
+      float tmp1, tmp2, new_x;
+
+      new_x = -x;
+      __asm ("cvtst/s %3,%2\n\t"
 #ifdef _IEEE_FP_INEXACT
-	 "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
+	     "cvttq/svim %2,%1\n\t"
 #else
-	 "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
+	     "cvttq/svm %2,%1\n\t"
 #endif
-	 : "=&f"(r), "=&f"(tmp)
-	 : "f"(-x), "f"(-two23));
-
-  /* Fix up the negation we did above, as well as handling -0 properly. */
-  return copysignf (r, x);
+	     "cvtqt/m %1,%0\n\t"
+	     : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
+	     : "f"(new_x));
+
+      /* Fix up the negation we did above, as well as handling -0 properly. */
+      x = copysignf(new_x, x);
+    }
+  return x;
 }
 
 weak_alias (__ceilf, ceilf)
diff --git a/sysdeps/alpha/fpu/s_floor.c b/sysdeps/alpha/fpu/s_floor.c
index 5af6386..6b16401 100644
--- a/sysdeps/alpha/fpu/s_floor.c
+++ b/sysdeps/alpha/fpu/s_floor.c
@@ -21,26 +21,32 @@
 #include <math_ldbl_opt.h>
 
 
-/* Use the -inf rounding mode conversion instructions to implement floor.  */
+/* Use the -inf rounding mode conversion instructions to implement
+   floor.  We note when the exponent is large enough that the value
+   must be integral, as this avoids unpleasant integer overflows.  */
 
 double
 __floor (double x)
 {
-  double two52 = copysign (0x1.0p52, x);
-  double r, tmp;
-  
-  __asm (
+  if (isless (fabs (x), 9007199254740992.0))	/* 1 << DBL_MANT_DIG */
+    {
+      double tmp1, new_x;
+
+      __asm (
 #ifdef _IEEE_FP_INEXACT
-	 "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
+	     "cvttq/svim %2,%1\n\t"
 #else
-	 "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
+	     "cvttq/svm %2,%1\n\t"
 #endif
-	 : "=&f"(r), "=&f"(tmp)
-	 : "f"(x), "f"(two52));
-
-  /* floor(-0) == -0, and in general we'll always have the same
-     sign as our input.  */
-  return copysign (r, x);
+	     "cvtqt/m %1,%0\n\t"
+	     : "=f"(new_x), "=&f"(tmp1)
+	     : "f"(x));
+
+      /* floor(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysign(new_x, x);
+    }
+  return x;
 }
 
 weak_alias (__floor, floor)
diff --git a/sysdeps/alpha/fpu/s_floorf.c b/sysdeps/alpha/fpu/s_floorf.c
index 8b42170..5da08ae 100644
--- a/sysdeps/alpha/fpu/s_floorf.c
+++ b/sysdeps/alpha/fpu/s_floorf.c
@@ -20,26 +20,37 @@
 #include <math.h>
 
 
-/* Use the -inf rounding mode conversion instructions to implement floor.  */
+/* Use the -inf rounding mode conversion instructions to implement
+   floor.  We note when the exponent is large enough that the value
+   must be integral, as this avoids unpleasant integer overflows.  */
 
 float
 __floorf (float x)
 {
-  float two23 = copysignf (0x1.0p23, x);
-  float r, tmp;
-  
-  __asm (
+  if (isless (fabsf (x), 16777216.0f))	/* 1 << FLT_MANT_DIG */
+    {
+      /* Note that Alpha S_Floating is stored in registers in a
+	 restricted T_Floating format, so we don't even need to
+	 convert back to S_Floating in the end.  The initial
+	 conversion to T_Floating is needed to handle denormals.  */
+
+      float tmp1, tmp2, new_x;
+
+      __asm ("cvtst/s %3,%2\n\t"
 #ifdef _IEEE_FP_INEXACT
-	 "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
+	     "cvttq/svim %2,%1\n\t"
 #else
-	 "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
+	     "cvttq/svm %2,%1\n\t"
 #endif
-	 : "=&f"(r), "=&f"(tmp)
-	 : "f"(x), "f"(two23));
-
-  /* floor(-0) == -0, and in general we'll always have the same
-     sign as our input.  */
-  return copysignf (r, x);
+	     "cvtqt/m %1,%0\n\t"
+	     : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
+	     : "f"(x));
+
+      /* floor(-0) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysignf(new_x, x);
+    }
+  return x;
 }
 
 weak_alias (__floorf, floorf)
diff --git a/sysdeps/alpha/fpu/s_rint.c b/sysdeps/alpha/fpu/s_rint.c
index e9aa028..9624631 100644
--- a/sysdeps/alpha/fpu/s_rint.c
+++ b/sysdeps/alpha/fpu/s_rint.c
@@ -24,15 +24,24 @@
 double
 __rint (double x)
 {
-  double two52 = copysign (0x1.0p52, x);
-  double r;
-  
-  r = x + two52;
-  r = r - two52;
-
-  /* rint(-0.1) == -0, and in general we'll always have the same sign
-     as our input.  */
-  return copysign (r, x);
+  if (isless (fabs (x), 9007199254740992.0))	/* 1 << DBL_MANT_DIG */
+    {
+      double tmp1, new_x;
+      __asm (
+#ifdef _IEEE_FP_INEXACT
+	     "cvttq/svid %2,%1\n\t"
+#else
+	     "cvttq/svd %2,%1\n\t"
+#endif
+	     "cvtqt/d %1,%0\n\t"
+	     : "=f"(new_x), "=&f"(tmp1)
+	     : "f"(x));
+
+      /* rint(-0.1) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysign(new_x, x);
+    }
+  return x;
 }
 
 weak_alias (__rint, rint)
diff --git a/sysdeps/alpha/fpu/s_rintf.c b/sysdeps/alpha/fpu/s_rintf.c
index 9e4cbd1..39fb72f 100644
--- a/sysdeps/alpha/fpu/s_rintf.c
+++ b/sysdeps/alpha/fpu/s_rintf.c
@@ -23,15 +23,30 @@
 float
 __rintf (float x)
 {
-  float two23 = copysignf (0x1.0p23, x);
-  float r;
-
-  r = x + two23;
-  r = r - two23;
-
-  /* rint(-0.1) == -0, and in general we'll always have the same sign
-     as our input.  */
-  return copysign (r, x);
+  if (isless (fabsf (x), 16777216.0f))	/* 1 << FLT_MANT_DIG */
+    {
+      /* Note that Alpha S_Floating is stored in registers in a
+	 restricted T_Floating format, so we don't even need to
+	 convert back to S_Floating in the end.  The initial
+	 conversion to T_Floating is needed to handle denormals.  */
+
+      float tmp1, tmp2, new_x;
+
+      __asm ("cvtst/s %3,%2\n\t"
+#ifdef _IEEE_FP_INEXACT
+	     "cvttq/svid %2,%1\n\t"
+#else
+	     "cvttq/svd %2,%1\n\t"
+#endif
+	     "cvtqt/d %1,%0\n\t"
+	     : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
+	     : "f"(x));
+
+      /* rint(-0.1) == -0, and in general we'll always have the same
+	 sign as our input.  */
+      x = copysignf(new_x, x);
+    }
+  return x;
 }
 
 weak_alias (__rintf, rintf)

http://sources.redhat.com/git/gitweb.cgi?p=glibc-ports.git;a=commitdiff;h=6a84c77c7162a3bef67c5faf7e27457e2fb5fff7

commit 6a84c77c7162a3bef67c5faf7e27457e2fb5fff7
Author: GOTO Masanori <gotom@debian.or.jp>
Date:   Mon May 3 23:25:04 2010 -0400

    alpha: fix *xstat.c build failure for Linux headers < 2.6.4
    
    Fixes glibc bug 1026.
    http://sourceware.org/ml/libc-alpha/2005-02/msg00122.html
    
    Signed-off-by: Matt Turner <mattst88@gmail.com>

diff --git a/ChangeLog.alpha b/ChangeLog.alpha
index 80c57d3..80236fe 100644
--- a/ChangeLog.alpha
+++ b/ChangeLog.alpha
@@ -1,3 +1,16 @@
+2010-05-03  GOTO Masanori  <gotom@debian.or.jp>
+
+	* sysdeps/unix/sysv/linux/alpha/kernel-features.h: Define
+	__ASSUME_STAT64_SYSCALL.
+	* sysdeps/unix/sysv/linux/alpha/fxstat.c: Check
+	__ASSUME_STAT64_SYSCALL.
+	* sysdeps/unix/sysv/linux/alpha/fxstatat.c: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/lxstat.c: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/xstat.c: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/xstatconv.c: Don't define
+	__libc_missing_axp_stat64 when it's not	needed.
+	* sysdeps/unix/sysv/linux/alpha/xstatconv.h: Likewise.
+
 2010-03-30  Richard Henderson  <rth@redhat.com>
 
 	* sysdeps/unix/sysv/linux/alpha/bits/socket.h (MSG_WAITFORONE): New.
diff --git a/sysdeps/unix/sysv/linux/alpha/fxstat.c b/sysdeps/unix/sysv/linux/alpha/fxstat.c
index 40e08fd..1989867 100644
--- a/sysdeps/unix/sysv/linux/alpha/fxstat.c
+++ b/sysdeps/unix/sysv/linux/alpha/fxstat.c
@@ -35,27 +35,39 @@ int
 __fxstat (int vers, int fd, struct stat *buf)
 {
   INTERNAL_SYSCALL_DECL (err);
-  int result, errno_out;
+  int result;
   struct kernel_stat kbuf;
 
+#if __ASSUME_STAT64_SYSCALL > 0
+  if (vers == _STAT_VER_KERNEL64)
+    {
+      result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
+      if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+	return result;
+      __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
+      return -1;
+    }
+#elif defined __NR_fstat64
   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
     {
+      int errno_out;
       result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
       if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
 	return result;
       errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
       if (errno_out != ENOSYS)
-	goto fail;
+	{
+	  __set_errno (errno_out);
+	  return -1;
+	}
       __libc_missing_axp_stat64 = 1;
     }
+#endif
 
   result = INTERNAL_SYSCALL (fstat, err, 2, fd, &kbuf);
   if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
     return __xstat_conv (vers, &kbuf, buf);
-  errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
-  
- fail:
-  __set_errno (errno_out);
+  __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
   return -1;
 }
 hidden_def (__fxstat)
diff --git a/sysdeps/unix/sysv/linux/alpha/fxstatat.c b/sysdeps/unix/sysv/linux/alpha/fxstatat.c
index 66cf4f7..6fa3aeb 100644
--- a/sysdeps/unix/sysv/linux/alpha/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/alpha/fxstatat.c
@@ -71,6 +71,20 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
   int result, errno_out;
   struct kernel_stat kst;
 
+#if __ASSUME_STAT64_SYSCALL > 0
+  if (vers == _STAT_VER_KERNEL64)
+    {
+      if (flag & AT_SYMLINK_NOFOLLOW)
+	result = INTERNAL_SYSCALL (lstat64, err, 2, file, st);
+      else
+	result = INTERNAL_SYSCALL (stat64, err, 2, file, st);
+
+      if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+	return result;
+      errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
+      goto fail;
+    }
+#elif defined __NR_stat64
   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
     {
       if (flag & AT_SYMLINK_NOFOLLOW)
@@ -85,6 +99,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
 	goto fail;
       __libc_missing_axp_stat64 = 1;
     }
+#endif
 
   if (flag & AT_SYMLINK_NOFOLLOW)
     result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst);
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/sysdeps/unix/sysv/linux/alpha/kernel-features.h
index 0f236a2..9c640f9 100644
--- a/sysdeps/unix/sysv/linux/alpha/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/alpha/kernel-features.h
@@ -29,6 +29,11 @@
 # define __ASSUME_TGKILL	1
 #endif
 
+/* Starting with version 2.6.4, the stat64 syscalls are available.  */
+#if __LINUX_KERNEL_VERSION >= 0x020604 && defined __alpha__
+# define __ASSUME_STAT64_SYSCALL   1
+#endif
+
 #define __ASSUME_UTIMES	1
 
 /* Starting with version 2.6.9, SSI_IEEE_RAISE_EXCEPTION exists.  */
diff --git a/sysdeps/unix/sysv/linux/alpha/lxstat.c b/sysdeps/unix/sysv/linux/alpha/lxstat.c
index 38fac2e..8fa5868 100644
--- a/sysdeps/unix/sysv/linux/alpha/lxstat.c
+++ b/sysdeps/unix/sysv/linux/alpha/lxstat.c
@@ -35,27 +35,39 @@ int
 __lxstat (int vers, const char *name, struct stat *buf)
 {
   INTERNAL_SYSCALL_DECL (err);
-  int result, errno_out;
+  int result;
   struct kernel_stat kbuf;
 
+#if __ASSUME_STAT64_SYSCALL > 0
+  if (vers == _STAT_VER_KERNEL64)
+    {
+      result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
+      if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+	return result;
+      __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
+      return -1;
+    }
+#elif defined __NR_lstat64
   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
     {
+      int errno_out;
       result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
       if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
 	return result;
       errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
       if (errno_out != ENOSYS)
-	goto fail;
+	{
+	  __set_errno (errno_out);
+	  return -1;
+	}
       __libc_missing_axp_stat64 = 1;
     }
+#endif
 
   result = INTERNAL_SYSCALL (lstat, err, 2, name, &kbuf);
   if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
     return __xstat_conv (vers, &kbuf, buf);
-  errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
-  
- fail:
-  __set_errno (errno_out);
+  __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
   return -1;
 }
 hidden_def (__lxstat)
diff --git a/sysdeps/unix/sysv/linux/alpha/xstat.c b/sysdeps/unix/sysv/linux/alpha/xstat.c
index b7488e4..530d399 100644
--- a/sysdeps/unix/sysv/linux/alpha/xstat.c
+++ b/sysdeps/unix/sysv/linux/alpha/xstat.c
@@ -35,27 +35,39 @@ int
 __xstat (int vers, const char *name, struct stat *buf)
 {
   INTERNAL_SYSCALL_DECL (err);
-  int result, errno_out;
+  int result;
   struct kernel_stat kbuf;
 
+#if __ASSUME_STAT64_SYSCALL > 0
+  if (vers == _STAT_VER_KERNEL64)
+    {
+      result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
+      if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+	return result;
+      __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
+      return -1;
+    }
+#elif defined __NR_stat64
   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
     {
+      int errno_out;
       result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
       if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
 	return result;
       errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
       if (errno_out != ENOSYS)
-	goto fail;
+	{
+	  __set_errno (errno_out);
+	  return -1;
+	}
       __libc_missing_axp_stat64 = 1;
     }
+#endif
 
   result = INTERNAL_SYSCALL (stat, err, 2, name, &kbuf);
   if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
     return __xstat_conv (vers, &kbuf, buf);
-  errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
-  
- fail:
-  __set_errno (errno_out);
+  __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
   return -1;
 }
 hidden_def (__xstat)
diff --git a/sysdeps/unix/sysv/linux/alpha/xstatconv.c b/sysdeps/unix/sysv/linux/alpha/xstatconv.c
index a193b62..86bb374 100644
--- a/sysdeps/unix/sysv/linux/alpha/xstatconv.c
+++ b/sysdeps/unix/sysv/linux/alpha/xstatconv.c
@@ -22,9 +22,14 @@
 #include <sys/stat.h>
 #include <kernel_stat.h>
 #include <xstatconv.h>
+#include <sys/syscall.h>
 
 
+#ifdef __NR_stat64
+# if __ASSUME_STAT64_SYSCALL == 0
 int __libc_missing_axp_stat64;
+# endif
+#endif
 
 int
 __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
diff --git a/sysdeps/unix/sysv/linux/alpha/xstatconv.h b/sysdeps/unix/sysv/linux/alpha/xstatconv.h
index 094d11e..21e1de8 100644
--- a/sysdeps/unix/sysv/linux/alpha/xstatconv.h
+++ b/sysdeps/unix/sysv/linux/alpha/xstatconv.h
@@ -18,7 +18,12 @@
    02111-1307 USA.  */
 
 #include <kernel-features.h>
+#include <sys/syscall.h>
 
+#ifdef __NR_stat64
+# if __ASSUME_STAT64_SYSCALL == 0
 extern int __libc_missing_axp_stat64 attribute_hidden;
+# endif
+#endif
 extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
   attribute_hidden;

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

Summary of changes:
 ChangeLog.alpha                                    |   36 +++++++++++
 sysdeps/alpha/alphaev6/memchr.S                    |   26 ++++----
 sysdeps/alpha/dl-machine.h                         |   12 ++++
 .../{unix/sysv/linux/arm => alpha}/dl-procinfo.c   |   19 +++---
 .../{unix/sysv/linux/arm => alpha}/dl-procinfo.h   |   65 +++++++++-----------
 sysdeps/alpha/fpu/s_ceil.c                         |   27 +++++---
 sysdeps/alpha/fpu/s_ceilf.c                        |   32 ++++++---
 sysdeps/alpha/fpu/s_floor.c                        |   32 ++++++----
 sysdeps/alpha/fpu/s_floorf.c                       |   37 +++++++----
 sysdeps/alpha/fpu/s_rint.c                         |   27 ++++++---
 sysdeps/alpha/fpu/s_rintf.c                        |   33 +++++++---
 sysdeps/alpha/memchr.S                             |   22 +++---
 sysdeps/unix/sysv/linux/alpha/fxstat.c             |   24 ++++++--
 sysdeps/unix/sysv/linux/alpha/fxstatat.c           |   15 +++++
 sysdeps/unix/sysv/linux/alpha/kernel-features.h    |    5 ++
 sysdeps/unix/sysv/linux/alpha/lxstat.c             |   24 ++++++--
 sysdeps/unix/sysv/linux/alpha/xstat.c              |   24 ++++++--
 sysdeps/unix/sysv/linux/alpha/xstatconv.c          |    5 ++
 sysdeps/unix/sysv/linux/alpha/xstatconv.h          |    5 ++
 19 files changed, 316 insertions(+), 154 deletions(-)
 copy sysdeps/{unix/sysv/linux/arm => alpha}/dl-procinfo.c (74%)
 copy sysdeps/{unix/sysv/linux/arm => alpha}/dl-procinfo.h (51%)


hooks/post-receive
-- 
Community source repository for glibc add-on ports


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