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


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

GNU C Library master sources branch rth/hpt created. glibc-2.19-685-g2ce1b6f


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

The branch, rth/hpt has been created
        at  2ce1b6f16d0cbb28c7b48889bd2d3b0d06b860c1 (commit)

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

commit 2ce1b6f16d0cbb28c7b48889bd2d3b0d06b860c1
Author: Richard Henderson <rth@twiddle.net>
Date:   Wed Jun 25 14:02:39 2014 -0700

    aarch64: Add hp-timing.h
    
    * sysdeps/aarch64/hp-timing.h: New file.

diff --git a/sysdeps/aarch64/hp-timing.h b/sysdeps/aarch64/hp-timing.h
new file mode 100644
index 0000000..18cb54f
--- /dev/null
+++ b/sysdeps/aarch64/hp-timing.h
@@ -0,0 +1,38 @@
+/* High precision, low overhead timing functions.  AArch64 version.
+   Copyright (C) 2014 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   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/>.  */
+
+#ifndef _HP_TIMING_H
+#define _HP_TIMING_H	1
+
+/* We always assume having the cycle counter register.  */
+#define HP_TIMING_AVAIL		(1)
+
+/* We indeed have inlined functions.  */
+#define HP_TIMING_INLINE	(1)
+
+/* We use 64bit values for the times.  */
+typedef unsigned long long int hp_timing_t;
+
+/* Sync the instruction stream, and read from the virtual cycle counter.  */
+#define HP_TIMING_NOW(Var) \
+  __asm__ __volatile__ ("isb; mrs %0, cntvct_el0" : "=r" (Var))
+
+#include <hp-timing-common.h>
+
+#endif	/* hp-timing.h */

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

commit f20fcbf17d001787fa57c042adc64018c952339b
Author: Richard Henderson <rth@twiddle.net>
Date:   Wed Jun 25 13:58:59 2014 -0700

    Unify hp-timing implementations
    
    Provide an hp-timing-common.h for ports to use.
    
    * sysdeps/generic/hp-timing.h: Remove dead comment.
    * sysdeps/generic/hp-timing-common.h: New file.
    * sysdeps/alpha/hp-timing.h: Include it.
    (HP_TIMING_DIFF, HP_TIMING_ACCUM_NT, HP_TIMING_PRINT): Remove.
    * sysdeps/i386/i686/hp-timing.h: Likewise.
    * sysdeps/ia64/hp-timing.h: Likewise.
    * sysdeps/powerpc/powerpc32/power4/hp-timing.h: Likewise.
    * sysdeps/powerpc/powerpc64/hp-timing.h: Likewise.
    * sysdeps/sparc/sparc32/sparcv9/hp-timing.h: Likewise.
    * sysdeps/sparc/sparc64/hp-timing.h: Likewise.
    * sysdeps/x86_64/hp-timing.h: Don't include the i686 version.
    (HP_TIMING_AVAIL, HP_TIMING_INLINE): Define.
    (hp_timing_t): New.

diff --git a/sysdeps/alpha/hp-timing.h b/sysdeps/alpha/hp-timing.h
index 9745e53..26a0287 100644
--- a/sysdeps/alpha/hp-timing.h
+++ b/sysdeps/alpha/hp-timing.h
@@ -20,42 +20,6 @@
 #ifndef _HP_TIMING_H
 #define _HP_TIMING_H	1
 
-#include <string.h>
-#include <sys/param.h>
-#include <_itoa.h>
-
-/* The macros defined here use the timestamp counter in IA-64.  They
-   provide a very accurate way to measure the time with very little
-   overhead.  The time values themself have no real meaning, only
-   differences are interesting.
-
-   The list of macros we need includes the following:
-
-   - HP_TIMING_AVAIL: test for availability.
-
-   - HP_TIMING_INLINE: this macro is non-zero if the functionality is not
-     implemented using function calls but instead uses some inlined code
-     which might simply consist of a few assembler instructions.  We have to
-     know this since we might want to use the macros here in places where we
-     cannot make function calls.
-
-   - hp_timing_t: This is the type for variables used to store the time
-     values.
-
-   - HP_TIMING_NOW: place timestamp for current time in variable given as
-     parameter.
-
-   - HP_TIMING_DIFF: compute difference between two times and store it
-     in a third.  Source and destination might overlap.
-
-   - HP_TIMING_ACCUM_NT: add time difference to another variable, without
-     being thread-safe.
-
-   - HP_TIMING_PRINT: write decimal representation of the timing value into
-     the given string.  This operation need not be inline even though
-     HP_TIMING_INLINE is specified.
-*/
-
 /* We always have the timestamp register, but it's got only a 4 second
    range.  Use it for ld.so profiling only.  */
 #define HP_TIMING_AVAIL		(0)
@@ -77,21 +41,6 @@ typedef unsigned int hp_timing_t;
     (VAR) = (int) (x_) - (int) (x_ >> 32);				      \
   } while (0)
 
-/* It's simple arithmetic for us.  */
-#define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
-
-#define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
-
-/* Print the time value.  */
-#define HP_TIMING_PRINT(Buf, Len, Val) \
-  do {									      \
-    char __buf[20];							      \
-    char *__cp = _itoa_word (Val, __buf + sizeof (__buf), 10, 0);	      \
-    int __len = (Len);							      \
-    char *__dest = (Buf);						      \
-    while (__len-- > 0 && __cp < __buf + sizeof (__buf))		      \
-      *__dest++ = *__cp++;						      \
-    memcpy (__dest, " clock cycles", MIN (__len, sizeof (" clock cycles")));  \
-  } while (0)
+#include <hp-timing-common.h>
 
 #endif	/* hp-timing.h */
diff --git a/sysdeps/generic/hp-timing.h b/sysdeps/generic/hp-timing-common.h
similarity index 55%
copy from sysdeps/generic/hp-timing.h
copy to sysdeps/generic/hp-timing-common.h
index 49ddb91..6732694 100644
--- a/sysdeps/generic/hp-timing.h
+++ b/sysdeps/generic/hp-timing-common.h
@@ -17,15 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _HP_TIMING_H
-#define _HP_TIMING_H	1
-
-
-/* There are no generic definitions for the times.  We could write something
-   using the `gettimeofday' system call where available but the overhead of
-   the system call might be too high.
-
-   In case a platform supports timers in the hardware the following macros
+/* In case a platform supports timers in the hardware the following macros
    and types must be defined:
 
    - HP_TIMING_AVAIL: test for availability.
@@ -37,33 +29,45 @@
      cannot make function calls.
 
    - hp_timing_t: This is the type for variables used to store the time
-     values.
+     values.  This type must be integral.
 
    - HP_TIMING_NOW: place timestamp for current time in variable given as
      parameter.
-
-   - HP_TIMING_DIFF: compute difference between two times and store it
-     in a third.  Source and destination might overlap.
-
-   - HP_TIMING_ACCUM_NT: add time difference to another variable, without
-     being thread-safe.
-
-   - HP_TIMING_PRINT: write decimal representation of the timing value into
-     the given string.  This operation need not be inline even though
-     HP_TIMING_INLINE is specified.
-
 */
 
-/* Provide dummy definitions.  */
-#define HP_TIMING_AVAIL		(0)
-#define HP_TIMING_INLINE	(0)
-typedef int hp_timing_t;
-#define HP_TIMING_NOW(var)
-#define HP_TIMING_DIFF(Diff, Start, End)
-#define HP_TIMING_ACCUM_NT(Sum, Diff)
-#define HP_TIMING_PRINT(Buf, Len, Val)
-
-/* Since this implementation is not available we tell the user about it.  */
-#define HP_TIMING_NONAVAIL	1
-
-#endif	/* hp-timing.h */
+/* The target supports hp-timing.  Share the common infrastructure.  */
+
+#include <string.h>
+#include <sys/param.h>
+#include <_itoa.h>
+
+/* Compute the difference between START and END, storing into DIFF.  */
+# define HP_TIMING_DIFF(Diff, Start, End) \
+  _hp_timing_diff(&(Diff), (Start), (End))
+static inline void
+_hp_timing_diff(hp_timing_t *diff, hp_timing_t s, hp_timing_t e)
+{
+  *diff = e - s;
+}
+
+/* Accumulate ADD into SUM.  No attempt is made to be thread-safe.  */
+# define HP_TIMING_ACCUM_NT(Sum, Diff) \
+  _hp_timing_accum_nt(&(Sum), (Diff))
+static inline void
+_hp_timing_accum_nt(hp_timing_t *sum, hp_timing_t add)
+{
+  *sum += add;
+}
+
+/* Write a decimal representation of the timing value into the given string.  */
+#define HP_TIMING_PRINT(D, L, V) \
+   _hp_timing_print(D, L, V)
+static inline void _hp_timing_print(char *dest, size_t len, hp_timing_t val)
+{
+  char buf[20];
+  char *cp = _itoa (val, buf + sizeof (buf), 10, 0);
+  size_t cp_len = MIN (buf + sizeof (buf) - cp, len);
+  memcpy (dest, cp, cp_len);
+  memcpy (dest + cp_len, " cycles", MIN (len - cp_len, sizeof (" cycles")));
+  dest[len - 1] = '\0';
+}
diff --git a/sysdeps/generic/hp-timing.h b/sysdeps/generic/hp-timing.h
index 49ddb91..95c051d 100644
--- a/sysdeps/generic/hp-timing.h
+++ b/sysdeps/generic/hp-timing.h
@@ -20,39 +20,9 @@
 #ifndef _HP_TIMING_H
 #define _HP_TIMING_H	1
 
