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 077EA3858D28 for ; Fri, 1 Apr 2022 14:50:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 077EA3858D28 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 231EnIur006814; Fri, 1 Apr 2022 09:49:19 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 231EnIYH006813; Fri, 1 Apr 2022 09:49:18 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 1 Apr 2022 09:49:18 -0500 From: Segher Boessenkool To: "Kewen.Lin" Cc: GCC Patches , David Edelsohn , Peter Bergner Subject: Re: [PATCH v2] rs6000: Support UN[GL][ET] in rs6000_maybe_emit_maxc_minc [PR105002] Message-ID: <20220401144918.GE614@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: Fri, 01 Apr 2022 14:50:22 -0000 Hi! On Fri, Apr 01, 2022 at 02:27:14PM +0800, Kewen.Lin wrote: > Commit r12-7687 exposed one miss optimization chance in function > rs6000_maybe_emit_maxc_minc, for now it only considers comparison > codes GE/GT/LE/LT, but it can support more variants with codes > UNLT/UNLE/UNGT/UNGE by reversing them into the equivalent ones > with GE/GT/LE/LT. You may want to add somewhere (in the comment in the code perhaps?) that if we see e.g. UNLT it guarantees that we have 4-way condition codes (LT/GT/EQ/UN), so we do not have to check for fast-math or the like. This is always true of course, but it doesn't hurt to remind the reader :-) The PR marker goes here: PR target/105002 > * config/rs6000/rs6000.cc (rs6000_maybe_emit_maxc_minc): Support more > comparison codes UNLT/UNLE/UNGT/UNGE. > - bool max_p = false; > + bool max_p; Please move this to later, since you touch it anyway: bool max_p; > if (code == GE || code == GT) > max_p = true; > else if (code == LE || code == LT) Okay for trunk with those finishing touches. Thanks! Segher