From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Using __builtin_expect (likely/unlikely macros) Date: Tue, 16 Apr 2019 05:34:54 +0300 Message-ID: <83tveyhe41.fsf@gnu.org> References: <87a7gst973.fsf@gmail.com> <875zrgt12q.fsf@gmail.com> <6919a4c8-df76-ea1e-34db-1fa62a360e5a@cs.ucla.edu> <87h8aykdod.fsf@gmail.com> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="251362"; mail-complaints-to="usenet@blaine.gmane.org" Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org To: Alex Gramiak Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 16 04:35:15 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGDwE-0013BO-7v for ged-emacs-devel@m.gmane.org; Tue, 16 Apr 2019 04:35:10 +0200 Original-Received: from localhost ([127.0.0.1]:58254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGDwD-0000Ug-AR for ged-emacs-devel@m.gmane.org; Mon, 15 Apr 2019 22:35:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGDw7-0000UQ-BI for emacs-devel@gnu.org; Mon, 15 Apr 2019 22:35:04 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGDw6-0003xU-E3; Mon, 15 Apr 2019 22:35:02 -0400 Original-Received: from [176.228.60.248] (port=3998 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hGDw5-0002c7-5d; Mon, 15 Apr 2019 22:35:01 -0400 In-reply-to: <87h8aykdod.fsf@gmail.com> (message from Alex Gramiak on Mon, 15 Apr 2019 18:16:02 -0600) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235503 Archived-At: > From: Alex Gramiak > Date: Mon, 15 Apr 2019 18:16:02 -0600 > Cc: emacs-devel@gnu.org > > To human readers, yes, but from what I can tell, GCC is mixed on this. > When applying the following diff that surrounds emacs_abort in > bytecode.c and xdisp.c, the assembly in both applied/unapplied is the > same for bytecode.c, but not for xdisp.c (even without the LIKELY > cases). I tested using gcc -O2 -S. I'm not sure whether you put LIKELY and UNLIKELY somewhat randomly, just for testing, or did you really think each place is likely/unlikely as in the change, but at least some places in xdisp.c are wrong: they use LIKELY where UNLIKELY is more appropriate, abd vice versa.