From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: master b0ba0d42b0f: * src/lisp.h (EQ): Improve generated code. Date: Thu, 28 Nov 2024 18:53:46 +0100 Message-ID: <8BCABD6D-6605-438C-A62D-B7DA42D07AD4@gmail.com> References: <173279015204.1017853.4020802222494409378@vcs3.savannah.gnu.org> <20241128103552.86CC34F4FDB@vcs3.savannah.gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9745"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andrea Corallo , Emacs Devel To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 28 18:54:35 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tGiio-0002Pk-OK for ged-emacs-devel@m.gmane-mx.org; Thu, 28 Nov 2024 18:54:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGiiA-00019X-46; Thu, 28 Nov 2024 12:53:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGii8-00014O-18 for emacs-devel@gnu.org; Thu, 28 Nov 2024 12:53:52 -0500 Original-Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGii6-0005Ib-5Q; Thu, 28 Nov 2024 12:53:51 -0500 Original-Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-53df7f6a133so878753e87.3; Thu, 28 Nov 2024 09:53:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732816428; x=1733421228; darn=gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=3P3Vs7hqfKN3GkeqlTkThENxO+09YojzTaaeJAalhrM=; b=eRhW7i2OJhFTPfqTIArkKbXrJNXbnTVdiML1Tq12wHcdA+FG5RbHulkbsi1kjuvjup TWG3f1sICXs3ivVDhn6Yz7E+CsLH/i/TDt1Jfnc97bLjBlR1ua+UR6nwAsm5uSCnaEqw 4K5F2QHU9S2PblE1RsBDPiD3XXegfZ8vtkLSWwQ4c9k7AmbeMf2OgRqSploSod77k0KQ pJVOxsB85I6VQ61TH+Aa3X3e5Au+XxUTBbBacVECd4c+4YQkN8G5kAzKY5oetjn0LdL3 O9Cvb/sK3JY1iNaWWmJbRRvFHy+FBf3q0vB9b+QJ63jJwzQQ5ZuVX0ygYwViQG9OinwP 5HlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732816428; x=1733421228; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=3P3Vs7hqfKN3GkeqlTkThENxO+09YojzTaaeJAalhrM=; b=N6jxE3FwxdtuRenV/s4P6TuL24Y5kHatY+/MaPdUcodOzJec5xkP4kRZ05Kwi8IaNI N4eyJPiCWkAqakXQd7MBWyRKlq+ZcJUrqzPxUNn1JccpUChRgu7Z7Tar8drN2VpEMPar +zs3sQChZkGYZ31Sq7ph2EZ+hyBiLgf1pYZdUMBx/1s2N+4WYmwIDcxoulqzpWicBk0e hi5z/lCGE59RqrZ6hE/GZYR9AnA8sqp/aLN0xagbbS0mun6ELYZil34YDor3FGQAthhd ZzJLwUbOAdw2crKgZZ5oUCoFhx0Gnd7CR5pIoD43/HTz9/N2F/H7MlKQbu4dThE97VJW pOSQ== X-Forwarded-Encrypted: i=1; AJvYcCXl/149oHFI/hXwgzjbDoLe5yGlK7QfTmiGgK3J4jQ4FAROjgupf+gthzl8dhbSLFSuFkmD4ngVU6t9Yg==@gnu.org X-Gm-Message-State: AOJu0YyVTkFKsLjonbz7SdTCv1zk85KfBuQ1o/4D0pVnW9YqFsHjRP77 FtIpNgid9wn6WWBvA8ZHInVbOLVsnoZCYjMpQjBracUvLOErgMZW X-Gm-Gg: ASbGncuOx1WgEbN4bB82geAegwlk0nb8700m3y/YL7BhZJwdQqT5CaVpRQOR8NEBJZf JTajGe9XlSDrs68J6liENmuNWL3JRYefur26Qz1qOCNsRDNfGVhtLrRmeCtb1NcxANmAAmi2BUp UnjPPbK5r/nQGeqzLP//jNKMRUH64dkoqt5u7fBJ8rxNHALUbhunJ5CJgs4pVT9XU/KeFFw5gyW AhnRDYnOK5mqC/By8XuIKJpts2Zd12HCy4EeCdV/uPKD1Lmmof7KnReHwzkXhz0fxq1GVYEZIrY Dfv3QIxmpo2Pv6P9bwtzU60Hkkncd03rjJlVgcRM X-Google-Smtp-Source: AGHT+IGpeETt93sKWZzw1S3AiNFU8RxMFNxPL5FcqBMtvmcMMtk4k3YXR0X1pEyJPWWl8hjR0mEjlQ== X-Received: by 2002:a05:6512:1393:b0:539:ddf1:ac6f with SMTP id 2adb3069b0e04-53df00ff22amr4181993e87.46.1732816427587; Thu, 28 Nov 2024 09:53:47 -0800 (PST) Original-Received: from smtpclient.apple (c188-150-183-180.bredband.tele2.se. [188.150.183.180]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53df646f097sm236216e87.161.2024.11.28.09.53.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Nov 2024 09:53:47 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3654.120.0.1.15) Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=mattias.engdegard@gmail.com; helo=mail-lf1-x12f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325827 Archived-At: 28 nov. 2024 kl. 14.53 skrev Pip Cet via Emacs development discussions. = : > Maybe we should use __builtin_expect_with_probability instead, in = those rare cases when we are certain we're making a correct prediction? = Or, my preference, avoid using __builtin_expect entirely, so our scarce = resources can be spent on more important issues? Actually __builtin_expect can definitely provide a measurable = performance improvement, mainly for BB ordering and cold-path moving as = suggested by Andrea's commit note. I've been thinking about using it in = other cases. We should probably define some variant of likely/unlikely because those = cover most needs of __builtin_expect, rather than using it directly. = Then portability wouldn't be a problem. > I also don't think the assumption you're telling GCC to make in this = specific case (more than 90% of calls to EQ happen while = syms_with_pos_enabled =3D=3D false) is obviously correct. On this point I agree -- this particular change may have been made in = haste, although I applaud the spirit.