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

[commits] r10380 - in /fsf/trunk/ports: ./ sysdeps/alpha/ sysdeps/alpha/alphaev6/ sysdeps/alpha/fpu/ sysdeps/unix/sysv/linux/alpha/



Author: eglibc
Date: Wed May  5 00:04:03 2010
New Revision: 10380

Log:
Import glibc-ports-mainline for 2010-05-05

Added:
    fsf/trunk/ports/sysdeps/alpha/dl-procinfo.c
    fsf/trunk/ports/sysdeps/alpha/dl-procinfo.h
Modified:
    fsf/trunk/ports/ChangeLog.alpha
    fsf/trunk/ports/sysdeps/alpha/alphaev6/memchr.S
    fsf/trunk/ports/sysdeps/alpha/dl-machine.h
    fsf/trunk/ports/sysdeps/alpha/fpu/s_ceil.c
    fsf/trunk/ports/sysdeps/alpha/fpu/s_ceilf.c
    fsf/trunk/ports/sysdeps/alpha/fpu/s_floor.c
    fsf/trunk/ports/sysdeps/alpha/fpu/s_floorf.c
    fsf/trunk/ports/sysdeps/alpha/fpu/s_rint.c
    fsf/trunk/ports/sysdeps/alpha/fpu/s_rintf.c
    fsf/trunk/ports/sysdeps/alpha/memchr.S
    fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/fxstat.c
    fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/fxstatat.c
    fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h
    fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/lxstat.c
    fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/xstat.c
    fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.c
    fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.h

Modified: fsf/trunk/ports/ChangeLog.alpha
==============================================================================
--- fsf/trunk/ports/ChangeLog.alpha (original)
+++ fsf/trunk/ports/ChangeLog.alpha Wed May  5 00:04:03 2010
@@ -1,3 +1,39 @@
+2010-05-03  Aurelien Jarno  <aurelien@xxxxxxxxxxx>
+ 
+	* sysdeps/alpha/memchr.S: Use prefetch load.
+	* sysdeps/alpha/alphaev6/memchr.S: Likewise.
+
+2010-05-03  Aurelien Jarno  <aurelien@xxxxxxxxxxx>
+
+ 	[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@xxxxxxxxxxx>
+
+	[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.
+	* 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@xxxxxxxxxxxx>
+
+	[BZ #1026]
+	* 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@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/alpha/bits/socket.h (MSG_WAITFORONE): New.

Modified: fsf/trunk/ports/sysdeps/alpha/alphaev6/memchr.S
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/alphaev6/memchr.S (original)
+++ fsf/trunk/ports/sysdeps/alpha/alphaev6/memchr.S Wed May  5 00:04:03 2010
@@ -127,7 +127,7 @@
         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 @@
 	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 :
+	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 :
+
+$odd_quad_count:
+	ldq	$1, 0($0)	# L : load quad
+	xor	$17, $1, $2	# E :
+	ldq	$31, 8($0)	# L : prefetch $4
 	cmpbge	$31, $2, $2	# E :
-	bne	$2, $found_it	# U : U L U L
 
+	addq	$0, 8, $6	# E :
+	bne	$2, $found_it	# U :
+	cmpult	$6, $18, $6	# E :
 	addq	$0, 8, $0	# E :
+
+	bne	$6, $unrolled_loop # U :
 	nop			# E :
 	nop			# E :
 	nop			# E :
 
-$odd_quad_count:
-	xor	$17, $1, $2	# E :
-	ldq	$4, 8($0)	# L : prefetch $4
-	cmpbge	$31, $2, $2	# 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 :
 

Modified: fsf/trunk/ports/sysdeps/alpha/dl-machine.h
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/dl-machine.h (original)
+++ fsf/trunk/ports/sysdeps/alpha/dl-machine.h Wed May  5 00:04:03 2010
@@ -249,6 +249,18 @@
 /* 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

Added: fsf/trunk/ports/sysdeps/alpha/dl-procinfo.c
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/dl-procinfo.c (added)
+++ fsf/trunk/ports/sysdeps/alpha/dl-procinfo.c Wed May  5 00:04:03 2010
@@ -1,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@xxxxxxxxxxx>, 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

Added: fsf/trunk/ports/sysdeps/alpha/dl-procinfo.h
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/dl-procinfo.h (added)
+++ fsf/trunk/ports/sysdeps/alpha/dl-procinfo.h Wed May  5 00:04:03 2010
@@ -1,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@xxxxxxxxxxx>, 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 */

Modified: fsf/trunk/ports/sysdeps/alpha/fpu/s_ceil.c
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/fpu/s_ceil.c (original)
+++ fsf/trunk/ports/sysdeps/alpha/fpu/s_ceil.c Wed May  5 00:04:03 2010
@@ -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));
+	     "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. */
-  return copysign (r, 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)

Modified: fsf/trunk/ports/sysdeps/alpha/fpu/s_ceilf.c
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/fpu/s_ceilf.c (original)
+++ fsf/trunk/ports/sysdeps/alpha/fpu/s_ceilf.c Wed May  5 00:04:03 2010
@@ -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));
+	     "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. */
-  return copysignf (r, 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)

