From patchwork Wed Nov 30 18:50:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 27957 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1093403wrr; Wed, 30 Nov 2022 10:50:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf7HqFijgzVZV5Doa+dhJ2swiD74p47SrS0ES8eD/FmEdamxwFaOg9HkY0pVaJedXwZfW2RJ X-Received: by 2002:aa7:cd91:0:b0:469:2f36:fd with SMTP id x17-20020aa7cd91000000b004692f3600fdmr43477711edv.385.1669834247790; Wed, 30 Nov 2022 10:50:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669834247; cv=none; d=google.com; s=arc-20160816; b=dzC09cDrWDpm29Zp6Mqn3TzpNOlMw6xc506vRqOyym7/Eukl0Wjwmimm2XECw0Ku+G 9/a6+7SPf1Za595McRZMFPoHAqJCrLa4F+HDgAn3wSSY2mBGjtTh70qrJ96ICCAmYqij WC2d9ERofcI0Dn4dC/M2y0qKw4Uc0j2+PtyMl7pHDb9UDoTX0AQ4V8hGMha9s+pLms6x avMSFHO+p6i9uqXN9Gz8raoA1D2NFfLbFxER0us3Ak3CtuTL1TB6lRBvREY6/UDfdfqU mWh5Q0Xb5IErLE1uyG5boUMFznnVhgkv+jvsB31Rp8FAp+YsXRRpoX4r5nbUOhcQF1i+ ox2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:to:from:date:dmarc-filter :delivered-to; bh=CDa1E5fNvDdasZvOhJ05+cK6Ga0g+EbbHyeFO8T74Vw=; b=haX+2RV9aw9sGPf68VjHzpypVUXk4EhO2qLcF/MtmkxEd+NEbqeufFcInvIWq8LvBQ TituOR0MckEOTlpbqatr6jzfA5f79ZgWlQN6ZNk7Pg79Ihee6FkJkwZ5eJF92cGrEGxW yvvBgbkid1RYvuoG6TZH7mUMXj3e+DX6viN2IbD/FT60Ug8MkgTCFlqaAvbM1fCjXZjx 8mxg/aknMHBMENYE8qlLIL59FNyXVtLrRoz5SirD9QDgvU7zghPyU3NdM7a8xIVzF+AQ xdT9z5k7EN7qx9E7hcfBvrQX21brQ00E8UooTGZKJmiIUT1o4cONwYP4uQWtdxJQHDKT kBEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id lg15-20020a170906f88f00b007adf6f0f962si1515143ejb.291.2022.11.30.10.50.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 10:50:47 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BA97A385B525 for ; Wed, 30 Nov 2022 18:50:37 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from dellerweb.de (unknown [IPv6:2a02:c207:3003:236::1]) by sourceware.org (Postfix) with ESMTPS id 5FC8C385842E for ; Wed, 30 Nov 2022 18:50:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5FC8C385842E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bell.net Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=bell.net Received: from mx3210.localdomain (bras-base-otwaon0925w-grc-05-174-95-50-166.dsl.bell.ca [174.95.50.166]) by dellerweb.de (Postfix) with ESMTPSA id A3AFE16001A4; Wed, 30 Nov 2022 19:50:13 +0100 (CET) Received: by mx3210.localdomain (Postfix, from userid 1000) id 6815D22011B; Wed, 30 Nov 2022 18:50:11 +0000 (UTC) Date: Wed, 30 Nov 2022 18:50:11 +0000 From: John David Anglin To: GCC Patches Subject: [committed] hppa: Fix addvdi3 and subvdi3 patterns Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750948116552290123?= X-GMAIL-MSGID: =?utf-8?q?1750948116552290123?= This was found building 64-bit openssh package. Committed to active branches. Dave --- Fix addvdi3 and subvdi3 patterns While most PA 2.0 instructions support both 32 and 64-bit traps and conditions, the addi and subi instructions only support 32-bit traps and conditions. Thus, we need to force immediate operands to register operands on the 64-bit target and use the add/sub instructions which can trap on 64-bit signed overflow. 2022-11-30 John David Anglin gcc/ChangeLog: * config/pa/pa.md (addvdi3): Force operand 2 to a register. Remove "addi,tsv,*" instruction from unamed pattern. (subvdi3): Force operand 1 to a register. Remove "subi,tsv" instruction from from unamed pattern. diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 76ae35d4cfa..41382271e54 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -5071,23 +5071,25 @@ (match_dup 2)))) (const_int 0))])] "" - "") + " +{ + if (TARGET_64BIT) + operands[2] = force_reg (DImode, operands[2]); +}") (define_insn "" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (plus:DI (match_operand:DI 1 "reg_or_0_operand" "%rM,rM") - (match_operand:DI 2 "arith11_operand" "r,I"))) + [(set (match_operand:DI 0 "register_operand" "=r") + (plus:DI (match_operand:DI 1 "reg_or_0_operand" "%rM") + (match_operand:DI 2 "register_operand" "r"))) (trap_if (ne (plus:TI (sign_extend:TI (match_dup 1)) (sign_extend:TI (match_dup 2))) (sign_extend:TI (plus:DI (match_dup 1) (match_dup 2)))) (const_int 0))] "TARGET_64BIT" - "@ - add,tsv,* %2,%1,%0 - addi,tsv,* %2,%1,%0" - [(set_attr "type" "binary,binary") - (set_attr "length" "4,4")]) + "add,tsv,* %2,%1,%0" + [(set_attr "type" "binary") + (set_attr "length" "4")]) (define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") @@ -5262,23 +5264,25 @@ (match_dup 2)))) (const_int 0))])] "" - "") + " +{ + if (TARGET_64BIT) + operands[1] = force_reg (DImode, operands[1]); +}") (define_insn "" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (minus:DI (match_operand:DI 1 "arith11_operand" "r,I") - (match_operand:DI 2 "reg_or_0_operand" "rM,rM"))) + [(set (match_operand:DI 0 "register_operand" "=r") + (minus:DI (match_operand:DI 1 "register_operand" "r") + (match_operand:DI 2 "reg_or_0_operand" "rM"))) (trap_if (ne (minus:TI (sign_extend:TI (match_dup 1)) (sign_extend:TI (match_dup 2))) (sign_extend:TI (minus:DI (match_dup 1) (match_dup 2)))) (const_int 0))] "TARGET_64BIT" - "@ - {subo|sub,tsv} %1,%2,%0 - {subio|subi,tsv} %1,%2,%0" - [(set_attr "type" "binary,binary") - (set_attr "length" "4,4")]) + "sub,tsv,* %1,%2,%0" + [(set_attr "type" "binary") + (set_attr "length" "4")]) (define_insn "" [(set (match_operand:DI 0 "register_operand" "=r,&r")