-
 /* There are no generic definitions for the times.  We could write something
    using the `gettimeofday' system call where available but the overhead of
-   the system call might be too high.
-
-   In case a platform supports timers in the hardware the following macros
-   and types must be defined:
-
-   - HP_TIMING_AVAIL: test for availability.
-
-   - HP_TIMING_INLINE: this macro is non-zero if the functionality is not
-     implemented using function calls but instead uses some inlined code
-     which might simply consist of a few assembler instructions.  We have to
-     know this since we might want to use the macros here in places where we
-     cannot make function calls.
-
-   - hp_timing_t: This is the type for variables used to store the time
-     values.
-
-   - HP_TIMING_NOW: place timestamp for current time in variable given as
-     parameter.
-
-   - HP_TIMING_DIFF: compute difference between two times and store it
-     in a third.  Source and destination might overlap.
-
-   - HP_TIMING_ACCUM_NT: add time difference to another variable, without
-     being thread-safe.
-
-   - HP_TIMING_PRINT: write decimal representation of the timing value into
-     the given string.  This operation need not be inline even though
-     HP_TIMING_INLINE is specified.
-
-*/
+   the system call might be too high.  */
 
 /* Provide dummy definitions.  */
 #define HP_TIMING_AVAIL		(0)
diff --git a/sysdeps/i386/i686/hp-timing.h b/sysdeps/i386/i686/hp-timing.h
index 12c613e..512efc5 100644
--- a/sysdeps/i386/i686/hp-timing.h
+++ b/sysdeps/i386/i686/hp-timing.h
@@ -20,50 +20,6 @@
 #ifndef _HP_TIMING_H
 #define _HP_TIMING_H	1
 
-#include <string.h>
-#include <sys/param.h>
-#include <_itoa.h>
-
-/* The macros defined here use the timestamp counter in i586 and up versions
-   of the x86 processors.  They provide a very accurate way to measure the
-   time with very little overhead.  The time values themself have no real
-   meaning, only differences are interesting.
-
-   This version is for the i686 processors.  The difference to the i586
-   version is that the timerstamp register is unconditionally used.  This is
-   not the case for the i586 version where we have to perform runtime test
-   whether the processor really has this capability.  We have to make this
-   distinction since the sysdeps/i386/i586 code is supposed to work on all
-   platforms while the i686 already contains i686-specific code.
-
-   The list of macros we need includes the following:
-
-   - HP_TIMING_AVAIL: test for availability.
-
-   - HP_TIMING_INLINE: this macro is non-zero if the functionality is not
-     implemented using function calls but instead uses some inlined code
-     which might simply consist of a few assembler instructions.  We have to
-     know this since we might want to use the macros here in places where we
-     cannot make function calls.
-
-   - hp_timing_t: This is the type for variables used to store the time
-     values.
-
-   - HP_TIMING_NOW: place timestamp for current time in variable given as
-     parameter.
-
-   - HP_TIMING_DIFF: compute difference between two times and store it
-     in a third.  Source and destination might overlap.
-
-   - HP_TIMING_ACCUM_NT: add time difference to another variable, without
-     being thread-safe.
-
-   - HP_TIMING_PRINT: write decimal representation of the timing value into
-     the given string.  This operation need not be inline even though
-     HP_TIMING_INLINE is specified.
-
-*/
-
 /* We always assume having the timestamp register.  */
 #define HP_TIMING_AVAIL		(1)
 
@@ -80,21 +36,6 @@ typedef unsigned long long int hp_timing_t;
    in accurate clock cycles here so we don't do this.  */
 #define HP_TIMING_NOW(Var)	__asm__ __volatile__ ("rdtsc" : "=A" (Var))
 
-/* It's simple arithmetic for us.  */
-#define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
-
-#define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
-
-/* Print the time value.  */
-#define HP_TIMING_PRINT(Buf, Len, Val) \
-  do {									      \
-    char __buf[20];							      \
-    char *__cp = _itoa (Val, __buf + sizeof (__buf), 10, 0);		      \
-    size_t __len = (Len);						      \
-    char *__dest = (Buf);						      \
-    while (__len-- > 0 && __cp < __buf + sizeof (__buf))		      \
-      *__dest++ = *__cp++;						      \
-    memcpy (__dest, " clock cycles", MIN (__len, sizeof (" clock cycles")));  \
-  } while (0)
+#include <hp-timing-common.h>
 
 #endif	/* hp-timing.h */
diff --git a/sysdeps/ia64/hp-timing.h b/sysdeps/ia64/hp-timing.h
index 6b49ffc..3d441ff 100644
--- a/sysdeps/ia64/hp-timing.h
+++ b/sysdeps/ia64/hp-timing.h
@@ -20,44 +20,6 @@
 #ifndef _HP_TIMING_H
 #define _HP_TIMING_H	1
 
-#include <string.h>
-#include <sys/param.h>
-#include <_itoa.h>
-#include <ia64intrin.h>
-
-/* The macros defined here use the timestamp counter in IA-64.  They
-   provide a very accurate way to measure the time with very little
-   overhead.  The time values themself have no real meaning, only
-   differences are interesting.
-
-   The list of macros we need includes the following:
-
-   - HP_TIMING_AVAIL: test for availability.
-
-   - HP_TIMING_INLINE: this macro is non-zero if the functionality is not
-     implemented using function calls but instead uses some inlined code
-     which might simply consist of a few assembler instructions.  We have to
-     know this since we might want to use the macros here in places where we
-     cannot make function calls.
-
-   - hp_timing_t: This is the type for variables used to store the time
-     values.
-
-   - HP_TIMING_NOW: place timestamp for current time in variable given as
-     parameter.
-
-   - HP_TIMING_DIFF: compute difference between two times and store it
-     in a third.  Source and destination might overlap.
-
-   - HP_TIMING_ACCUM_NT: add time difference to another variable, without
-     being thread-safe.
-
-   - HP_TIMING_PRINT: write decimal representation of the timing value into
-     the given string.  This operation need not be inline even though
-     HP_TIMING_INLINE is specified.
-
-*/
-
 /* We always assume having the timestamp register.  */
 #define HP_TIMING_AVAIL		(1)
 
@@ -81,22 +43,6 @@ typedef unsigned long int hp_timing_t;
      while (REPEAT_READ (__itc));					      \
      Var = __itc; })
 
-/* It's simple arithmetic for us.  */
-#define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
-
-#define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
-
-/* Print the time value.  */
-#define HP_TIMING_PRINT(Buf, Len, Val) \
-  do {									      \
-    char __buf[20];							      \
-    char *__cp = _itoa_word (Val, __buf + sizeof (__buf), 10, 0);	      \
-    int __len = (Len);							      \
-    char *__dest = (Buf);						      \
-    while (__len-- > 0 && __cp < __buf + sizeof (__buf))		      \
-      *__dest++ = *__cp++;						      \
-    memcpy (__dest, " clock cycles", MIN (__len,			      \
-					  (int) sizeof (" clock cycles")));   \
-  } while (0)
+#include <hp-timing-common.h>
 
 #endif	/* hp-timing.h */
diff --git a/sysdeps/powerpc/powerpc32/power4/hp-timing.h b/sysdeps/powerpc/powerpc32/power4/hp-timing.h
index 702efac..f5237e3 100644
--- a/sysdeps/powerpc/powerpc32/power4/hp-timing.h
+++ b/sysdeps/powerpc/powerpc32/power4/hp-timing.h
@@ -20,43 +20,6 @@
 #ifndef _HP_TIMING_H
 #define _HP_TIMING_H	1
 
-#include <string.h>
-#include <sys/param.h>
-#include <_itoa.h>
-#include <atomic.h>
-
-/* The macros defined here use the powerpc 64-bit time base register.
-   The time base is nominally clocked at 1/8th the CPU clock, but this
-   can vary.
-
-   The list of macros we need includes the following:
-
-   - HP_TIMING_AVAIL: test for availability.
-
-   - HP_TIMING_INLINE: this macro is non-zero if the functionality is not
-     implemented using function calls but instead uses some inlined code
-     which might simply consist of a few assembler instructions.  We have to
-     know this since we might want to use the macros here in places where we
-     cannot make function calls.
-
-   - hp_timing_t: This is the type for variables used to store the time
-     values.
-
-   - HP_TIMING_NOW: place timestamp for current time in variable given as
-     parameter.
-
-   - HP_TIMING_DIFF: compute difference between two times and store it
-     in a third.  Source and destination might overlap.
-
-   - HP_TIMING_ACCUM_NT: add time difference to another variable, without
-     being thread-safe.
-
-   - HP_TIMING_PRINT: write decimal representation of the timing value into
-     the given string.  This operation need not be inline even though
-     HP_TIMING_INLINE is specified.
-
-*/
-
 /* We always assume having the timestamp register.  */
 #define HP_TIMING_AVAIL		(1)
 
