From: Keir Fraser Subject: Re: code question? Date: Thu, 11 Aug 2005 18:23:22 +0100 Message-ID: References: <1123775716.3043.15.camel@thinkpad> Mime-Version: 1.0 (Apple Message framework v622) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: mark.williamson@cl.cam.ac.uk Cc: Jerone Young , xen-devel List-Id: xen-devel@lists.xenproject.org On 11 Aug 2005, at 18:03, M.A. Williamson wrote: > I think that: > !!a & !b === (a != 0 ) && ( b == 0 ) > > It's just more efficient to do it directly using bitwise ops than to > use the full logical operators (can gcc really not optimise this sort > of thing???). It can't optimise out short-circuit semantics. Without predicates on instructions (like e.g. ARM has) it has to emit conditional branches. -- Keir