From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Gramiak Newsgroups: gmane.emacs.devel Subject: Re: Using __builtin_expect (likely/unlikely macros) Date: Mon, 15 Apr 2019 23:33:51 -0600 Message-ID: <871s22jyyo.fsf@gmail.com> References: <87a7gst973.fsf@gmail.com> <875zrgt12q.fsf@gmail.com> <6919a4c8-df76-ea1e-34db-1fa62a360e5a@cs.ucla.edu> <87h8aykdod.fsf@gmail.com> <83tveyhe41.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="4285"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 16 07:34:01 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 1hGGjJ-0000uT-AK for ged-emacs-devel@m.gmane.org; Tue, 16 Apr 2019 07:34:01 +0200 Original-Received: from localhost ([127.0.0.1]:59613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGGjI-0007uv-AZ for ged-emacs-devel@m.gmane.org; Tue, 16 Apr 2019 01:34:00 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGGjB-0007ud-SI for emacs-devel@gnu.org; Tue, 16 Apr 2019 01:33:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGGjA-0002C9-Rx for emacs-devel@gnu.org; Tue, 16 Apr 2019 01:33:53 -0400 Original-Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:37011) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hGGjA-0002Bm-I2; Tue, 16 Apr 2019 01:33:52 -0400 Original-Received: by mail-pg1-x52e.google.com with SMTP id e6so9744999pgc.4; Mon, 15 Apr 2019 22:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=slaZ6PpgNS7jR/EBaGNk2Foe1X1ffd6lc8pKy6j3S9U=; b=SsIjEM6/M5ducyrDBKlNKAhCBLYGupPZhdKIBotFb1fY4wRjLYJyHCRbchum3iQCTK NgEiy+GBAAlk7I0Oq1DkCko5vRAVDHCPtzaQv9Xt096VNncxc3kfoLH69j4MPvDpNWFi FwiUbnOIzipcPRzdhfpPbxa4fHxHQmd/JVwuda5qYdVSgWypXankkHUq1L27tPOFJROt bCoRsHaVqp49tWRrizGk6vL58fabC/YXoyhbAHH3PjoRl9Bk8CIi8+zXUvIri0D9Xax6 cm4VAtAnM8RSHqQTOZb9DKOFCJF7OAQ2EoGmdvqOe1Tg38Ivw546xjx1m0SluutlOgdx NWPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=slaZ6PpgNS7jR/EBaGNk2Foe1X1ffd6lc8pKy6j3S9U=; b=rqsm3hYwer2vVGcygf3+67vp9nux8Z8CrL416zw5PXLuwYzwixmU+K7j8oJXa2UrJQ oeAfKwhfcQClqEhTx+V3g6CnY3X/kNoCOcCCnPt16pWax3OOhu2BycuJMvCb6CGSHoaE osESR1o5vdi8+QAjrjQmCNkc3ZvRafSc7/1j5ghvkI2kVhvSeKz0hzA8T1Ne7By/My+X deZpIIwolK53Z6azU65GZICuqm2lkiLQkBsyrVE/EAjoP3n15NFa7CkxNQhkdoJuQCBd nKhLoMCJM2ztST3OpkrLBxSI5CWNeNAia/uOyE4V95I1hisvgVORjHv2mEuWYgQSJGyN GWyg== X-Gm-Message-State: APjAAAVTaorGLRp7TgSOBXnMOyF6oFoSXpfEGF+6Y3segeo6Prgm8M9C sWvZP4w++wQY/E2/17JSUciqzYDo X-Google-Smtp-Source: APXvYqxHi7e6cmKFCpLvdssGjjXYbFTMifUGP0ql2PXVzbWikwSKS6X0vAhZcEVYaCdrxooUy4JQSQ== X-Received: by 2002:a62:ee17:: with SMTP id e23mr80093915pfi.80.1555392831018; Mon, 15 Apr 2019 22:33:51 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302]) by smtp.gmail.com with ESMTPSA id t24sm60113162pfe.110.2019.04.15.22.33.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Apr 2019 22:33:50 -0700 (PDT) In-Reply-To: <83tveyhe41.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 16 Apr 2019 05:34:54 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52e 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:235507 Archived-At: Eli Zaretskii writes: > 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. Out of curiosity, which places would that be? I only put UNLIKELY calls around the checks for emacs_abort (which I presume to be unlikely), and the LIKELY calls are of the form: else if (LIKELY ()) { ... } else emacs_abort (); So if already at the "else if" clause, it's likely that the condition is true, otherwise an abort would take place.