@@ -85,21 +48,6 @@ typedef unsigned long long int hp_timing_t;
     Var = ((hp_timing_t) hi << 32) | lo;				\
   } while (0)
 
-/* It's simple arithmetic in 64-bit.  */
-#define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
-
-#define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
-
-/* Print the time value.  */
-#define HP_TIMING_PRINT(Buf, Len, Val) \
-  do {									      \
-    char __buf[20];							      \
-    char *__cp = _itoa (Val, __buf + sizeof (__buf), 10, 0);		      \
-    size_t __len = (Len);						      \
-    char *__dest = (Buf);						      \
-    while (__len-- > 0 && __cp < __buf + sizeof (__buf))		      \
-      *__dest++ = *__cp++;						      \
-    memcpy (__dest, " ticks", MIN (__len, sizeof (" ticks")));  \
-  } while (0)
+#include <hp-timing-common.h>
 
 #endif	/* hp-timing.h */
diff --git a/sysdeps/powerpc/powerpc64/hp-timing.h b/sysdeps/powerpc/powerpc64/hp-timing.h
index 7241b9b..d4fcb3d 100644
--- a/sysdeps/powerpc/powerpc64/hp-timing.h
+++ b/sysdeps/powerpc/powerpc64/hp-timing.h
@@ -20,43 +20,6 @@
 #ifndef _HP_TIMING_H
 #define _HP_TIMING_H	1
 
-#include <string.h>
-#include <sys/param.h>
-#include <_itoa.h>
-#include <atomic.h>
-
-/* The macros defined here use the powerpc 64-bit time base register.
-   The time base is nominally clocked at 1/8th the CPU clock, but this
-   can vary.
-
-   The list of macros we need includes the following:
-
-   - HP_TIMING_AVAIL: test for availability.
-
-   - HP_TIMING_INLINE: this macro is non-zero if the functionality is not
-     implemented using function calls but instead uses some inlined code
-     which might simply consist of a few assembler instructions.  We have to
-     know this since we might want to use the macros here in places where we
-     cannot make function calls.
-
-   - hp_timing_t: This is the type for variables used to store the time
-     values.
-
-   - HP_TIMING_NOW: place timestamp for current time in variable given as
-     parameter.
-
-   - HP_TIMING_DIFF: compute difference between two times and store it
-     in a third.  Source and destination might overlap.
-
-   - HP_TIMING_ACCUM_NT: add time difference to another variable, without
-     being thread-safe.
-
-   - HP_TIMING_PRINT: write decimal representation of the timing value into
-     the given string.  This operation need not be inline even though
-     HP_TIMING_INLINE is specified.
-
-*/
-
 /* We always assume having the timestamp register.  */
 #define HP_TIMING_AVAIL		(1)
 
@@ -77,21 +40,6 @@ typedef unsigned long long int hp_timing_t;
 #define HP_TIMING_NOW(Var)	__asm__ __volatile__ ("mftb %0" : "=r" (Var))
 #endif
 
-/* It's simple arithmetic in 64-bit.  */
-#define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
-
-#define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
-
-/* Print the time value.  */
-#define HP_TIMING_PRINT(Buf, Len, Val) \
-  do {									      \
-    char __buf[20];							      \
-    char *__cp = _itoa (Val, __buf + sizeof (__buf), 10, 0);		      \
-    size_t __len = (Len);						      \
-    char *__dest = (Buf);						      \
-    while (__len-- > 0 && __cp < __buf + sizeof (__buf))		      \
-      *__dest++ = *__cp++;						      \
-    memcpy (__dest, " ticks", MIN (__len, sizeof (" ticks")));  \
-  } while (0)
+#include <hp-timing-common.h>
 
 #endif	/* hp-timing.h */
diff --git a/sysdeps/sparc/sparc32/sparcv9/hp-timing.h b/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
index 3f63ce6..4d9188f 100644
--- a/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
+++ b/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
@@ -20,10 +20,6 @@
 #ifndef _HP_TIMING_H
 #define _HP_TIMING_H	1
 
-#include <string.h>
-#include <sys/param.h>
-#include <_itoa.h>
-
 #define HP_TIMING_AVAIL		(1)
 #define HP_TIMING_INLINE	(1)
 
@@ -34,19 +30,6 @@ typedef unsigned long long int hp_timing_t;
 			    "srlx %L0, 32, %H0" \
 			    : "=r" (Var))
 
-#define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
-
-#define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
-
-#define HP_TIMING_PRINT(Buf, Len, Val) \
-  do {									      \
-    char __buf[20];							      \
-    char *__cp = _itoa (Val, __buf + sizeof (__buf), 10, 0);		      \
-    int __len = (Len);							      \
-    char *__dest = (Buf);						      \
-    while (__len-- > 0 && __cp < __buf + sizeof (__buf))		      \
-      *__dest++ = *__cp++;						      \
-    memcpy (__dest, " clock cycles", MIN (__len, sizeof (" clock cycles")));  \
-  } while (0)
+#include <hp-timing-common.h>
 
 #endif	/* hp-timing.h */
diff --git a/sysdeps/sparc/sparc64/hp-timing.h b/sysdeps/sparc/sparc64/hp-timing.h
index 521f64e..ea3ba9b 100644
--- a/sysdeps/sparc/sparc64/hp-timing.h
+++ b/sysdeps/sparc/sparc64/hp-timing.h
@@ -20,10 +20,6 @@
 #ifndef _HP_TIMING_H
 #define _HP_TIMING_H	1
 
-#include <string.h>
-#include <sys/param.h>
-#include <_itoa.h>
-
 #define HP_TIMING_AVAIL		(1)
 #define HP_TIMING_INLINE	(1)
 
@@ -31,19 +27,6 @@ typedef unsigned long int hp_timing_t;
 
 #define HP_TIMING_NOW(Var) __asm__ __volatile__ ("rd %%tick, %0" : "=r" (Var))
 
-#define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
-
-#define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
-
-#define HP_TIMING_PRINT(Buf, Len, Val) \
-  do {									      \
-    char __buf[20];							      \
-    char *__cp = _itoa (Val, __buf + sizeof (__buf), 10, 0);		      \
-    int __len = (Len);							      \
-    char *__dest = (Buf);						      \
-    while (__len-- > 0 && __cp < __buf + sizeof (__buf))		      \
-      *__dest++ = *__cp++;						      \
-    memcpy (__dest, " clock cycles", MIN (__len, sizeof (" clock cycles")));  \
-  } while (0)
+#include <hp-timing-common.h>
 
 #endif	/* hp-timing.h */
diff --git a/sysdeps/x86_64/hp-timing.h b/sysdeps/x86_64/hp-timing.h
index e132dac..89501fc 100644
--- a/sysdeps/x86_64/hp-timing.h
+++ b/sysdeps/x86_64/hp-timing.h
@@ -17,15 +17,23 @@
    <http://www.gnu.org/licenses/>.  */
 
 #ifndef _HP_TIMING_H
+#define _HP_TIMING_H	1
 
-/* We can use some of the i686 implementation without changes.  */
-# include <sysdeps/i386/i686/hp-timing.h>
+/* We always assume having the timestamp register.  */
+#define HP_TIMING_AVAIL		(1)
+
+/* We indeed have inlined functions.  */
+#define HP_TIMING_INLINE	(1)
+
+/* We use 64bit values for the times.  */
+typedef unsigned long long int hp_timing_t;
 
 /* The "=A" constraint used in 32-bit mode does not work in 64-bit mode.  */
-# undef HP_TIMING_NOW
-# define HP_TIMING_NOW(Var) \
+#define HP_TIMING_NOW(Var) \
   ({ unsigned int _hi, _lo; \
      asm volatile ("rdtsc" : "=a" (_lo), "=d" (_hi)); \
      (Var) = ((unsigned long long int) _hi << 32) | _lo; })
 
+#include <hp-timing-common.h>
+
 #endif /* hp-timing.h */

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=846df914aa322828d08ad49b5b12f8c63f34a1b3