Modified: fsf/trunk/ports/sysdeps/alpha/fpu/s_floor.c
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/fpu/s_floor.c (original)
+++ fsf/trunk/ports/sysdeps/alpha/fpu/s_floor.c Wed May  5 00:04:03 2010
@@ -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));
+	     "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.  */
-  return copysign (r, 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)

Modified: fsf/trunk/ports/sysdeps/alpha/fpu/s_floorf.c
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/fpu/s_floorf.c (original)
+++ fsf/trunk/ports/sysdeps/alpha/fpu/s_floorf.c Wed May  5 00:04:03 2010
@@ -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));
+	     "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.  */
-  return copysignf (r, 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)

Modified: fsf/trunk/ports/sysdeps/alpha/fpu/s_rint.c
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/fpu/s_rint.c (original)
+++ fsf/trunk/ports/sysdeps/alpha/fpu/s_rint.c Wed May  5 00:04:03 2010
@@ -24,15 +24,24 @@
 double
 __rint (double x)
 {
-  double two52 = copysign (0x1.0p52, x);
-  double r;
-  
-  r = x + two52;
-  r = r - two52;
+  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.  */
-  return copysign (r, 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)

Modified: fsf/trunk/ports/sysdeps/alpha/fpu/s_rintf.c
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/fpu/s_rintf.c (original)
+++ fsf/trunk/ports/sysdeps/alpha/fpu/s_rintf.c Wed May  5 00:04:03 2010
@@ -23,15 +23,30 @@
 float
 __rintf (float x)
 {
-  float two23 = copysignf (0x1.0p23, x);
-  float r;
+  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.  */
 
-  r = x + two23;
-  r = r - two23;
+      float tmp1, tmp2, new_x;
 
-  /* rint(-0.1) == -0, and in general we'll always have the same sign
-     as our input.  */
-  return copysign (r, 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)

Modified: fsf/trunk/ports/sysdeps/alpha/memchr.S
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/memchr.S (original)
+++ fsf/trunk/ports/sysdeps/alpha/memchr.S Wed May  5 00:04:03 2010
@@ -119,7 +119,7 @@
 
 	# 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 @@
 
 	# 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 @@
 	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:

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/fxstat.c
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/fxstat.c (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/fxstat.c Wed May  5 00:04:03 2010
@@ -35,27 +35,39 @@
 __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)

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/fxstatat.c
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/fxstatat.c (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/fxstatat.c Wed May  5 00:04:03 2010
@@ -71,6 +71,20 @@
   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 @@
 	goto fail;
       __libc_missing_axp_stat64 = 1;
     }
+#endif
 
   if (flag & AT_SYMLINK_NOFOLLOW)
     result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst);

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h Wed May  5 00:04:03 2010
@@ -27,6 +27,11 @@
    cannot be distinguished from 2.6.0.  */
 #if __LINUX_KERNEL_VERSION >= 132609
 # 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

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/lxstat.c
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/lxstat.c (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/lxstat.c Wed May  5 00:04:03 2010
@@ -35,27 +35,39 @@
 __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)

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/xstat.c
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/xstat.c (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/xstat.c Wed May  5 00:04:03 2010
@@ -35,27 +35,39 @@
 __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)

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.c
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.c (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.c Wed May  5 00:04:03 2010
@@ -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)

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.h
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.h (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/xstatconv.h Wed May  5 00:04:03 2010
@@ -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;