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 54B03393A419 for ; Mon, 7 Jun 2021 21:30:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 54B03393A419 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=fail 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 157LTc0D029157; Mon, 7 Jun 2021 16:29:38 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 157LTbXA029152; Mon, 7 Jun 2021 16:29:37 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 7 Jun 2021 16:29:37 -0500 From: Segher Boessenkool To: will schmidt Cc: Michael Meissner , gcc-patches@gcc.gnu.org, David Edelsohn , Bill Schmidt , Peter Bergner Subject: Re: [PATCH 2/2] Add IEEE 128-bit fp conditional move on PowerPC. Message-ID: <20210607212937.GO18427@gate.crashing.org> References: <20210518202235.GA10607@ibm-toto.the-meissners.org> <20210518202827.GB14382@ibm-toto.the-meissners.org> <0e2fd73cd86dd40b090ad92ec26b2f27dc548f00.camel@vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0e2fd73cd86dd40b090ad92ec26b2f27dc548f00.camel@vnet.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, TXREP, T_SPF_HELO_PERMERROR, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Mon, 07 Jun 2021 21:30:40 -0000 On Thu, May 20, 2021 at 02:27:06PM -0500, will schmidt wrote: > On Tue, 2021-05-18 at 16:28 -0400, Michael Meissner wrote: > > + if (compare_mode == result_mode > > + || (compare_mode == SFmode && result_mode == DFmode) > > + || (compare_mode == DFmode && result_mode == SFmode)) > > + ; > > + else > > + return false; > > Interesting if/else block. May want to reverse the logic. I defer if > this way is notably simpler than inverting it. This is not simpler, no. You want to do something that just returns *first*, and then not have an "else". *That* is simpler. And just write !(...) around the condition, don't try to manually invert it please. You want both correct code and readable code, not neither of these, they are not extremes you need to balance, each helps the other! Segher