From patchwork Wed Jun 25 22:24:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 364195 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A0B3E14008C for ; Thu, 26 Jun 2014 08:25:36 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=FNHhniBfmvdtnW25coJJRiZ6+ygMa1V xw2B4+DDeImYTh8amN1GTk6s6PKdzfyqv2piU7KuZUmxji7wrDA+dLsebrCLBMy9 w2Qi2kzyuPF59A0fL8mdH7FH8/MgodpLq5SKW6ZL1rYw9nWKeWFfVHgmtGeGw8GP Sms66ha5PtKc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=j8fmjjvijmfl4hbiKQ6JesIcZQ4=; b=cpu+/ 21zwQCTNtWMaDk/FT9YLJsp5oWH/jxVHZBbKohd6PLLYWPdajBRQtEG37iOBfT+M Xt1rluxyfxaQ+vd8xun+1Ekre2XydYtky+EhFYuMOKoEjV5aKSiC097C/ND3N7FY bdNqycTwLXv/phG8sWTe4AARTgyEUIalvpbcTA= Received: (qmail 16835 invoked by alias); 25 Jun 2014 22:25:05 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 16773 invoked by uid 89); 25 Jun 2014 22:25:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_50, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qa0-f52.google.com X-Received: by 10.224.160.209 with SMTP id o17mr16342393qax.103.1403735099623; Wed, 25 Jun 2014 15:24:59 -0700 (PDT) From: Richard Henderson To: libc-alpha@sourceware.org Cc: azanella@linux.vnet.ibm.com, davem@davemloft.net, marcus.shawcroft@arm.com Subject: [PATCH 3/6] Removing HP_TIMING_ACCUM as unused Date: Wed, 25 Jun 2014 15:24:43 -0700 Message-Id: <1403735086-21797-4-git-send-email-rth@twiddle.net> In-Reply-To: <1403735086-21797-1-git-send-email-rth@twiddle.net> References: <1403735086-21797-1-git-send-email-rth@twiddle.net> * 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. --- sysdeps/alpha/hp-timing.h | 13 ++--------- sysdeps/generic/hp-timing.h | 10 ++------- sysdeps/i386/i686/hp-timing.h | 33 ++-------------------------- sysdeps/ia64/hp-timing.h | 24 ++------------------ sysdeps/powerpc/powerpc32/power4/hp-timing.h | 18 ++------------- sysdeps/powerpc/powerpc64/hp-timing.h | 18 ++------------- sysdeps/sparc/sparc32/sparcv9/hp-timing.h | 17 -------------- sysdeps/sparc/sparc64/hp-timing.h | 15 ------------- sysdeps/x86_64/hp-timing.h | 9 -------- 9 files changed, 12 insertions(+), 145 deletions(-) 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 */