commit 846df914aa322828d08ad49b5b12f8c63f34a1b3
Author: Richard Henderson <rth@twiddle.net>
Date:   Wed Jun 25 12:27:16 2014 -0700

    Remove HP_TIMING_DIFF_INIT and dl_hp_timing_overhead
    
    Without HP_TIMING_ACCUM, dl_hp_timing_overhead is write-only.
    If we remove it, there's no point in HP_TIMING_DIFF_INIT either.
    
    * benchtests/bench-string.h (_dl_hp_timing_overhead): Remove.
    * benchtests/bench-timing.h (_dl_hp_timing_overhead): Remove.
    (TIMING_INIT): Remove call to HP_TIMING_DIFF_INIT.
    * elf/rtld.c (_dl_start_final): Likewise.
    * sysdeps/generic/ldsodefs.h (_dl_hp_timing_overhead): Remove.
    * sysdeps/alpha/hp-timing.h (HP_TIMING_DIFF_INIT): Remove.
    * sysdeps/generic/hp-timing.h (HP_TIMING_DIFF_INIT): Remove.
    * sysdeps/i386/i686/hp-timing.h (HP_TIMING_DIFF_INIT): Remove.
    * sysdeps/ia64/hp-timing.h (HP_TIMING_DIFF_INIT): Remove.
    * sysdeps/powerpc/powerpc32/power4/hp-timing.h (HP_TIMING_DIFF_INIT): Remove.
    * sysdeps/powerpc/powerpc64/hp-timing.h (HP_TIMING_DIFF_INIT): Remove.
    * sysdeps/sparc/sparc32/sparcv9/hp-timing.h (HP_TIMING_DIFF_INIT): Remove.
    * sysdeps/sparc/sparc64/hp-timing.h (HP_TIMING_DIFF_INIT): Remove.
    * sysdeps/i386/i686/hp-timing.c: Remove file.
    * sysdeps/x86_64/hp-timing.c: Remove file.
    * sysdeps/ia64/hp-timing.c: Remove file.
    * sysdeps/powerpc/powerpc32/power4/hp-timing.c: Remove file.
    * sysdeps/powerpc/powerpc64/hp-timing.c: Remove file.
    * sysdeps/sparc/sparc32/sparcv9/hp-timing.c: Remove file.
    * sysdeps/sparc/sparc64/hp-timing.c: Remove file.

diff --git a/benchtests/bench-string.h b/benchtests/bench-string.h
index 2609680..bdb927f 100644
--- a/benchtests/bench-string.h
+++ b/benchtests/bench-string.h
@@ -69,8 +69,6 @@ int ret, do_srandom;
 unsigned int seed;
 size_t page_size;
 
-hp_timing_t _dl_hp_timing_overhead;
-
 # ifndef ITERATIONS
 size_t iterations = 100000;
 #  define ITERATIONS_OPTIONS \
diff --git a/benchtests/bench-timing.h b/benchtests/bench-timing.h
index ccde601..87da32f 100644
--- a/benchtests/bench-timing.h
+++ b/benchtests/bench-timing.h
@@ -22,16 +22,11 @@
 #if HP_TIMING_AVAIL && !defined USE_CLOCK_GETTIME
 # define GL(x) _##x
 # define GLRO(x) _##x
-hp_timing_t _dl_hp_timing_overhead;
 typedef hp_timing_t timing_t;
 
 # define TIMING_TYPE "hp_timing"
 
-# define TIMING_INIT(res) \
-({									      \
-  HP_TIMING_DIFF_INIT();						      \
-  (res) = 1;							      \
-})
+# define TIMING_INIT(res) ({ (res) = 1; })
 
 # define TIMING_NOW(var) HP_TIMING_NOW (var)
 # define TIMING_DIFF(diff, start, end) HP_TIMING_DIFF ((diff), (start), (end))
diff --git a/elf/rtld.c b/elf/rtld.c
index 71cc0db..8239269 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -279,9 +279,6 @@ _dl_start_final (void *arg, struct dl_start_final_info *info)
       else
 	start_time = info->start_time;
 #endif
-
-      /* Initialize the timing functions.  */
-      HP_TIMING_DIFF_INIT ();
     }
 
   /* Transfer data about ourselves to the permanent link_map structure.  */
diff --git a/sysdeps/alpha/hp-timing.h b/sysdeps/alpha/hp-timing.h
index 71322f9..9745e53 100644
--- a/sysdeps/alpha/hp-timing.h
+++ b/sysdeps/alpha/hp-timing.h
@@ -45,9 +45,6 @@
    - HP_TIMING_NOW: place timestamp for current time in variable given as
      parameter.
 
-   - HP_TIMING_DIFF_INIT: do whatever is necessary to be able to use the
-     HP_TIMING_DIFF macro.
-
    - HP_TIMING_DIFF: compute difference between two times and store it
      in a third.  Source and destination might overlap.
 
@@ -80,9 +77,6 @@ typedef unsigned int hp_timing_t;
     (VAR) = (int) (x_) - (int) (x_ >> 32);				      \
   } while (0)
 
-/* ??? Two rpcc instructions can be scheduled simultaneously.  */
-#define HP_TIMING_DIFF_INIT() do { } while (0)
-
 /* It's simple arithmetic for us.  */
 #define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
 
diff --git a/sysdeps/generic/hp-timing.h b/sysdeps/generic/hp-timing.h
index 894ab17..49ddb91 100644
--- a/sysdeps/generic/hp-timing.h
+++ b/sysdeps/generic/hp-timing.h
@@ -42,9 +42,6 @@
    - HP_TIMING_NOW: place timestamp for current time in variable given as
      parameter.
 
-   - HP_TIMING_DIFF_INIT: do whatever is necessary to be able to use the
-     HP_TIMING_DIFF macro.
-
    - HP_TIMING_DIFF: compute difference between two times and store it
      in a third.  Source and destination might overlap.
 
@@ -62,7 +59,6 @@
 #define HP_TIMING_INLINE	(0)
 typedef int hp_timing_t;
 #define HP_TIMING_NOW(var)
-#define HP_TIMING_DIFF_INIT()
 #define HP_TIMING_DIFF(Diff, Start, End)
 #define HP_TIMING_ACCUM_NT(Sum, Diff)
 #define HP_TIMING_PRINT(Buf, Len, Val)
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 6cf5e1b..b928a28 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -533,11 +533,6 @@ struct rtld_global_ro
   /* All search directories defined at startup.  */
   EXTERN struct r_search_path_elem *_dl_init_all_dirs;
 
-#if HP_TIMING_AVAIL || HP_SMALL_TIMING_AVAIL
-  /* Overhead of a high-precision timing measurement.  */
-  EXTERN hp_timing_t _dl_hp_timing_overhead;
-#endif
-
 #ifdef NEED_DL_SYSINFO
   /* Syscall handling improvements.  This is very specific to x86.  */
   EXTERN uintptr_t _dl_sysinfo;
diff --git a/sysdeps/i386/i686/hp-timing.c b/sysdeps/i386/i686/hp-timing.c
deleted file mode 100644
index faa6dad..0000000
--- a/sysdeps/i386/i686/hp-timing.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Support for high precision, low overhead timing functions.  i686 version.
-   Copyright (C) 1998-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
-
-   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 <hp-timing.h>
-
-/* We have to define the variable for the overhead.  */
-hp_timing_t _dl_hp_timing_overhead;
diff --git a/sysdeps/i386/i686/hp-timing.h b/sysdeps/i386/i686/hp-timing.h
index a4b19c1..12c613e 100644
--- a/sysdeps/i386/i686/hp-timing.h
+++ b/sysdeps/i386/i686/hp-timing.h
@@ -52,9 +52,6 @@
    - HP_TIMING_NOW: place timestamp for current time in variable given as
      parameter.
 
-   - HP_TIMING_DIFF_INIT: do whatever is necessary to be able to use the
-     HP_TIMING_DIFF macro.
-
    - HP_TIMING_DIFF: compute difference between two times and store it
      in a third.  Source and destination might overlap.
 
@@ -83,25 +80,6 @@ typedef unsigned long long int hp_timing_t;
    in accurate clock cycles here so we don't do this.  */
 #define HP_TIMING_NOW(Var)	__asm__ __volatile__ ("rdtsc" : "=A" (Var))
 
-/* Use two 'rdtsc' instructions in a row to find out how long it takes.  */
-#define HP_TIMING_DIFF_INIT() \
-  do {									      \
-    if (GLRO(dl_hp_timing_overhead) == 0)				      \
-      {									      \
-	int __cnt = 5;							      \
-	GLRO(dl_hp_timing_overhead) = ~0ull;				      \
-	do								      \
-	  {								      \
-	    hp_timing_t __t1, __t2;					      \
-	    HP_TIMING_NOW (__t1);					      \
-	    HP_TIMING_NOW (__t2);					      \
-	    if (__t2 - __t1 < GLRO(dl_hp_timing_overhead))		      \
-	      GLRO(dl_hp_timing_overhead) = __t2 - __t1;		      \
-	  }								      \
-	while (--__cnt > 0);						      \
-      }									      \
-  } while (0)
-
 /* It's simple arithmetic for us.  */
 #define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
 
diff --git a/sysdeps/ia64/hp-timing.c b/sysdeps/ia64/hp-timing.c
deleted file mode 100644
index 7a661cb..0000000
--- a/sysdeps/ia64/hp-timing.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Support for high precision, low overhead timing functions.  IA-64 version.
-   Copyright (C) 2001-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 2001.
-
-   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 <hp-timing.h>
-
-/* We have to define the variable for the overhead.  */
-hp_timing_t _dl_hp_timing_overhead;
diff --git a/sysdeps/ia64/hp-timing.h b/sysdeps/ia64/hp-timing.h
index ccc49e6..6b49ffc 100644
--- a/sysdeps/ia64/hp-timing.h
+++ b/sysdeps/ia64/hp-timing.h
@@ -46,9 +46,6 @@
    - HP_TIMING_NOW: place timestamp for current time in variable given as
      parameter.
 
