From patchwork Fri Jan 8 01:50:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 1423601 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux-mips.org Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DBmJg3kjPz9sVt for ; Fri, 8 Jan 2021 12:50:27 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6F7933971C1C; Fri, 8 Jan 2021 01:50:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from cvs.linux-mips.org (eddie.linux-mips.org [148.251.95.138]) by sourceware.org (Postfix) with ESMTP id 70565384243B for ; Fri, 8 Jan 2021 01:50:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 70565384243B 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]:39966 "EHLO localhost" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S23993168AbhAHBuUPMwj3 (ORCPT ); Fri, 8 Jan 2021 02:50:20 +0100 Date: Fri, 8 Jan 2021 01:50:20 +0000 (GMT) From: "Maciej W. Rozycki" To: Jeff Law , Paul Koning , Richard Sandiford , gcc-patches@gcc.gnu.org Subject: [PATCH 2/4] PDP11: Use a mode with `const_double_zero' expressions In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Spam-Status: No, score=-3.2 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" For predictable semantics propagate the mode from operands referred by FP substitutions to the `const_double_zero' expressions used with the associated condition code calculation, resulting in the following update to insn-emit.c code produced for the `pdp11-aout' target (with machine description line numbering change noise removed): @@ -1514,7 +1514,7 @@ gen_rtx_COMPARE (CCmode, gen_rtx_ABS (DFmode, operand1), - CONST_DOUBLE_ATOF ("0", VOIDmode))), + CONST_DOUBLE_ATOF ("0", DFmode))), gen_rtx_SET (operand0, gen_rtx_ABS (DFmode, copy_rtx (operand1))))); @@ -1555,7 +1555,7 @@ gen_rtx_COMPARE (CCmode, gen_rtx_NEG (DFmode, operand1), - CONST_DOUBLE_ATOF ("0", VOIDmode))), + CONST_DOUBLE_ATOF ("0", DFmode))), gen_rtx_SET (operand0, gen_rtx_NEG (DFmode, copy_rtx (operand1))))); @@ -1790,7 +1790,7 @@ gen_rtx_MULT (DFmode, operand1, operand2), - CONST_DOUBLE_ATOF ("0", VOIDmode))), + CONST_DOUBLE_ATOF ("0", DFmode))), gen_rtx_SET (operand0, gen_rtx_MULT (DFmode, copy_rtx (operand1), @@ -1942,7 +1942,7 @@ gen_rtx_DIV (DFmode, operand1, operand2), - CONST_DOUBLE_ATOF ("0", VOIDmode))), + CONST_DOUBLE_ATOF ("0", DFmode))), gen_rtx_SET (operand0, gen_rtx_DIV (DFmode, copy_rtx (operand1), Provide a new iterator to provide copies of FP substitutions across the FP modes supported as the substitutions now need to match the mode of the operands. gcc/ * config/pdp11/pdp11.md (PDPfp): New mode iterator. (fcc_cc, fcc_ccnz): Use it. Add mode to `const_double_zero' and operands. --- gcc/config/pdp11/pdp11.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) gcc-pdp11-const-double-zero-mode.diff Index: gcc/gcc/config/pdp11/pdp11.md =================================================================== --- gcc.orig/gcc/config/pdp11/pdp11.md +++ gcc/gcc/config/pdp11/pdp11.md @@ -82,6 +82,8 @@ (define_code_iterator SHF [ashift ashiftrt lshiftrt]) +(define_mode_iterator PDPfp [SF DF]) + ;; Substitution to turn a CC clobber into a CC setter. We have four of ;; these: for CCmode vs. CCNZmode, and for CC_REGNUM vs. FCC_REGNUM. (define_subst "cc_cc" @@ -101,19 +103,19 @@ (set (match_dup 0) (match_dup 1))]) (define_subst "fcc_cc" - [(set (match_operand 0 "") (match_operand 1 "")) + [(set (match_operand:PDPfp 0 "") (match_operand:PDPfp 1 "")) (clobber (reg FCC_REGNUM))] "" [(set (reg:CC FCC_REGNUM) - (compare:CC (match_dup 1) (const_double_zero))) + (compare:CC (match_dup 1) (const_double_zero:PDPfp))) (set (match_dup 0) (match_dup 1))]) (define_subst "fcc_ccnz" - [(set (match_operand 0 "") (match_operand 1 "")) + [(set (match_operand:PDPfp 0 "") (match_operand:PDPfp 1 "")) (clobber (reg FCC_REGNUM))] "" [(set (reg:CCNZ FCC_REGNUM) - (compare:CCNZ (match_dup 1) (const_double_zero))) + (compare:CCNZ (match_dup 1) (const_double_zero:PDPfp))) (set (match_dup 0) (match_dup 1))]) (define_subst_attr "cc_cc" "cc_cc" "_nocc" "_cc")