From patchwork Sat Dec 12 12:05:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 1415404 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=2620:52:3:1:0:246e:9693:128c; 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 (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4CtRDf5GhRz9sTX for ; Sat, 12 Dec 2020 23:05:22 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 580A6388C035; Sat, 12 Dec 2020 12:05:20 +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 61340388C023 for ; Sat, 12 Dec 2020 12:05:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 61340388C023 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]:60874 "EHLO localhost" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S23993097AbgLLMFQqSLnC (ORCPT ); Sat, 12 Dec 2020 13:05:16 +0100 Date: Sat, 12 Dec 2020 12:05:16 +0000 (GMT) From: "Maciej W. Rozycki" To: gcc-patches@gcc.gnu.org Subject: [PATCH 2/2] VAX: Unify push operation selection In-Reply-To: Message-ID: References: MIME-Version: 1.0 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Avoid the possibility of code discrepancies like one fixed with the previous change and improve the structure of code by selecting between push and non-push operations in a single place in `vax_output_int_move'. The PUSHAB/MOVAB address moves are never actually produced from this code as the SImode invocation of this function is guarded with the `nonsymbolic_operand' predicate, but let's not mess up with this code too much on this occasion and keep the piece in place. * config/vax/vax.c (vax_output_int_move): Unify push operation selection. --- gcc/config/vax/vax.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) gcc-vax-int-move-push-p.diff Index: gcc/gcc/config/vax/vax.c =================================================================== --- gcc.orig/gcc/config/vax/vax.c +++ gcc/gcc/config/vax/vax.c @@ -1235,6 +1235,7 @@ vax_output_int_move (rtx insn ATTRIBUTE_ { rtx hi[3], lo[3]; const char *pattern_hi, *pattern_lo; + bool push_p; switch (mode) { @@ -1345,19 +1346,13 @@ vax_output_int_move (rtx insn ATTRIBUTE_ return "movq %1,%0"; case E_SImode: + push_p = push_operand (operands[0], SImode); + if (symbolic_operand (operands[1], SImode)) - { - if (push_operand (operands[0], SImode)) - return "pushab %a1"; - return "movab %a1,%0"; - } + return push_p ? "pushab %a1" : "movab %a1,%0"; if (operands[1] == const0_rtx) - { - if (push_operand (operands[0], SImode)) - return "pushl %1"; - return "clrl %0"; - } + return push_p ? "pushl %1" : "clrl %0"; if (CONST_INT_P (operands[1]) && (unsigned HOST_WIDE_INT) INTVAL (operands[1]) >= 64) @@ -1383,9 +1378,7 @@ vax_output_int_move (rtx insn ATTRIBUTE_ if (i >= -0x8000 && i < 0) return "cvtwl %1,%0"; } - if (push_operand (operands[0], SImode)) - return "pushl %1"; - return "movl %1,%0"; + return push_p ? "pushl %1" : "movl %1,%0"; case E_HImode: if (CONST_INT_P (operands[1]))