-   - HP_TIMING_DIFF_INIT: do whatever is necessary to be able to use the
-     HP_TIMING_DIFF macro.
-
    - HP_TIMING_DIFF: compute difference between two times and store it
      in a third.  Source and destination might overlap.
 
@@ -84,22 +81,6 @@ typedef unsigned long int hp_timing_t;
      while (REPEAT_READ (__itc));					      \
      Var = __itc; })
 
-/* Use two 'ar.itc' instructions in a row to find out how long it takes.  */
-#define HP_TIMING_DIFF_INIT() \
-  do {									      \
-    int __cnt = 5;							      \
-    GLRO(dl_hp_timing_overhead) = ~0ul;					      \
-    do									      \
-      {									      \
-	hp_timing_t __t1, __t2;						      \
-	HP_TIMING_NOW (__t1);						      \
-	HP_TIMING_NOW (__t2);						      \
-	if (__t2 - __t1 < GLRO(dl_hp_timing_overhead))			      \
-	  GLRO(dl_hp_timing_overhead) = __t2 - __t1;			      \
-      }									      \
-    while (--__cnt > 0);						      \
-  } while (0)
-
 /* It's simple arithmetic for us.  */
 #define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
 
diff --git a/sysdeps/powerpc/powerpc32/power4/hp-timing.c b/sysdeps/powerpc/powerpc32/power4/hp-timing.c
deleted file mode 100644
index fcf5e45..0000000
--- a/sysdeps/powerpc/powerpc32/power4/hp-timing.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Support for high precision, low overhead timing functions.
-   powerpc64 version.
-   Copyright (C) 2005-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
-
-   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 <hp-timing.h>
-
-/* We have to define the variable for the overhead.  */
-hp_timing_t _dl_hp_timing_overhead;
diff --git a/sysdeps/powerpc/powerpc32/power4/hp-timing.h b/sysdeps/powerpc/powerpc32/power4/hp-timing.h
index cd296c5..702efac 100644
--- a/sysdeps/powerpc/powerpc32/power4/hp-timing.h
+++ b/sysdeps/powerpc/powerpc32/power4/hp-timing.h
@@ -45,9 +45,6 @@
    - HP_TIMING_NOW: place timestamp for current time in variable given as
      parameter.
 
-   - HP_TIMING_DIFF_INIT: do whatever is necessary to be able to use the
-     HP_TIMING_DIFF macro.
-
    - HP_TIMING_DIFF: compute difference between two times and store it
      in a third.  Source and destination might overlap.
 
@@ -88,27 +85,6 @@ typedef unsigned long long int hp_timing_t;
     Var = ((hp_timing_t) hi << 32) | lo;				\
   } while (0)
 
-
-/* Use two 'mftb' instructions in a row to find out how long it takes.
-   On current POWER4, POWER5, and 970 processors mftb take ~10 cycles.  */
-#define HP_TIMING_DIFF_INIT() \
-  do {									      \
-    if (GLRO(dl_hp_timing_overhead) == 0)				      \
-      {									      \
-	int __cnt = 5;							      \
-	GLRO(dl_hp_timing_overhead) = ~0ull;				      \
-	do								      \
-	  {								      \
-	    hp_timing_t __t1, __t2;					      \
-	    HP_TIMING_NOW (__t1);					      \
-	    HP_TIMING_NOW (__t2);					      \
-	    if (__t2 - __t1 < GLRO(dl_hp_timing_overhead))		      \
-	      GLRO(dl_hp_timing_overhead) = __t2 - __t1;		      \
-	  }								      \
-	while (--__cnt > 0);						      \
-      }									      \
-  } while (0)
-
 /* It's simple arithmetic in 64-bit.  */
 #define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
 
diff --git a/sysdeps/powerpc/powerpc64/hp-timing.c b/sysdeps/powerpc/powerpc64/hp-timing.c
deleted file mode 100644
index fcf5e45..0000000
--- a/sysdeps/powerpc/powerpc64/hp-timing.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Support for high precision, low overhead timing functions.
-   powerpc64 version.
-   Copyright (C) 2005-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
-
-   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 <hp-timing.h>
-
-/* We have to define the variable for the overhead.  */
-hp_timing_t _dl_hp_timing_overhead;
diff --git a/sysdeps/powerpc/powerpc64/hp-timing.h b/sysdeps/powerpc/powerpc64/hp-timing.h
index 4cad90a..7241b9b 100644
--- a/sysdeps/powerpc/powerpc64/hp-timing.h
+++ b/sysdeps/powerpc/powerpc64/hp-timing.h
@@ -45,9 +45,6 @@
    - HP_TIMING_NOW: place timestamp for current time in variable given as
      parameter.
 
-   - HP_TIMING_DIFF_INIT: do whatever is necessary to be able to use the
-     HP_TIMING_DIFF macro.
-
    - HP_TIMING_DIFF: compute difference between two times and store it
      in a third.  Source and destination might overlap.
 
@@ -80,26 +77,6 @@ typedef unsigned long long int hp_timing_t;
 #define HP_TIMING_NOW(Var)	__asm__ __volatile__ ("mftb %0" : "=r" (Var))
 #endif
 
-/* Use two 'mftb' instructions in a row to find out how long it takes.
-   On current POWER4, POWER5, and 970 processors mftb take ~10 cycles.  */
-#define HP_TIMING_DIFF_INIT() \
-  do {									      \
-    if (GLRO(dl_hp_timing_overhead) == 0)				      \
-      {									      \
-	int __cnt = 5;							      \
-	GLRO(dl_hp_timing_overhead) = ~0ull;				      \
-	do								      \
-	  {								      \
-	    hp_timing_t __t1, __t2;					      \
-	    HP_TIMING_NOW (__t1);					      \
-	    HP_TIMING_NOW (__t2);					      \
-	    if (__t2 - __t1 < GLRO(dl_hp_timing_overhead))		      \
-	      GLRO(dl_hp_timing_overhead) = __t2 - __t1;		      \
-	  }								      \
-	while (--__cnt > 0);						      \
-      }									      \
-  } while (0)
-
 /* It's simple arithmetic in 64-bit.  */
 #define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
 
diff --git a/sysdeps/sparc/sparc32/sparcv9/hp-timing.c b/sysdeps/sparc/sparc32/sparcv9/hp-timing.c
deleted file mode 100644
index 2224099..0000000
--- a/sysdeps/sparc/sparc32/sparcv9/hp-timing.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Support for high precision, low overhead timing functions.  sparcv9 version.
-   Copyright (C) 2001-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by David S. Miller <davem@redhat.com>, 2001.
-
-   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 <hp-timing.h>
-
-/* We have to define the variable for the overhead.  */
-hp_timing_t _dl_hp_timing_overhead;
diff --git a/sysdeps/sparc/sparc32/sparcv9/hp-timing.h b/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
index c3be1ca..3f63ce6 100644
--- a/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
+++ b/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
@@ -34,21 +34,6 @@ typedef unsigned long long int hp_timing_t;
 			    "srlx %L0, 32, %H0" \
 			    : "=r" (Var))
 
-#define HP_TIMING_DIFF_INIT() \
-  do {									      \
-    int __cnt = 5;							      \
-    GLRO(dl_hp_timing_overhead) = ~0ull;				      \
-    do									      \
-      {									      \
-	hp_timing_t __t1, __t2;						      \
-	HP_TIMING_NOW (__t1);						      \
-	HP_TIMING_NOW (__t2);						      \
-	if (__t2 - __t1 < GLRO(dl_hp_timing_overhead))			      \
-	  GLRO(dl_hp_timing_overhead) = __t2 - __t1;			      \
-      }									      \
-    while (--__cnt > 0);						      \
-  } while (0)
-
 #define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
 
 #define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
diff --git a/sysdeps/sparc/sparc64/hp-timing.c b/sysdeps/sparc/sparc64/hp-timing.c
deleted file mode 100644
index 0a425ed..0000000
--- a/sysdeps/sparc/sparc64/hp-timing.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Support for high precision, low overhead timing functions.  sparc64 version.
-   Copyright (C) 2001-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by David S. Miller <davem@redhat.com>, 2001.
-
-   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 <hp-timing.h>
-
-/* We have to define the variable for the overhead.  */
-hp_timing_t _dl_hp_timing_overhead;
diff --git a/sysdeps/sparc/sparc64/hp-timing.h b/sysdeps/sparc/sparc64/hp-timing.h
index 9e49b78..521f64e 100644
--- a/sysdeps/sparc/sparc64/hp-timing.h
+++ b/sysdeps/sparc/sparc64/hp-timing.h
@@ -31,21 +31,6 @@ typedef unsigned long int hp_timing_t;
 
 #define HP_TIMING_NOW(Var) __asm__ __volatile__ ("rd %%tick, %0" : "=r" (Var))
 
-#define HP_TIMING_DIFF_INIT() \
-  do {									      \
-    int __cnt = 5;							      \
-    GLRO(dl_hp_timing_overhead) = ~0ull;				      \
-    do									      \
-      {									      \
-	hp_timing_t __t1, __t2;						      \
-	HP_TIMING_NOW (__t1);						      \
-	HP_TIMING_NOW (__t2);						      \
-	if (__t2 - __t1 < GLRO(dl_hp_timing_overhead))			      \
-	  GLRO(dl_hp_timing_overhead) = __t2 - __t1;			      \
-      }									      \
-    while (--__cnt > 0);						      \
-  } while (0)
-
 #define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
 
 #define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
