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 A5B183857369 for ; Thu, 2 Jun 2022 09:05:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A5B183857369 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 2529461l022497; Thu, 2 Jun 2022 04:04:06 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 252946n3022496; Thu, 2 Jun 2022 04:04:06 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 2 Jun 2022 04:04:06 -0500 From: Segher Boessenkool To: HAO CHEN GUI Cc: "Kewen.Lin" , Peter Bergner , gcc-patches , David Subject: Re: [PATCH v2, rs6000] Fix ICE on expand bcd__ [PR100736] Message-ID: <20220602090406.GA25951@gate.crashing.org> References: <41da7001-549d-c7ae-fa6b-534a8faf673e@linux.ibm.com> <20220531235600.GU25951@gate.crashing.org> <20220601220514.GY25951@gate.crashing.org> <0660b290-bb3c-9494-d232-4dcb192351eb@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0660b290-bb3c-9494-d232-4dcb192351eb@linux.ibm.com> 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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, 02 Jun 2022 09:05:09 -0000 Hi! On Thu, Jun 02, 2022 at 01:30:04PM +0800, HAO CHEN GUI wrote: > Segher, > Does BCD comparison return false when either operand is invalid coding? It sets all of LT, GT, and EQ to 0 (it normally sets exactly one of them to 1). It sets bit 3 (the "SO" bit usually) to 1. That is what the machine insns do. What the builtins do is undefined as far as I know? If So we can do whatever is most convenient, so, not handle it specifically at all, just go with what falls out. > If yes, the result could be 3-way. We can check gt and eq bits for ge. You can check the LT bit, instead: it is only one branch insn, and also only one setbc[r] insn (it can be slightly more expensive if you can use only older insns). > We still can't use crnot to only check lt bit as there could be invalid > coding. > Also, do you think finite-math-only excludes invalid coding? Seems GCC > doesn't clear define it. This is not floating-point code at all, it should not be influenced at all by finite-math-only! Segher