From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 6C4BB3858D3C for ; Thu, 5 May 2022 15:32:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6C4BB3858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 245FV7J9028380; Thu, 5 May 2022 10:31:07 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 245FV6jN028373; Thu, 5 May 2022 10:31:06 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 5 May 2022 10:31:06 -0500 From: Segher Boessenkool To: Marek Polacek Cc: Martin =?utf-8?B?TGnFoWth?= , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Come up with {,UN}LIKELY macros. Message-ID: <20220505153106.GD25951@gate.crashing.org> References: <542d7d88-bf16-3fd7-7bff-f74147d76e67@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2022 15:32:10 -0000 On Thu, May 05, 2022 at 09:06:45AM -0400, Marek Polacek via Gcc-patches wrote: > On Thu, May 05, 2022 at 02:31:05PM +0200, Martin Liška wrote: > > Some parts of the compiler already define: > > #define likely(cond) __builtin_expect ((cond), 1) > > > > So the patch should unify it. > That's funny, yesterday I added another one: cp/parser.cc:cp_parser_init_declarator > which is not replaced in this patch. > > I would've preferred the name gcc_{,un}likely but I don't want to start > a long bikeshedding... GCC_LIKELY is fine with me. A bare LIKELY isn't though. We have much more common macros having LIKELY in the name already (PROB_*LIKELY, CLASS_LIKELY_SPILLED, the various IPA things, loop versioning, etc.), but also we have LIKELY and UNLIKELY as function arguments in various places. Segher