diff --git a/sysdeps/x86_64/hp-timing.c b/sysdeps/x86_64/hp-timing.c
deleted file mode 100644
index 289ca4c..0000000
--- a/sysdeps/x86_64/hp-timing.c
+++ /dev/null
@@ -1,2 +0,0 @@
-/* We can use the i686 implementation without changes.  */
-#include <sysdeps/i386/i686/hp-timing.c>

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7a36be0daf05d9bcea8158548902ea20e35bb148

commit 7a36be0daf05d9bcea8158548902ea20e35bb148
Author: Richard Henderson <rth@twiddle.net>
Date:   Wed Jun 25 12:15:19 2014 -0700

    Removing HP_TIMING_ACCUM as unused
    
    * sysdeps/alpha/hp-timing.h (HP_TIMING_ACCUM): Remove.
    * sysdeps/generic/hp-timing.h (HP_TIMING_ACCUM): Remove.
    * sysdeps/i386/i686/hp-timing.h (HP_TIMING_ACCUM): Remove.
    * sysdeps/ia64/hp-timing.h (HP_TIMING_ACCUM): Remove.
    * sysdeps/powerpc/powerpc32/power4/hp-timing.h (HP_TIMING_ACCUM): Remove.
    * sysdeps/powerpc/powerpc64/hp-timing.h (HP_TIMING_ACCUM): Remove.
    * sysdeps/sparc/sparc32/sparcv9/hp-timing.h (HP_TIMING_ACCUM): Remove.
    * sysdeps/sparc/sparc64/hp-timing.h (HP_TIMING_ACCUM): Remove.

diff --git a/sysdeps/alpha/hp-timing.h b/sysdeps/alpha/hp-timing.h
index 4cbee66..71322f9 100644
--- a/sysdeps/alpha/hp-timing.h
+++ b/sysdeps/alpha/hp-timing.h
@@ -51,13 +51,8 @@
    - HP_TIMING_DIFF: compute difference between two times and store it
      in a third.  Source and destination might overlap.
 
-   - HP_TIMING_ACCUM: add time difference to another variable.  This might
-     be a bit more complicated to implement for some platforms as the
-     operation should be thread-safe and 64bit arithmetic on 32bit platforms
-     is not.
-
-   - HP_TIMING_ACCUM_NT: this is the variant for situations where we know
-     there are no threads involved.
+   - HP_TIMING_ACCUM_NT: add time difference to another variable, without
+     being thread-safe.
 
    - HP_TIMING_PRINT: write decimal representation of the timing value into
      the given string.  This operation need not be inline even though
@@ -91,10 +86,6 @@ typedef unsigned int hp_timing_t;
 /* It's simple arithmetic for us.  */
 #define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
 
-/* ??? Don't bother, since we're only used for ld.so.  */
-#define HP_TIMING_ACCUM(Sum, Diff)  not implemented
-
-/* No threads, no extra work.  */
 #define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
 
 /* Print the time value.  */
diff --git a/sysdeps/generic/hp-timing.h b/sysdeps/generic/hp-timing.h
index bf78e4e..894ab17 100644
--- a/sysdeps/generic/hp-timing.h
+++ b/sysdeps/generic/hp-timing.h
@@ -48,13 +48,8 @@
    - HP_TIMING_DIFF: compute difference between two times and store it
      in a third.  Source and destination might overlap.
 
-   - HP_TIMING_ACCUM: add time difference to another variable.  This might
-     be a bit more complicated to implement for some platforms as the
-     operation should be thread-safe and 64bit arithmetic on 32bit platforms
-     is not.
-
-   - HP_TIMING_ACCUM_NT: this is the variant for situations where we know
-     there are no threads involved.
+   - HP_TIMING_ACCUM_NT: add time difference to another variable, without
+     being thread-safe.
 
    - HP_TIMING_PRINT: write decimal representation of the timing value into
      the given string.  This operation need not be inline even though
@@ -69,7 +64,6 @@ typedef int hp_timing_t;
 #define HP_TIMING_NOW(var)
 #define HP_TIMING_DIFF_INIT()
 #define HP_TIMING_DIFF(Diff, Start, End)
-#define HP_TIMING_ACCUM(Sum, Diff)
 #define HP_TIMING_ACCUM_NT(Sum, Diff)
 #define HP_TIMING_PRINT(Buf, Len, Val)
 
diff --git a/sysdeps/i386/i686/hp-timing.h b/sysdeps/i386/i686/hp-timing.h
index 18e5b95..a4b19c1 100644
--- a/sysdeps/i386/i686/hp-timing.h
+++ b/sysdeps/i386/i686/hp-timing.h
@@ -58,13 +58,8 @@
    - HP_TIMING_DIFF: compute difference between two times and store it
      in a third.  Source and destination might overlap.
 
-   - HP_TIMING_ACCUM: add time difference to another variable.  This might
-     be a bit more complicated to implement for some platforms as the
-     operation should be thread-safe and 64bit arithmetic on 32bit platforms
-     is not.
-
-   - HP_TIMING_ACCUM_NT: this is the variant for situations where we know
-     there are no threads involved.
+   - HP_TIMING_ACCUM_NT: add time difference to another variable, without
+     being thread-safe.
 
    - HP_TIMING_PRINT: write decimal representation of the timing value into
      the given string.  This operation need not be inline even though
@@ -110,30 +105,6 @@ typedef unsigned long long int hp_timing_t;
 /* It's simple arithmetic for us.  */
 #define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
 
-/* We have to jump through hoops to get this correctly implemented.  */
-#define HP_TIMING_ACCUM(Sum, Diff) \
-  do {									      \
-    int __not_done;							      \
-    hp_timing_t __oldval = (Sum);					      \
-    hp_timing_t __diff = (Diff) - GLRO(dl_hp_timing_overhead);		      \
-    do									      \
-      {									      \
-	hp_timing_t __newval = __oldval + __diff;			      \
-	int __temp0, __temp1;						      \
-	__asm__ __volatile__ ("xchgl %0, %%ebx\n\t"			      \
-			      "lock; cmpxchg8b %1\n\t"			      \
-			      "sete %%bl\n\t"				      \
-			      "xchgl %0, %%ebx"				      \
-			      : "=SD" (__not_done), "=m" (Sum),		      \
-				"=A" (__oldval), "=c" (__temp0)		      \
-			      : "m" (Sum), "2" (__oldval),		      \
-				"3" ((unsigned int) (__newval >> 32)),	      \
-				"0" ((unsigned int) __newval));		      \
-      }									      \
-    while ((unsigned char) __not_done);					      \
-  } while (0)
-
-/* No threads, no extra work.  */
 #define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
 
 /* Print the time value.  */
diff --git a/sysdeps/ia64/hp-timing.h b/sysdeps/ia64/hp-timing.h
index e91326c..ccc49e6 100644
--- a/sysdeps/ia64/hp-timing.h
+++ b/sysdeps/ia64/hp-timing.h
@@ -52,13 +52,8 @@
    - HP_TIMING_DIFF: compute difference between two times and store it
      in a third.  Source and destination might overlap.
 
-   - HP_TIMING_ACCUM: add time difference to another variable.  This might
-     be a bit more complicated to implement for some platforms as the
-     operation should be thread-safe and 64bit arithmetic on 32bit platforms
-     is not.
-
-   - HP_TIMING_ACCUM_NT: this is the variant for situations where we know
-     there are no threads involved.
+   - HP_TIMING_ACCUM_NT: add time difference to another variable, without
+     being thread-safe.
 
    - HP_TIMING_PRINT: write decimal representation of the timing value into
      the given string.  This operation need not be inline even though
@@ -108,21 +103,6 @@ typedef unsigned long int hp_timing_t;
 /* It's simple arithmetic for us.  */
 #define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
 
-/* We have to jump through hoops to get this correctly implemented.  */
-#define HP_TIMING_ACCUM(Sum, Diff) \
-  do {									      \
-    hp_timing_t __oldval;						      \
-    hp_timing_t __diff = (Diff) - GLRO(dl_hp_timing_overhead);		      \
-    hp_timing_t __newval;						      \
-    do									      \
-      {									      \
-	__oldval = (Sum);						      \
-	__newval = __oldval + __diff;					      \
-      }									      \
-    while (! __sync_bool_compare_and_swap (&Sum, __oldvar, __newval));	      \
-  } while (0)
-
-/* No threads, no extra work.  */
 #define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
 
 /* Print the time value.  */
diff --git a/sysdeps/powerpc/powerpc32/power4/hp-timing.h b/sysdeps/powerpc/powerpc32/power4/hp-timing.h
index 2124e02..cd296c5 100644
--- a/sysdeps/powerpc/powerpc32/power4/hp-timing.h
+++ b/sysdeps/powerpc/powerpc32/power4/hp-timing.h
@@ -51,13 +51,8 @@
    - HP_TIMING_DIFF: compute difference between two times and store it
      in a third.  Source and destination might overlap.
 
