From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cvs.linux-mips.org (eddie.linux-mips.org [148.251.95.138]) by sourceware.org (Postfix) with ESMTP id 5D4673971C03 for ; Fri, 8 Jan 2021 02:13:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5D4673971C03 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux-mips.org Authentication-Results: sourceware.org; spf=none smtp.mailfrom=macro@linux-mips.org Received: from localhost.localdomain ([127.0.0.1]:40320 "EHLO localhost" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S23993160AbhAHCM6fSN1X (ORCPT ); Fri, 8 Jan 2021 03:12:58 +0100 Date: Fri, 8 Jan 2021 02:12:58 +0000 (GMT) From: "Maciej W. Rozycki" To: Richard Sandiford cc: Jeff Law , Paul Koning , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] genemit: Handle `const_double_zero' rtx In-Reply-To: Message-ID: References: <16ae1e4f-df95-b403-95d4-68708508c858@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_NONE, TXREP 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: Fri, 08 Jan 2021 02:13:01 -0000 On Wed, 6 Jan 2021, Richard Sandiford wrote: > VOIDmode const_doubles should only be used for integers that cannot > be expressed as a sign-extended HOST_WIDE_INT. So (const_double 0 0) > is an invalid rtx in both integer and FP contexts. The updated change makes the VAX and PDP-11 backends stop producing those, but as I noted this is IMHO tangential to the choice between CONST0_RTX and CONST_DOUBLE_ATOF for code generators produced from named insns. And the latter does not interpret the mode, i.e. does not enforce the policy (which itself I don't argue against), leaving it up to people writing machine descriptions to get it right, which I think is the right place. > (FTR, the constant should also be the second operand to the plus, > but that's obviously tangential.) Also FTR, I made it the first one deliberately, as I made my experimental change across all the four basic arithmetic operations, so for obvious reasons I wanted to prevent a divisor from being 0 lest the middle end get anxious about it. Also contrary to documentation the middle end does present constants as the first operand in some cases where it is not supposed to (and does insist on doing so even if the backend says it's more expensive), as it was previously discussed in the context of COMPARE. Actually the VAX machine operand syntax is generic enough you can have an immediate as any operand, and in particular the first input to binary operations -- e.g. the minuend, and obviously also the first addend -- in their three-operand encodings; all the four basic arithmetic operations have them. I have posted the updated change as a patch series now, including you in the list of the recipients in case you wanted to chime in. I appreciate your feedback and experience in this area, thank you! Maciej