From owner-freebsd-arch@FreeBSD.ORG Fri Mar 12 12:35:06 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02619106566B for ; Fri, 12 Mar 2010 12:35:06 +0000 (UTC) (envelope-from freebsd-arch@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 3D7B58FC2A for ; Fri, 12 Mar 2010 12:35:05 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Nq451-00077y-ES for freebsd-arch@freebsd.org; Fri, 12 Mar 2010 13:35:03 +0100 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Mar 2010 13:35:03 +0100 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Mar 2010 13:35:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-arch@freebsd.org From: Ivan Voras Date: Fri, 12 Mar 2010 13:30:07 +0100 Lines: 25 Message-ID: References: <20100312122559.GU8200@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20100118 Thunderbird/3.0 In-Reply-To: Subject: Re: likely and unlikely X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2010 12:35:06 -0000 On 03/12/10 13:27, Ivan Voras wrote: > On 03/12/10 13:26, Ed Schouten wrote: >> Hi Ivan, >> >> * Ivan Voras wrote: >>> Wouldn't it be more convenient to have a single global definition of >>> them, under #ifdef __GNUC__ for example in sys/stddef.h ? >> >> Wouldn't it be better to have them in sys/cdefs.h? > > Yes, I think you're right. Actually, it looks like it would be best to simply add them alongside __predict_true and __predict_False in sys/cdefs.h: 306 #if __GNUC_PREREQ__(2, 96) 307 #define __predict_true(exp) __builtin_expect((exp), 1) 308 #define __predict_false(exp) __builtin_expect((exp), 0) 309 #else 310 #define __predict_true(exp) (exp) 311 #define __predict_false(exp) (exp) 312 #endif (There is nothing wrong with __predict_true and __predict_false - they are just less convenient to type.)