From patchwork Thu Jul 20 08:35:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2 via Gcc-patches" X-Patchwork-Id: 123088 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2971425vqt; Thu, 20 Jul 2023 01:36:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlE7oh7wNso5rG2ga8i/bdkqGr+vbXccFYdEcUbxdK3+XLSViWqTPkjA03PYNJm0iPoWyxKi X-Received: by 2002:aa7:d80b:0:b0:51d:df35:3818 with SMTP id v11-20020aa7d80b000000b0051ddf353818mr4660911edq.5.1689842192880; Thu, 20 Jul 2023 01:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689842192; cv=none; d=google.com; s=arc-20160816; b=fmTpq52Q4bAKB3JaSikPB3mreqhd5Iu2ci+OTlNCxzISxZuvdlT3S6l7rYOeWlUAUW QANQobTX1wlTOUbgdR3yW+Ge+6e2ldE3MumbgzfDiMdgpl0tqtKoTucatr9/1XY33LOO I34Sr/JqjXDLEIRf0paP3Hxo4oMslQlc0SCg3u537zWlxMtM6SkjyPhyr5Xy6/G4LS69 kP2hfwIt0lxuRpijoGOPD+GZe2/INboW2WQssvXYu4gcCKJKLxOoI3FAaBlpMiKFDqjy E42cCTrlQGKy9mOs78Mn4eszpZIjdmILb+aH4psPd5Dg4Op2yzvN0tcM1Hoak34TefH6 3FRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=RFnkjxCMrylT5MoeKajCQpIXkiighPB0b8UfqYWB6fs=; fh=9EZcvfVI324lLsRm78AR5trG4A9hqVpSpoTtyXFX1N4=; b=ukWy4taQI6Acd1u5IKHUr0me+B86Dj6SJatyujMW4D8RI2bY9lb2suanNk3T+ZmNyd eKMSoEYxVcj/I5MKZESWKUDOMNIOiwb3Z9U4Mf0Ld7/F01PdvApZGuiKYvuDanWqKtS0 JqwtIBxFzTT2qhUg453ia+8mylyp1gHiFKYW/JTpWXG33EVjkkTX+S0jP05ynLwDQahg h0Mz1Kxaw6LSmylHddcls6HRmhiEl/t1EnR04jRnNzy+DEmINlSIzE2fCBKn6DxoBVdf 4Fc9nYir6MvYSq+ohynzr9TdrQT1wgLewPE6YLJanWdsRTfuT2g94R7t2BVquib6WCxR qMqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Pmex7+pD; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id t4-20020aa7d4c4000000b0051de19ca881si531167edr.197.2023.07.20.01.36.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jul 2023 01:36:32 -0700 (PDT) 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; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Pmex7+pD; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1AF593857022 for ; Thu, 20 Jul 2023 08:36:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1AF593857022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689842191; bh=RFnkjxCMrylT5MoeKajCQpIXkiighPB0b8UfqYWB6fs=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Pmex7+pDtYDRxvyCAEF2fmnkISOQOeIfqjy9Z72pW/sxgOLJo4Dkq6NlJPP5Zt75n XjBQWV/MTWImK4MNFNqvsRiBSkaSJ9riS/Jh6Hl6ycyXrou9fYBaHbJHh/FkOyOGLT yJTsdSPcc9tiEpmBiHUrZq5CZM1CaSiBC9Oyj7Tg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by sourceware.org (Postfix) with ESMTPS id 36E1F3858CDB for ; Thu, 20 Jul 2023 08:35:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 36E1F3858CDB X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="351538190" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="351538190" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 01:35:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="724310685" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="724310685" Received: from shvmail02.sh.intel.com ([10.239.244.9]) by orsmga002.jf.intel.com with ESMTP; 20 Jul 2023 01:35:32 -0700 Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47]) by shvmail02.sh.intel.com (Postfix) with ESMTP id 51A2710056A0; Thu, 20 Jul 2023 16:35:31 +0800 (CST) To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, pan2.li@intel.com, yanzhang.wang@intel.com, kito.cheng@gmail.com Subject: [PATCH v1] RISC-V: Fix one incorrect match operand for RVV reduction Date: Thu, 20 Jul 2023 16:35:30 +0800 Message-Id: <20230720083530.3260344-1-pan2.li@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: , X-Patchwork-Original-From: Pan Li via Gcc-patches From: "Li, Pan2 via Gcc-patches" Reply-To: pan2.li@intel.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771927966858104684 X-GMAIL-MSGID: 1771927966858104684 From: Pan Li There are 2 of the RVV reduction pattern mask operand takes vector_merge_operand instead of vector_mask_operand by mistake. This patch would like to fix this. Signed-off-by: Pan Li gcc/ChangeLog: * config/riscv/vector.md: Fix incorrect match_operand. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/pr110299-1.c: Adjust tests. * gcc.target/riscv/rvv/base/pr110299-2.c: Ditto. Signed-off-by: Pan Li --- gcc/config/riscv/vector.md | 4 ++-- gcc/testsuite/gcc.target/riscv/rvv/base/pr110299-1.c | 4 ++-- gcc/testsuite/gcc.target/riscv/rvv/base/pr110299-2.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/config/riscv/vector.md b/gcc/config/riscv/vector.md index fcff3ee3a17..f745888127c 100644 --- a/gcc/config/riscv/vector.md +++ b/gcc/config/riscv/vector.md @@ -7915,7 +7915,7 @@ (define_insn "@pred_widen_reduc_plus" (unspec:VSF_LMUL1 [(unspec:VSF_LMUL1 [(unspec: - [(match_operand: 1 "vector_merge_operand" "vmWc1,vmWc1") + [(match_operand: 1 "vector_mask_operand" "vmWc1,vmWc1") (match_operand 5 "vector_length_operand" " rK, rK") (match_operand 6 "const_int_operand" " i, i") (match_operand 7 "const_int_operand" " i, i") @@ -7937,7 +7937,7 @@ (define_insn "@pred_widen_reduc_plus" (unspec:VDF_LMUL1 [(unspec:VDF_LMUL1 [(unspec: - [(match_operand: 1 "vector_merge_operand" "vmWc1,vmWc1") + [(match_operand: 1 "vector_mask_operand" "vmWc1,vmWc1") (match_operand 5 "vector_length_operand" " rK, rK") (match_operand 6 "const_int_operand" " i, i") (match_operand 7 "const_int_operand" " i, i") diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr110299-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr110299-1.c index d83eea925a7..a903dde34d1 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr110299-1.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr110299-1.c @@ -3,5 +3,5 @@ #include "pr110299-1.h" -/* { dg-final { scan-assembler-times {vfwredosum\.vs\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+,\s*v0.t} 1 } } */ -/* { dg-final { scan-assembler-times {vfwredusum\.vs\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+,\s*v0.t} 1 } } */ +/* { dg-final { scan-assembler-times {vfwredosum\.vs\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {vfwredusum\.vs\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr110299-2.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr110299-2.c index cdcde1b89a4..1254ace58eb 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr110299-2.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr110299-2.c @@ -4,5 +4,5 @@ #include "pr110299-1.h" #include "pr110299-2.h" -/* { dg-final { scan-assembler-times {vfwredosum\.vs\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+,\s*v0.t} 3 } } */ -/* { dg-final { scan-assembler-times {vfwredusum\.vs\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+,\s*v0.t} 3 } } */ +/* { dg-final { scan-assembler-times {vfwredosum\.vs\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 3 } } */ +/* { dg-final { scan-assembler-times {vfwredusum\.vs\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 3 } } */