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 BA40E38708A7 for ; Fri, 20 Nov 2020 03:34:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BA40E38708A7 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]:41476 "EHLO localhost" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S23990678AbgKTDeQsGnil (ORCPT ); Fri, 20 Nov 2020 04:34:16 +0100 Date: Fri, 20 Nov 2020 03:34:16 +0000 (GMT) From: "Maciej W. Rozycki" To: gcc-patches@gcc.gnu.org cc: Jeff Law , Anders Magnusson , Paul Koning , Matt Thomas Subject: [PATCH 02/31] VAX: Remove `c' operand format specifier overload In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham 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, 20 Nov 2020 03:34:19 -0000 The `c' operand format specifier is handled directly by the middle end in `output_asm_insn': %cN means require operand N to be a constant and print the constant expression with no punctuation. however it resorts to the target for constants that are not valid addresses: else if (letter == 'c') { if (CONSTANT_ADDRESS_P (operands[opnum])) output_addr_const (asm_out_file, operands[opnum]); else output_operand (operands[opnum], 'c'); } The VAX backend expects the fallback never to happen and overloads `c' with the branch condition code. This is confusing however and it is not like we are short of letters, so instead make the branch condition code use `k', and then for consistency make `K' the reverse branch condition code format specifier. This is safe to do as we provide no means to use a computed branch condition code in user `asm'. gcc/ * config/vax/vax.c (print_operand): Replace `c' and `C' with `k' and `K' respectively. * config/vax/vax.md (*branch, *branch_reversed): Update accordingly. --- gcc/config/vax/vax.c | 4 ++-- gcc/config/vax/vax.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index da4e6cb1745..0b3b76ed6da 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -509,9 +509,9 @@ print_operand (FILE *file, rtx x, int code) fputc (ASM_DOUBLE_CHAR, file); else if (code == '|') fputs (REGISTER_PREFIX, file); - else if (code == 'c') + else if (code == 'k') fputs (cond_name (x), file); - else if (code == 'C') + else if (code == 'K') fputs (rev_cond_name (x), file); else if (code == 'D' && CONST_INT_P (x) && INTVAL (x) < 0) fprintf (file, "$" NEG_HWI_PRINT_HEX16, INTVAL (x)); diff --git a/gcc/config/vax/vax.md b/gcc/config/vax/vax.md index 4897ce44505..e3018a0ee06 100644 --- a/gcc/config/vax/vax.md +++ b/gcc/config/vax/vax.md @@ -1111,7 +1111,7 @@ (define_insn "*branch" (label_ref (match_operand 1 "" "")) (pc)))] "" - "j%c0 %l1") + "j%k0 %l1") ;; Recognize reversed jumps. (define_insn "*branch_reversed" @@ -1122,7 +1122,7 @@ (define_insn "*branch_reversed" (pc) (label_ref (match_operand 1 "" ""))))] "" - "j%C0 %l1") ; %C0 negates condition + "j%K0 %l1") ; %K0 negates condition ;; Recognize jbs, jlbs, jbc and jlbc instructions. Note that the operand ;; of jlbs and jlbc insns are SImode in the hardware. However, if it is -- 2.11.0