-   - HP_TIMING_ACCUM: add time difference to another variable.  This might
-     be a bit more complicated to implement for some platforms as the
-     operation should be thread-safe and 64bit arithmetic on 32bit platforms
-     is not.
-
-   - HP_TIMING_ACCUM_NT: this is the variant for situations where we know
-     there are no threads involved.
+   - HP_TIMING_ACCUM_NT: add time difference to another variable, without
+     being thread-safe.
 
    - HP_TIMING_PRINT: write decimal representation of the timing value into
      the given string.  This operation need not be inline even though
@@ -117,15 +112,6 @@ typedef unsigned long long int hp_timing_t;
 /* It's simple arithmetic in 64-bit.  */
 #define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
 
-/* We need to insure that this add is atomic in threaded environments.  We use
-   __arch_atomic_exchange_and_add_64 from atomic.h to get thread safety.  */
-#define HP_TIMING_ACCUM(Sum, Diff) \
-  do {									      \
-    hp_timing_t __diff = (Diff) - GLRO(dl_hp_timing_overhead);		      \
-    __arch_atomic_exchange_and_add_64 (&(Sum), __diff);	                      \
-  } while (0)
-
-/* No threads, no extra work.  */
 #define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
 
 /* Print the time value.  */
diff --git a/sysdeps/powerpc/powerpc64/hp-timing.h b/sysdeps/powerpc/powerpc64/hp-timing.h
index c773541..4cad90a 100644
--- a/sysdeps/powerpc/powerpc64/hp-timing.h
+++ b/sysdeps/powerpc/powerpc64/hp-timing.h
@@ -51,13 +51,8 @@
    - HP_TIMING_DIFF: compute difference between two times and store it
      in a third.  Source and destination might overlap.
 
-   - HP_TIMING_ACCUM: add time difference to another variable.  This might
-     be a bit more complicated to implement for some platforms as the
-     operation should be thread-safe and 64bit arithmetic on 32bit platforms
-     is not.
-
-   - HP_TIMING_ACCUM_NT: this is the variant for situations where we know
-     there are no threads involved.
+   - HP_TIMING_ACCUM_NT: add time difference to another variable, without
+     being thread-safe.
 
    - HP_TIMING_PRINT: write decimal representation of the timing value into
      the given string.  This operation need not be inline even though
@@ -108,15 +103,6 @@ typedef unsigned long long int hp_timing_t;
 /* It's simple arithmetic in 64-bit.  */
 #define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
 
-/* We need to insure that this add is atomic in threaded environments.  We use
-   __arch_atomic_exchange_and_add_64 from atomic.h to get thread safety.  */
-#define HP_TIMING_ACCUM(Sum, Diff) \
-  do {									      \
-    hp_timing_t __diff = (Diff) - GLRO(dl_hp_timing_overhead);		      \
-    __arch_atomic_exchange_and_add_64 (&(Sum), __diff);	                      \
-  } while (0)
-
-/* No threads, no extra work.  */
 #define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
 
 /* Print the time value.  */
diff --git a/sysdeps/sparc/sparc32/sparcv9/hp-timing.h b/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
index fbfb861..c3be1ca 100644
--- a/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
+++ b/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
@@ -51,23 +51,6 @@ typedef unsigned long long int hp_timing_t;
 
 #define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
 
-#define HP_TIMING_ACCUM(Sum, Diff)				\
-do {								\
-  hp_timing_t __diff = (Diff) - GLRO(dl_hp_timing_overhead);	\
-  __asm__ __volatile__("srl	%L0, 0, %%g1\n\t"		\
-		       "sllx	%H0, 32, %%g6\n\t"		\
-		       "or	%%g1, %%g6, %%g1\n\t"		\
-		       "1: ldx	[%1], %%g5\n\t"			\
-		       "add	%%g5, %%g1, %%g6\n\t"		\
-		       "casx	[%1], %%g5,  %%g6\n\t"		\
-		       "cmp	%%g5, %%g6\n\t"			\
-		       "bne,pn	%%xcc, 1b\n\t"			\
-		       " nop"					\
-		       : /* no outputs */			\
-		       : "r" (__diff), "r" (&(Sum))		\
-		       : "memory", "g1", "g5", "g6");		\
-} while(0)
-
 #define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
 
 #define HP_TIMING_PRINT(Buf, Len, Val) \
diff --git a/sysdeps/sparc/sparc64/hp-timing.h b/sysdeps/sparc/sparc64/hp-timing.h
index 0773efb..9e49b78 100644
--- a/sysdeps/sparc/sparc64/hp-timing.h
+++ b/sysdeps/sparc/sparc64/hp-timing.h
@@ -48,21 +48,6 @@ typedef unsigned long int hp_timing_t;
 
 #define HP_TIMING_DIFF(Diff, Start, End)	(Diff) = ((End) - (Start))
 
-#define HP_TIMING_ACCUM(Sum, Diff)				\
-do {								\
-  hp_timing_t __diff = (Diff) - GLRO(dl_hp_timing_overhead);	\
-  hp_timing_t tmp1, tmp2;					\
-  __asm__ __volatile__("1: ldx	[%3], %0\n\t"			\
-		       "add	%0, %2, %1\n\t"			\
-		       "casx	[%3], %0,  %1\n\t"		\
-		       "cmp	%0, %1\n\t"			\
-		       "bne,pn	%%xcc, 1b\n\t"			\
-		       " nop"					\
-		       : "=&r" (tmp1), "=&r" (tmp2)		\
-		       : "r" (__diff), "r" (&(Sum))		\
-		       : "memory", "g1", "g5", "g6");		\
-} while(0)
-
 #define HP_TIMING_ACCUM_NT(Sum, Diff)	(Sum) += (Diff)
 
 #define HP_TIMING_PRINT(Buf, Len, Val) \
diff --git a/sysdeps/x86_64/hp-timing.h b/sysdeps/x86_64/hp-timing.h
index d88206c..e132dac 100644
--- a/sysdeps/x86_64/hp-timing.h
+++ b/sysdeps/x86_64/hp-timing.h
@@ -28,13 +28,4 @@
      asm volatile ("rdtsc" : "=a" (_lo), "=d" (_hi)); \
      (Var) = ((unsigned long long int) _hi << 32) | _lo; })
 
-/* The funny business for 32-bit mode is not required here.  */
-# undef HP_TIMING_ACCUM
-# define HP_TIMING_ACCUM(Sum, Diff)					      \
-  do {									      \
-    hp_timing_t __diff = (Diff) - GLRO(dl_hp_timing_overhead);		      \
-    __asm__ __volatile__ ("lock; addq %1, %0"				      \
-			  : "=m" (Sum) : "r" (__diff), "m" (Sum));	      \
-  } while (0)
-
 #endif /* hp-timing.h */

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=030e23978d99c9573083f25a580dd4d5043c309b

commit 030e23978d99c9573083f25a580dd4d5043c309b
Author: Richard Henderson <rth@twiddle.net>
Date:   Wed Jun 25 11:40:18 2014 -0700

    Removing HP_TIMING_ZERO as unused
    
    * sysdeps/alpha/hp-timing.h (HP_TIMING_ZERO): Remove.
    * sysdeps/generic/hp-timing.h (HP_TIMING_ZERO): Remove.
    * sysdeps/i386/i686/hp-timing.h (HP_TIMING_ZERO): Remove.
    * sysdeps/ia64/hp-timing.h (HP_TIMING_ZERO): Remove.
    * sysdeps/powerpc/powerpc32/power4/hp-timing.h (HP_TIMING_ZERO): Remove.
    * sysdeps/powerpc/powerpc64/hp-timing.h (HP_TIMING_ZERO): Remove.
    * sysdeps/sparc/sparc32/sparcv9/hp-timing.h (HP_TIMING_ZERO): Remove.
    * sysdeps/sparc/sparc64/hp-timing.h (HP_TIMING_ZERO): Remove.

diff --git a/sysdeps/alpha/hp-timing.h b/sysdeps/alpha/hp-timing.h
index 90f9b9d..4cbee66 100644
--- a/sysdeps/alpha/hp-timing.h
+++ b/sysdeps/alpha/hp-timing.h
@@ -42,8 +42,6 @@
    - hp_timing_t: This is the type for variables used to store the time
      values.
 
-   - HP_TIMING_ZERO: clear `hp_timing_t' object.
-
    - HP_TIMING_NOW: place timestamp for current time in variable given as
      parameter.
 
@@ -77,9 +75,6 @@
 /* We use 32 bit values for the times.  */
 typedef unsigned int hp_timing_t;
 
-/* Set timestamp value to zero.  */
-#define HP_TIMING_ZERO(VAR)	(VAR) = (0)
-
 /* The "rpcc" instruction returns a 32-bit counting half and a 32-bit
    "virtual cycle counter displacement".  Subtracting the two gives us
    a virtual cycle count.  */
diff --git a/sysdeps/generic/hp-timing.h b/sysdeps/generic/hp-timing.h
index eddc971..bf78e4e 100644
--- a/sysdeps/generic/hp-timing.h
+++ b/sysdeps/generic/hp-timing.h
@@ -39,8 +39,6 @@
    - hp_timing_t: This is the type for variables used to store the time
      values.
 
-   - HP_TIMING_ZERO: clear `hp_timing_t' object.
-
    - HP_TIMING_NOW: place timestamp for current time in variable given as
      parameter.
 
