Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760362AbXHQX73 (ORCPT ); Fri, 17 Aug 2007 19:59:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754769AbXHQX7S (ORCPT ); Fri, 17 Aug 2007 19:59:18 -0400 Received: from e6.ny.us.ibm.com ([32.97.182.146]:49523 "EHLO e6.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753292AbXHQX7Q (ORCPT ); Fri, 17 Aug 2007 19:59:16 -0400 Date: Fri, 17 Aug 2007 16:59:12 -0700 From: "Paul E. McKenney" To: Linus Torvalds Cc: Nick Piggin , Paul Mackerras , Segher Boessenkool , heiko.carstens@de.ibm.com, horms@verge.net.au, linux-kernel@vger.kernel.org, rpjday@mindspring.com, ak@suse.de, netdev@vger.kernel.org, cfriesen@nortel.com, akpm@linux-foundation.org, jesper.juhl@gmail.com, linux-arch@vger.kernel.org, zlynx@acm.org, satyam@infradead.org, clameter@sgi.com, schwidefsky@de.ibm.com, Chris Snook , Herbert Xu , davem@davemloft.net, wensong@linux-vs.org, wjiang@resilience.com Subject: Re: [PATCH 0/24] make atomic_read() behave consistently across all architectures Message-ID: <20070817235912.GA24314@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <46C32618.2080108@redhat.com> <20070815234021.GA28775@gondor.apana.org.au> <3694fb2e4ed1e4d9bf873c0d050c911e@kernel.crashing.org> <46C3B50E.7010702@yahoo.com.au> <194369f4c96ea0e24decf8f9197d5bad@kernel.crashing.org> <46C505B2.6030704@yahoo.com.au> <18117.4848.695269.72976@cargo.ozlabs.ibm.com> <46C516BA.60700@yahoo.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1204 Lines: 54 On Thu, Aug 16, 2007 at 08:50:30PM -0700, Linus Torvalds wrote: > Just try it yourself: > > volatile int i; > int j; > > int testme(void) > { > return i <= 1; > } > > int testme2(void) > { > return j <= 1; > } > > and compile with all the optimizations you can. > > I get: > > testme: > movl i(%rip), %eax > subl $1, %eax > setle %al > movzbl %al, %eax > ret > > vs > > testme2: > xorl %eax, %eax > cmpl $1, j(%rip) > setle %al > ret > > (now, whether that "xorl + setle" is better than "setle + movzbl", I don't > really know - maybe it is. But that's not thepoint. The point is the > difference between > > movl i(%rip), %eax > subl $1, %eax > > and > > cmpl $1, j(%rip) gcc bugzilla bug #33102, for whatever that ends up being worth. ;-) Thanx, Paul - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/