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 880F9385829A for ; Fri, 17 Jun 2022 18:09:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 880F9385829A 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 25HI8LKg005969; Fri, 17 Jun 2022 13:08:21 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 25HI8Ls0005967; Fri, 17 Jun 2022 13:08:21 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 17 Jun 2022 13:08:21 -0500 From: Segher Boessenkool To: HAO CHEN GUI Cc: gcc-patches , David , "Kewen.Lin" , Peter Bergner Subject: Re: [PATCH, rs6000] Use CC for BCD operations [PR100736] Message-ID: <20220617180821.GJ25951@gate.crashing.org> References: <887ce9bb-3a34-b880-41b1-4ac2cfb743eb@linux.ibm.com> <20220616112421.GE25951@gate.crashing.org> <4771d4bc-b4dc-d720-5146-b996a6dac9af@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4771d4bc-b4dc-d720-5146-b996a6dac9af@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: Fri, 17 Jun 2022 18:09:24 -0000 Hi! On Fri, Jun 17, 2022 at 04:19:37PM +0800, HAO CHEN GUI wrote: > On 16/6/2022 下午 7:24, Segher Boessenkool wrote: > > You shouldn't need anything like this, bcdinvalid will work just fine if > > written as bcdadd_ov (with vector of 0 as the second op)? > > The vector of 0 is not equal to BCD 0, I think. The BCD number contains > preferred sign (PS) bit. So all zeros itself is an invalid encoding. We may > use bcdsub_ov with duplicated op to implement bcdinvalid. For the machine, you should use 0x0c or 0x0f, sure. But in RTL we can do whatever we want. But bcdsub is easier indeed, and we don't need to construct a 0 first then. Segher