@@ -68,7 +66,6 @@
 #define HP_TIMING_AVAIL		(0)
 #define HP_TIMING_INLINE	(0)
 typedef int hp_timing_t;
-#define HP_TIMING_ZERO(Var)
 #define HP_TIMING_NOW(var)
 #define HP_TIMING_DIFF_INIT()
 #define HP_TIMING_DIFF(Diff, Start, End)
diff --git a/sysdeps/i386/i686/hp-timing.h b/sysdeps/i386/i686/hp-timing.h
index 4a2006e..18e5b95 100644
--- a/sysdeps/i386/i686/hp-timing.h
+++ b/sysdeps/i386/i686/hp-timing.h
@@ -49,8 +49,6 @@
    - hp_timing_t: This is the type for variables used to store the time
      values.
 
-   - HP_TIMING_ZERO: clear `hp_timing_t' object.
-
    - HP_TIMING_NOW: place timestamp for current time in variable given as
      parameter.
 
@@ -83,9 +81,6 @@
 /* We use 64bit values for the times.  */
 typedef unsigned long long int hp_timing_t;
 
-/* Set timestamp value to zero.  */
-#define HP_TIMING_ZERO(Var)	(Var) = (0)
-
 /* That's quite simple.  Use the `rdtsc' instruction.  Note that the value
    might not be 100% accurate since there might be some more instructions
    running in this moment.  This could be changed by using a barrier like
diff --git a/sysdeps/ia64/hp-timing.h b/sysdeps/ia64/hp-timing.h
index bf97b47..e91326c 100644
--- a/sysdeps/ia64/hp-timing.h
+++ b/sysdeps/ia64/hp-timing.h
@@ -43,8 +43,6 @@
    - hp_timing_t: This is the type for variables used to store the time
      values.
 
-   - HP_TIMING_ZERO: clear `hp_timing_t' object.
-
    - HP_TIMING_NOW: place timestamp for current time in variable given as
      parameter.
 
@@ -77,10 +75,6 @@
 /* We use 64bit values for the times.  */
 typedef unsigned long int hp_timing_t;
 
-/* Set timestamp value to zero.  */
-#define HP_TIMING_ZERO(Var)	(Var) = (0)
-
-
 /* The Itanium/Merced has a bug where the ar.itc register value read
    is not correct in some situations.  The solution is to read again.
    For now we always do this until we know how to recognize a fixed
diff --git a/sysdeps/powerpc/powerpc32/power4/hp-timing.h b/sysdeps/powerpc/powerpc32/power4/hp-timing.h
index f1e3beb..2124e02 100644
--- a/sysdeps/powerpc/powerpc32/power4/hp-timing.h
+++ b/sysdeps/powerpc/powerpc32/power4/hp-timing.h
@@ -42,8 +42,6 @@
    - hp_timing_t: This is the type for variables used to store the time
      values.
 
-   - HP_TIMING_ZERO: clear `hp_timing_t' object.
-
    - HP_TIMING_NOW: place timestamp for current time in variable given as
      parameter.
 
@@ -76,9 +74,6 @@
 /* We use 64bit values for the times.  */
 typedef unsigned long long int hp_timing_t;
 
-/* Set timestamp value to zero.  */
-#define HP_TIMING_ZERO(Var)	(Var) = (0)
-
 /* That's quite simple.  Use the `mftb' instruction.  Note that the value
    might not be 100% accurate since there might be some more instructions
    running in this moment.  This could be changed by using a barrier like
diff --git a/sysdeps/powerpc/powerpc64/hp-timing.h b/sysdeps/powerpc/powerpc64/hp-timing.h
index f1efa12..c773541 100644
--- a/sysdeps/powerpc/powerpc64/hp-timing.h
+++ b/sysdeps/powerpc/powerpc64/hp-timing.h
@@ -42,8 +42,6 @@
    - hp_timing_t: This is the type for variables used to store the time
      values.
 
-   - HP_TIMING_ZERO: clear `hp_timing_t' object.
-
    - HP_TIMING_NOW: place timestamp for current time in variable given as
      parameter.
 
@@ -76,9 +74,6 @@
 /* We use 64bit values for the times.  */
 typedef unsigned long long int hp_timing_t;
 
-/* Set timestamp value to zero.  */
-#define HP_TIMING_ZERO(Var)	(Var) = (0)
-
 /* That's quite simple.  Use the `mftb' instruction.  Note that the value
    might not be 100% accurate since there might be some more instructions
    running in this moment.  This could be changed by using a barrier like
diff --git a/sysdeps/sparc/sparc32/sparcv9/hp-timing.h b/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
index fd7e76e..fbfb861 100644
--- a/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
+++ b/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
@@ -29,8 +29,6 @@
 
 typedef unsigned long long int hp_timing_t;
 
-#define HP_TIMING_ZERO(Var)	(Var) = (0)
-
 #define HP_TIMING_NOW(Var) \
       __asm__ __volatile__ ("rd %%tick, %L0\n\t" \
 			    "srlx %L0, 32, %H0" \
diff --git a/sysdeps/sparc/sparc64/hp-timing.h b/sysdeps/sparc/sparc64/hp-timing.h
index fa08cc8..0773efb 100644
--- a/sysdeps/sparc/sparc64/hp-timing.h
+++ b/sysdeps/sparc/sparc64/hp-timing.h
@@ -29,8 +29,6 @@
 
 typedef unsigned long int hp_timing_t;
 
-#define HP_TIMING_ZERO(Var)	(Var) = (0)
-
 #define HP_TIMING_NOW(Var) __asm__ __volatile__ ("rd %%tick, %0" : "=r" (Var))
 
 #define HP_TIMING_DIFF_INIT() \

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8b76ffa20a23452d7a1093789c6d05678eb2fe12

commit 8b76ffa20a23452d7a1093789c6d05678eb2fe12
Author: Richard Henderson <rth@twiddle.net>
Date:   Wed Jun 25 11:36:52 2014 -0700

    powerpc: Remove dummy hp-timing.h
    
    It's the same as the generic dummy version.
    
    	* sysdeps/powerpc/powerpc32/hp-timing.h: Remove file.

diff --git a/sysdeps/powerpc/powerpc32/hp-timing.h b/sysdeps/powerpc/powerpc32/hp-timing.h
deleted file mode 100644
index 9ff52eb..0000000
--- a/sysdeps/powerpc/powerpc32/hp-timing.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* High precision, low overhead timing functions.  Linux/PPC32 version.
-   Copyright (C) 2005-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _HP_TIMING_H
-#define _HP_TIMING_H	1
-
-
-/* There are no generic definitions for the times.  We could write something
-   using the `gettimeofday' system call where available but the overhead of
-   the system call might be too high.
-
-   In case a platform supports timers in the hardware the following macros
-   and types must be defined:
-
-   - HP_TIMING_AVAIL: test for availability.
-
-   - HP_TIMING_INLINE: this macro is non-zero if the functionality is not
-     implemented using function calls but instead uses some inlined code
-     which might simply consist of a few assembler instructions.  We have to
-     know this since we might want to use the macros here in places where we
-     cannot make function calls.
-
-   - hp_timing_t: This is the type for variables used to store the time
-     values.
-
-   - HP_TIMING_ZERO: clear `hp_timing_t' object.
-
-   - HP_TIMING_NOW: place timestamp for current time in variable given as
-     parameter.
-
-   - HP_TIMING_DIFF_INIT: do whatever is necessary to be able to use the
-     HP_TIMING_DIFF macro.
-
-   - HP_TIMING_DIFF: compute difference between two times and store it
-     in a third.  Source and destination might overlap.
-
-   - HP_TIMING_ACCUM: add time difference to another variable.  This might
-     be a bit more complicated to implement for some platforms as the
-     operation should be thread-safe and 64bit arithmetic on 32bit platforms
-     is not.
-
-   - HP_TIMING_ACCUM_NT: this is the variant for situations where we know
-     there are no threads involved.
-
-   - HP_TIMING_PRINT: write decimal representation of the timing value into
-     the given string.  This operation need not be inline even though
-     HP_TIMING_INLINE is specified.
-
-*/
-
-/* Provide dummy definitions.  */
-#define HP_TIMING_AVAIL		(0)
-#define HP_TIMING_INLINE	(0)
-typedef unsigned long long int hp_timing_t;
-#define HP_TIMING_ZERO(Var)
-#define HP_TIMING_NOW(var)
-#define HP_TIMING_DIFF_INIT()
-#define HP_TIMING_DIFF(Diff, Start, End)
-#define HP_TIMING_ACCUM(Sum, Diff)
-#define HP_TIMING_ACCUM_NT(Sum, Diff)
-#define HP_TIMING_PRINT(Buf, Len, Val)
-
-/* Since this implementation is not available we tell the user about it.  */
-#define HP_TIMING_NONAVAIL	1
-
-#endif /* hp-timing.h */

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


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


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