From patchwork Wed Apr 26 04:47:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "juzhe.zhong@rivai.ai" X-Patchwork-Id: 87600 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3046:b0:115:7a1d:dabb with SMTP id p6csp133591rwl; Tue, 25 Apr 2023 21:48:32 -0700 (PDT) X-Google-Smtp-Source: AKy350aQOEdFNrRQruWTsFI8CeqLdlCfqilXCGef/OU+l/gYPnV8SrdJenxNRWvFms8pSORJmsf3 X-Received: by 2002:a17:906:3f91:b0:953:7e12:838a with SMTP id b17-20020a1709063f9100b009537e12838amr13695075ejj.67.1682484512052; Tue, 25 Apr 2023 21:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682484512; cv=none; d=google.com; s=arc-20160816; b=xMpeO8SHzUapOboKIuLl9fD8g6iOjeaD4g776/81q+gB59C41yjO/nHkicpEhFeAHT heXNIHtTNumuEkn5JQ6VNuJcPmu2M9bpRQ9Oi6bf6ANCGnC1/0h9SB6bYpds37yVaBt3 2hq1U74yyzQMgcERPNnZMPXj4ibOttijdi0D7yEdpHgKrQWWoiAJeX7k8HJw/V+FlFag GYHK3hFqK73e6rfOxSg3XHjwGxfS+j8uQldybIXM3GmUSu49A55nMmZ9W3tqR0GvzuAU w9ZhQVUiw16Ura/69jv5e6DwZ+7HsXPzU5YVAEmgVHDg1VoSKI5Jo6dlEjo39kasMvI0 Y++Q== 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:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dmarc-filter:delivered-to; bh=cjnr82Eb+96jhns2O1fOlNF+iIQhao7iD2GJqd2DPLI=; b=HuYKoSj/SHvgx22BsdRht0m1bdDd4UB+8ij614wH8fCG5yWt/VazZ2lnKez7If1D6S DcCROhRjJ7oUGX67sIqBKwLAhwGUfN+1Eg7q9lRLxaIDc3Ajd5qA4XxFh2hLFhqN3BvR NMqIM9ahTMsoQLKCQOVG75ey3mIgtHwKIUWDMM7o2gbWPGzZxKBaCgaA83KRsAbwgOa7 r77aAHWq4t6yi74HXfSyc+Mu8j/W9IJq4QNnxmZ5rXOF2+GeapIwnTZyVzKMtqgfqlDs 8oaeGxeWMU/ePfNZBRSsh6jvmFMHSNl3wWgKCKkN2LKEnYqOZ7w5E6ukkOo0A8B0UHYe glRA== 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id s13-20020a170906354d00b0094f410225cbsi11130950eja.486.2023.04.25.21.48.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 21:48: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; 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 369013857340 for ; Wed, 26 Apr 2023 04:48:17 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbg151.qq.com (smtpbg151.qq.com [18.169.211.239]) by sourceware.org (Postfix) with ESMTPS id D4E953858D3C for ; Wed, 26 Apr 2023 04:47:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D4E953858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai X-QQ-mid: bizesmtp83t1682484461t3jmcdvp Received: from rios-cad5.localdomain ( [58.60.1.11]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 26 Apr 2023 12:47:40 +0800 (CST) X-QQ-SSF: 01400000000000F0P000000A0000000 X-QQ-FEAT: PS/N6jJLnDYk8Lxc1PtCktntWFlepjynMUP48yV1RvNEZ7Yw0BxrDFxk1bxdQ /fAQZ/wfasms+PctdrUG20QMNc/wMXRHQ30nM7fbmzTHj6j3mx8AacnkOmq8iY+xz4IdEn+ WRVllYzJANPodJXAX1e3HK4fZ85Tije4lgX8mQ4LePwxRmTCYuEnv0A5FkCVGLGbWCtxmmf j4vRUlor5uF0Po5ZXrCFhhjqnIiE6oqujsRDSeUwv3L7c07xyIcgei/DfEN0ZcLOBWfK4TN YRmkLMN+LX4tQo788QOqCVrYPTjq1iTqcuHkjOSxo4wq+e946Kh3uOmzPR6tHP4p7e2R02e YU/J4/UfEvnVT7MPcv0XVvM1hYpgaBzs0QVLu2U5lppDdNd8TZNYytAG4K8HKNxVmUcEB92 X-QQ-GoodBg: 2 X-BIZMAIL-ID: 16460423083162864411 From: juzhe.zhong@rivai.ai To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, Ju-Zhe Zhong Subject: [PATCH V2] RISC-V: Fine tune vmadc/vmsbc RA constraint Date: Wed, 26 Apr 2023 12:47:39 +0800 Message-Id: <20230426044739.2672860-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvr:qybglogicsvr7 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, 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: , 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?1764212879539080961?= X-GMAIL-MSGID: =?utf-8?q?1764212879539080961?= From: Ju-Zhe Zhong gcc/ChangeLog: * config/riscv/vector.md: Refine vmadc/vmsbc RA constraint. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/narrow_constraint-13.c: New test. * gcc.target/riscv/rvv/base/narrow_constraint-14.c: New test. * gcc.target/riscv/rvv/base/narrow_constraint-15.c: New test. * gcc.target/riscv/rvv/base/narrow_constraint-16.c: New test. --- gcc/config/riscv/vector.md | 176 +++++++++--------- .../riscv/rvv/base/narrow_constraint-13.c | 133 +++++++++++++ .../riscv/rvv/base/narrow_constraint-14.c | 133 +++++++++++++ .../riscv/rvv/base/narrow_constraint-15.c | 127 +++++++++++++ .../riscv/rvv/base/narrow_constraint-16.c | 127 +++++++++++++ 5 files changed, 608 insertions(+), 88 deletions(-) create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-13.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-14.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-15.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-16.c diff --git a/gcc/config/riscv/vector.md b/gcc/config/riscv/vector.md index eb8e0b44e58..b3d23441679 100644 --- a/gcc/config/riscv/vector.md +++ b/gcc/config/riscv/vector.md @@ -2450,15 +2450,15 @@ (set (attr "avl_type") (symbol_ref "INTVAL (operands[7])"))]) (define_insn "@pred_madc" - [(set (match_operand: 0 "register_operand" "=&vr, &vr") + [(set (match_operand: 0 "register_operand" "=vr, &vr, &vr") (unspec: [(plus:VI - (match_operand:VI 1 "register_operand" " vr, vr") - (match_operand:VI 2 "vector_arith_operand" " vr, vi")) - (match_operand: 3 "register_operand" " vm, vm") + (match_operand:VI 1 "register_operand" " %0, vr, vr") + (match_operand:VI 2 "vector_arith_operand" "vrvi, vr, vi")) + (match_operand: 3 "register_operand" " vm, vm, vm") (unspec: - [(match_operand 4 "vector_length_operand" " rK, rK") - (match_operand 5 "const_int_operand" " i, i") + [(match_operand 4 "vector_length_operand" " rK, rK, rK") + (match_operand 5 "const_int_operand" " i, i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_VMADC))] "TARGET_VECTOR" @@ -2469,15 +2469,15 @@ (set (attr "avl_type") (symbol_ref "INTVAL (operands[5])"))]) (define_insn "@pred_msbc" - [(set (match_operand: 0 "register_operand" "=&vr") + [(set (match_operand: 0 "register_operand" "=vr, vr, &vr") (unspec: [(minus:VI - (match_operand:VI 1 "register_operand" " vr") - (match_operand:VI 2 "register_operand" " vr")) - (match_operand: 3 "register_operand" " vm") + (match_operand:VI 1 "register_operand" " 0, vr, vr") + (match_operand:VI 2 "register_operand" " vr, 0, vr")) + (match_operand: 3 "register_operand" " vm, vm, vm") (unspec: - [(match_operand 4 "vector_length_operand" " rK") - (match_operand 5 "const_int_operand" " i") + [(match_operand 4 "vector_length_operand" " rK, rK, rK") + (match_operand 5 "const_int_operand" " i, i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_VMSBC))] "TARGET_VECTOR" @@ -2488,16 +2488,16 @@ (set (attr "avl_type") (symbol_ref "INTVAL (operands[5])"))]) (define_insn "@pred_madc_scalar" - [(set (match_operand: 0 "register_operand" "=&vr") + [(set (match_operand: 0 "register_operand" "=vr, &vr") (unspec: [(plus:VI_QHS (vec_duplicate:VI_QHS - (match_operand: 2 "register_operand" " r")) - (match_operand:VI_QHS 1 "register_operand" " vr")) - (match_operand: 3 "register_operand" " vm") + (match_operand: 2 "register_operand" " r, r")) + (match_operand:VI_QHS 1 "register_operand" " 0, vr")) + (match_operand: 3 "register_operand" " vm, vm") (unspec: - [(match_operand 4 "vector_length_operand" " rK") - (match_operand 5 "const_int_operand" " i") + [(match_operand 4 "vector_length_operand" " rK, rK") + (match_operand 5 "const_int_operand" " i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_VMADC))] "TARGET_VECTOR" @@ -2508,16 +2508,16 @@ (set (attr "avl_type") (symbol_ref "INTVAL (operands[5])"))]) (define_insn "@pred_msbc_scalar" - [(set (match_operand: 0 "register_operand" "=&vr") + [(set (match_operand: 0 "register_operand" "=vr, &vr") (unspec: [(minus:VI_QHS (vec_duplicate:VI_QHS - (match_operand: 2 "reg_or_0_operand" " rJ")) - (match_operand:VI_QHS 1 "register_operand" " vr")) - (match_operand: 3 "register_operand" " vm") + (match_operand: 2 "reg_or_0_operand" " rJ, rJ")) + (match_operand:VI_QHS 1 "register_operand" " 0, vr")) + (match_operand: 3 "register_operand" " vm, vm") (unspec: - [(match_operand 4 "vector_length_operand" " rK") - (match_operand 5 "const_int_operand" " i") + [(match_operand 4 "vector_length_operand" " rK, rK") + (match_operand 5 "const_int_operand" " i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_VMSBC))] "TARGET_VECTOR" @@ -2557,16 +2557,16 @@ }) (define_insn "*pred_madc_scalar" - [(set (match_operand: 0 "register_operand" "=&vr") + [(set (match_operand: 0 "register_operand" "=vr, &vr") (unspec: [(plus:VI_D (vec_duplicate:VI_D - (match_operand: 2 "reg_or_0_operand" " rJ")) - (match_operand:VI_D 1 "register_operand" " vr")) - (match_operand: 3 "register_operand" " vm") + (match_operand: 2 "reg_or_0_operand" " rJ, rJ")) + (match_operand:VI_D 1 "register_operand" " 0, vr")) + (match_operand: 3 "register_operand" " vm, vm") (unspec: - [(match_operand 4 "vector_length_operand" " rK") - (match_operand 5 "const_int_operand" " i") + [(match_operand 4 "vector_length_operand" " rK, rK") + (match_operand 5 "const_int_operand" " i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_VMADC))] "TARGET_VECTOR" @@ -2577,17 +2577,17 @@ (set (attr "avl_type") (symbol_ref "INTVAL (operands[5])"))]) (define_insn "*pred_madc_extended_scalar" - [(set (match_operand: 0 "register_operand" "=&vr") + [(set (match_operand: 0 "register_operand" "=vr, &vr") (unspec: [(plus:VI_D (vec_duplicate:VI_D (sign_extend: - (match_operand: 2 "reg_or_0_operand" " rJ"))) - (match_operand:VI_D 1 "register_operand" " vr")) - (match_operand: 3 "register_operand" " vm") + (match_operand: 2 "reg_or_0_operand" " rJ, rJ"))) + (match_operand:VI_D 1 "register_operand" " 0, vr")) + (match_operand: 3 "register_operand" " vm, vm") (unspec: - [(match_operand 4 "vector_length_operand" " rK") - (match_operand 5 "const_int_operand" " i") + [(match_operand 4 "vector_length_operand" " rK, rK") + (match_operand 5 "const_int_operand" " i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_VMADC))] "TARGET_VECTOR" @@ -2627,16 +2627,16 @@ }) (define_insn "*pred_msbc_scalar" - [(set (match_operand: 0 "register_operand" "=&vr") + [(set (match_operand: 0 "register_operand" "=vr, &vr") (unspec: [(minus:VI_D (vec_duplicate:VI_D - (match_operand: 2 "reg_or_0_operand" " rJ")) - (match_operand:VI_D 1 "register_operand" " vr")) - (match_operand: 3 "register_operand" " vm") + (match_operand: 2 "reg_or_0_operand" " rJ, rJ")) + (match_operand:VI_D 1 "register_operand" " 0, vr")) + (match_operand: 3 "register_operand" " vm, vm") (unspec: - [(match_operand 4 "vector_length_operand" " rK") - (match_operand 5 "const_int_operand" " i") + [(match_operand 4 "vector_length_operand" " rK, rK") + (match_operand 5 "const_int_operand" " i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_VMSBC))] "TARGET_VECTOR" @@ -2647,17 +2647,17 @@ (set (attr "avl_type") (symbol_ref "INTVAL (operands[5])"))]) (define_insn "*pred_msbc_extended_scalar" - [(set (match_operand: 0 "register_operand" "=&vr") + [(set (match_operand: 0 "register_operand" "=vr, &vr") (unspec: [(minus:VI_D (vec_duplicate:VI_D (sign_extend: - (match_operand: 2 "reg_or_0_operand" " rJ"))) - (match_operand:VI_D 1 "register_operand" " vr")) - (match_operand: 3 "register_operand" " vm") + (match_operand: 2 "reg_or_0_operand" " rJ, rJ"))) + (match_operand:VI_D 1 "register_operand" " 0, vr")) + (match_operand: 3 "register_operand" " vm, vm") (unspec: - [(match_operand 4 "vector_length_operand" " rK") - (match_operand 5 "const_int_operand" " i") + [(match_operand 4 "vector_length_operand" " rK, rK") + (match_operand 5 "const_int_operand" " i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_VMSBC))] "TARGET_VECTOR" @@ -2668,14 +2668,14 @@ (set (attr "avl_type") (symbol_ref "INTVAL (operands[5])"))]) (define_insn "@pred_madc_overflow" - [(set (match_operand: 0 "register_operand" "=&vr, &vr") + [(set (match_operand: 0 "register_operand" "=vr, &vr, &vr") (unspec: [(plus:VI - (match_operand:VI 1 "register_operand" " vr, vr") - (match_operand:VI 2 "vector_arith_operand" " vr, vi")) + (match_operand:VI 1 "register_operand" " %0, vr, vr") + (match_operand:VI 2 "vector_arith_operand" "vrvi, vr, vi")) (unspec: - [(match_operand 3 "vector_length_operand" " rK, rK") - (match_operand 4 "const_int_operand" " i, i") + [(match_operand 3 "vector_length_operand" " rK, rK, rK") + (match_operand 4 "const_int_operand" " i, i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_OVERFLOW))] "TARGET_VECTOR" @@ -2686,14 +2686,14 @@ (set (attr "avl_type") (symbol_ref "INTVAL (operands[4])"))]) (define_insn "@pred_msbc_overflow" - [(set (match_operand: 0 "register_operand" "=&vr") + [(set (match_operand: 0 "register_operand" "=vr, vr, &vr, &vr") (unspec: [(minus:VI - (match_operand:VI 1 "register_operand" " vr") - (match_operand:VI 2 "register_operand" " vr")) + (match_operand:VI 1 "register_operand" " 0, vr, vr, vr") + (match_operand:VI 2 "register_operand" " vr, 0, vr, vi")) (unspec: - [(match_operand 3 "vector_length_operand" " rK") - (match_operand 4 "const_int_operand" " i") + [(match_operand 3 "vector_length_operand" " rK, rK, rK, rK") + (match_operand 4 "const_int_operand" " i, i, i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_OVERFLOW))] "TARGET_VECTOR" @@ -2704,15 +2704,15 @@ (set (attr "avl_type") (symbol_ref "INTVAL (operands[4])"))]) (define_insn "@pred_madc_overflow_scalar" - [(set (match_operand: 0 "register_operand" "=&vr") + [(set (match_operand: 0 "register_operand" "=vr, &vr") (unspec: [(plus:VI_QHS (vec_duplicate:VI_QHS - (match_operand: 2 "reg_or_0_operand" " rJ")) - (match_operand:VI_QHS 1 "register_operand" " vr")) + (match_operand: 2 "reg_or_0_operand" " rJ, rJ")) + (match_operand:VI_QHS 1 "register_operand" " 0, vr")) (unspec: - [(match_operand 3 "vector_length_operand" " rK") - (match_operand 4 "const_int_operand" " i") + [(match_operand 3 "vector_length_operand" " rK, rK") + (match_operand 4 "const_int_operand" " i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_OVERFLOW))] "TARGET_VECTOR" @@ -2723,15 +2723,15 @@ (set (attr "avl_type") (symbol_ref "INTVAL (operands[4])"))]) (define_insn "@pred_msbc_overflow_scalar" - [(set (match_operand: 0 "register_operand" "=&vr") + [(set (match_operand: 0 "register_operand" "=vr, &vr") (unspec: [(minus:VI_QHS (vec_duplicate:VI_QHS - (match_operand: 2 "reg_or_0_operand" " rJ")) - (match_operand:VI_QHS 1 "register_operand" " vr")) + (match_operand: 2 "reg_or_0_operand" " rJ, rJ")) + (match_operand:VI_QHS 1 "register_operand" " 0, vr")) (unspec: - [(match_operand 3 "vector_length_operand" " rK") - (match_operand 4 "const_int_operand" " i") + [(match_operand 3 "vector_length_operand" " rK, rK") + (match_operand 4 "const_int_operand" " i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_OVERFLOW))] "TARGET_VECTOR" @@ -2770,15 +2770,15 @@ }) (define_insn "*pred_madc_overflow_scalar" - [(set (match_operand: 0 "register_operand" "=&vr") + [(set (match_operand: 0 "register_operand" "=vr, &vr") (unspec: [(plus:VI_D (vec_duplicate:VI_D - (match_operand: 2 "reg_or_0_operand" " rJ")) - (match_operand:VI_D 1 "register_operand" " vr")) + (match_operand: 2 "reg_or_0_operand" " rJ, rJ")) + (match_operand:VI_D 1 "register_operand" " 0, vr")) (unspec: - [(match_operand 3 "vector_length_operand" " rK") - (match_operand 4 "const_int_operand" " i") + [(match_operand 3 "vector_length_operand" " rK, rK") + (match_operand 4 "const_int_operand" " i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_OVERFLOW))] "TARGET_VECTOR" @@ -2789,16 +2789,16 @@ (set (attr "avl_type") (symbol_ref "INTVAL (operands[4])"))]) (define_insn "*pred_madc_overflow_extended_scalar" - [(set (match_operand: 0 "register_operand" "=&vr") + [(set (match_operand: 0 "register_operand" "=vr, &vr") (unspec: [(plus:VI_D (vec_duplicate:VI_D (sign_extend: - (match_operand: 2 "reg_or_0_operand" " rJ"))) - (match_operand:VI_D 1 "register_operand" " vr")) + (match_operand: 2 "reg_or_0_operand" " rJ, rJ"))) + (match_operand:VI_D 1 "register_operand" " 0, vr")) (unspec: - [(match_operand 3 "vector_length_operand" " rK") - (match_operand 4 "const_int_operand" " i") + [(match_operand 3 "vector_length_operand" " rK, rK") + (match_operand 4 "const_int_operand" " i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_OVERFLOW))] "TARGET_VECTOR" @@ -2837,15 +2837,15 @@ }) (define_insn "*pred_msbc_overflow_scalar" - [(set (match_operand: 0 "register_operand" "=&vr") + [(set (match_operand: 0 "register_operand" "=vr, &vr") (unspec: [(minus:VI_D (vec_duplicate:VI_D - (match_operand: 2 "reg_or_0_operand" " rJ")) - (match_operand:VI_D 1 "register_operand" " vr")) + (match_operand: 2 "reg_or_0_operand" " rJ, rJ")) + (match_operand:VI_D 1 "register_operand" " 0, vr")) (unspec: - [(match_operand 3 "vector_length_operand" " rK") - (match_operand 4 "const_int_operand" " i") + [(match_operand 3 "vector_length_operand" " rK, rK") + (match_operand 4 "const_int_operand" " i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_OVERFLOW))] "TARGET_VECTOR" @@ -2856,16 +2856,16 @@ (set (attr "avl_type") (symbol_ref "INTVAL (operands[4])"))]) (define_insn "*pred_msbc_overflow_extended_scalar" - [(set (match_operand: 0 "register_operand" "=&vr") + [(set (match_operand: 0 "register_operand" "=vr, &vr") (unspec: [(minus:VI_D (vec_duplicate:VI_D (sign_extend: - (match_operand: 2 "reg_or_0_operand" " rJ"))) - (match_operand:VI_D 1 "register_operand" " vr")) + (match_operand: 2 "reg_or_0_operand" " rJ, rJ"))) + (match_operand:VI_D 1 "register_operand" " 0, vr")) (unspec: - [(match_operand 3 "vector_length_operand" " rK") - (match_operand 4 "const_int_operand" " i") + [(match_operand 3 "vector_length_operand" " rK, rK") + (match_operand 4 "const_int_operand" " i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)] UNSPEC_OVERFLOW))] "TARGET_VECTOR" diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-13.c b/gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-13.c new file mode 100644 index 00000000000..521af15ee5e --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-13.c @@ -0,0 +1,133 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ + +#include "riscv_vector.h" + +void f0 (int16_t *base,int8_t *out,size_t vl) +{ + vint16m2_t v0 = __riscv_vle16_v_i16m2 (base, vl); + vint16m2_t v1 = __riscv_vle16_v_i16m2 ((int16_t *)(base + 100), vl); + vbool8_t m = __riscv_vlm_v_b8 ((uint8_t *)(base + 200), vl); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27"); + + m = __riscv_vmadc_vvm_i16m2_b8 (v0, v1, m, 4); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v29", "v30", "v31"); + + __riscv_vsm_v_b8 (out,m,vl); +} + +void f1 (int16_t *base,int8_t *out,size_t vl) +{ + vint16m2_t v0 = __riscv_vle16_v_i16m2 (base, vl); + vint16m2_t v1 = __riscv_vle16_v_i16m2 ((int16_t *)(base + 100), vl); + vbool8_t m = __riscv_vlm_v_b8 ((uint8_t *)(base + 200), vl); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27"); + + m = __riscv_vmadc_vvm_i16m2_b8 (v0, v1, m, 4); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v31"); + + __riscv_vsm_v_b8 (out,m,vl); +} + +void f2 (int16_t *base,int8_t *out,size_t vl) +{ + vint16m2_t v0 = __riscv_vle16_v_i16m2 (base, vl); + vint16m2_t v1 = __riscv_vle16_v_i16m2 ((int16_t *)(base + 100), vl); + vbool8_t m = __riscv_vlm_v_b8 ((uint8_t *)(base + 200), vl); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27"); + + m = __riscv_vmadc_vvm_i16m2_b8 (v0, v1, m, 4); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v30", "v31"); + + __riscv_vsm_v_b8 (out,m,vl); +} + +void f3 (int16_t *base,int8_t *out,size_t vl) +{ + vint16mf2_t v0 = __riscv_vle16_v_i16mf2 (base, vl); + vint16mf2_t v1 = __riscv_vle16_v_i16mf2 ((int16_t *)(base + 100), vl); + vbool32_t m = __riscv_vlm_v_b32 ((uint8_t *)(base + 200), vl); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29"); + + m = __riscv_vmadc_vvm_i16mf2_b32 (v0, v1, m, 4); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v30"); + + __riscv_vsm_v_b32 (out,m,vl); +} + +void f4 (int16_t *base,int8_t *out,size_t vl) +{ + vint16mf2_t v0 = __riscv_vle16_v_i16mf2 (base, vl); + vint16mf2_t v1 = __riscv_vle16_v_i16mf2 ((int16_t *)(base + 100), vl); + vbool32_t m = __riscv_vlm_v_b32 ((uint8_t *)(base + 200), vl); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29"); + + m = __riscv_vmadc_vvm_i16mf2_b32 (v0, v1, m, 4); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v31"); + + __riscv_vsm_v_b32 (out,m,vl); +} + +void f5 (int16_t *base,int8_t *out,size_t vl) +{ + vint16mf2_t v0 = __riscv_vle16_v_i16mf2 (base, vl); + vint16mf2_t v1 = __riscv_vle16_v_i16mf2 ((int16_t *)(base + 100), vl); + vbool32_t m = __riscv_vlm_v_b32 ((uint8_t *)(base + 200), vl); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29"); + + m = __riscv_vmadc_vvm_i16mf2_b32 (v0, v1, m, 4); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v30", "v31"); + + __riscv_vsm_v_b32 (out,m,vl); +} + +/* { dg-final { scan-assembler-not {vmv} } } */ +/* { dg-final { scan-assembler-not {csrr} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-14.c b/gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-14.c new file mode 100644 index 00000000000..66a8791aeb2 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-14.c @@ -0,0 +1,133 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ + +#include "riscv_vector.h" + +void f0 (int16_t *base,int8_t *out,size_t vl) +{ + vint16m2_t v0 = __riscv_vle16_v_i16m2 (base, vl); + vint16m2_t v1 = __riscv_vle16_v_i16m2 ((int16_t *)(base + 100), vl); + vbool8_t m = __riscv_vlm_v_b8 ((uint8_t *)(base + 200), vl); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27"); + + m = __riscv_vmsbc_vvm_i16m2_b8 (v0, v1, m, 4); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v29", "v30", "v31"); + + __riscv_vsm_v_b8 (out,m,vl); +} + +void f1 (int16_t *base,int8_t *out,size_t vl) +{ + vint16m2_t v0 = __riscv_vle16_v_i16m2 (base, vl); + vint16m2_t v1 = __riscv_vle16_v_i16m2 ((int16_t *)(base + 100), vl); + vbool8_t m = __riscv_vlm_v_b8 ((uint8_t *)(base + 200), vl); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27"); + + m = __riscv_vmsbc_vvm_i16m2_b8 (v0, v1, m, 4); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v31"); + + __riscv_vsm_v_b8 (out,m,vl); +} + +void f2 (int16_t *base,int8_t *out,size_t vl) +{ + vint16m2_t v0 = __riscv_vle16_v_i16m2 (base, vl); + vint16m2_t v1 = __riscv_vle16_v_i16m2 ((int16_t *)(base + 100), vl); + vbool8_t m = __riscv_vlm_v_b8 ((uint8_t *)(base + 200), vl); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27"); + + m = __riscv_vmsbc_vvm_i16m2_b8 (v0, v1, m, 4); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v30", "v31"); + + __riscv_vsm_v_b8 (out,m,vl); +} + +void f3 (int16_t *base,int8_t *out,size_t vl) +{ + vint16mf2_t v0 = __riscv_vle16_v_i16mf2 (base, vl); + vint16mf2_t v1 = __riscv_vle16_v_i16mf2 ((int16_t *)(base + 100), vl); + vbool32_t m = __riscv_vlm_v_b32 ((uint8_t *)(base + 200), vl); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29"); + + m = __riscv_vmsbc_vvm_i16mf2_b32 (v0, v1, m, 4); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v30"); + + __riscv_vsm_v_b32 (out,m,vl); +} + +void f4 (int16_t *base,int8_t *out,size_t vl) +{ + vint16mf2_t v0 = __riscv_vle16_v_i16mf2 (base, vl); + vint16mf2_t v1 = __riscv_vle16_v_i16mf2 ((int16_t *)(base + 100), vl); + vbool32_t m = __riscv_vlm_v_b32 ((uint8_t *)(base + 200), vl); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29"); + + m = __riscv_vmsbc_vvm_i16mf2_b32 (v0, v1, m, 4); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v31"); + + __riscv_vsm_v_b32 (out,m,vl); +} + +void f5 (int16_t *base,int8_t *out,size_t vl) +{ + vint16mf2_t v0 = __riscv_vle16_v_i16mf2 (base, vl); + vint16mf2_t v1 = __riscv_vle16_v_i16mf2 ((int16_t *)(base + 100), vl); + vbool32_t m = __riscv_vlm_v_b32 ((uint8_t *)(base + 200), vl); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29"); + + m = __riscv_vmsbc_vvm_i16mf2_b32 (v0, v1, m, 4); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v30", "v31"); + + __riscv_vsm_v_b32 (out,m,vl); +} + +/* { dg-final { scan-assembler-not {vmv} } } */ +/* { dg-final { scan-assembler-not {csrr} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-15.c b/gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-15.c new file mode 100644 index 00000000000..b3add7b7bc7 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-15.c @@ -0,0 +1,127 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ + +#include "riscv_vector.h" + +void f0 (int16_t *base,int8_t *out,size_t vl) +{ + vint16m2_t v0 = __riscv_vle16_v_i16m2 (base, vl); + vint16m2_t v1 = __riscv_vle16_v_i16m2 ((int16_t *)(base + 100), vl); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27"); + + vbool8_t m = __riscv_vmadc_vv_i16m2_b8 (v0, v1,4); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v29", "v30", "v31"); + + __riscv_vsm_v_b8 (out,m,vl); +} + +void f1 (int16_t *base,int8_t *out,size_t vl) +{ + vint16m2_t v0 = __riscv_vle16_v_i16m2 (base, vl); + vint16m2_t v1 = __riscv_vle16_v_i16m2 ((int16_t *)(base + 100), vl); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27"); + + vbool8_t m = __riscv_vmadc_vv_i16m2_b8 (v0, v1,4); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v31"); + + __riscv_vsm_v_b8 (out,m,vl); +} + +void f2 (int16_t *base,int8_t *out,size_t vl) +{ + vint16m2_t v0 = __riscv_vle16_v_i16m2 (base, vl); + vint16m2_t v1 = __riscv_vle16_v_i16m2 ((int16_t *)(base + 100), vl); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27"); + + vbool8_t m = __riscv_vmadc_vv_i16m2_b8 (v0, v1,4); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v30", "v31"); + + __riscv_vsm_v_b8 (out,m,vl); +} + +void f3 (int16_t *base,int8_t *out,size_t vl) +{ + vint16mf2_t v0 = __riscv_vle16_v_i16mf2 (base, vl); + vint16mf2_t v1 = __riscv_vle16_v_i16mf2 ((int16_t *)(base + 100), vl); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29"); + + vbool32_t m = __riscv_vmadc_vv_i16mf2_b32 (v0, v1,4); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v30"); + + __riscv_vsm_v_b32 (out,m,vl); +} + +void f4 (int16_t *base,int8_t *out,size_t vl) +{ + vint16mf2_t v0 = __riscv_vle16_v_i16mf2 (base, vl); + vint16mf2_t v1 = __riscv_vle16_v_i16mf2 ((int16_t *)(base + 100), vl); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29"); + + vbool32_t m = __riscv_vmadc_vv_i16mf2_b32 (v0, v1,4); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v31"); + + __riscv_vsm_v_b32 (out,m,vl); +} + +void f5 (int16_t *base,int8_t *out,size_t vl) +{ + vint16mf2_t v0 = __riscv_vle16_v_i16mf2 (base, vl); + vint16mf2_t v1 = __riscv_vle16_v_i16mf2 ((int16_t *)(base + 100), vl); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29"); + + vbool32_t m = __riscv_vmadc_vv_i16mf2_b32 (v0, v1,4); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v30", "v31"); + + __riscv_vsm_v_b32 (out,m,vl); +} + +/* { dg-final { scan-assembler-not {vmv} } } */ +/* { dg-final { scan-assembler-not {csrr} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-16.c b/gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-16.c new file mode 100644 index 00000000000..468471c438a --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/narrow_constraint-16.c @@ -0,0 +1,127 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv -mabi=ilp32d -O3" } */ + +#include "riscv_vector.h" + +void f0 (int16_t *base,int8_t *out,size_t vl) +{ + vint16m2_t v0 = __riscv_vle16_v_i16m2 (base, vl); + vint16m2_t v1 = __riscv_vle16_v_i16m2 ((int16_t *)(base + 100), vl); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27"); + + vbool8_t m = __riscv_vmsbc_vv_i16m2_b8 (v0, v1,4); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v29", "v30", "v31"); + + __riscv_vsm_v_b8 (out,m,vl); +} + +void f1 (int16_t *base,int8_t *out,size_t vl) +{ + vint16m2_t v0 = __riscv_vle16_v_i16m2 (base, vl); + vint16m2_t v1 = __riscv_vle16_v_i16m2 ((int16_t *)(base + 100), vl); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27"); + + vbool8_t m = __riscv_vmsbc_vv_i16m2_b8 (v0, v1,4); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v31"); + + __riscv_vsm_v_b8 (out,m,vl); +} + +void f2 (int16_t *base,int8_t *out,size_t vl) +{ + vint16m2_t v0 = __riscv_vle16_v_i16m2 (base, vl); + vint16m2_t v1 = __riscv_vle16_v_i16m2 ((int16_t *)(base + 100), vl); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27"); + + vbool8_t m = __riscv_vmsbc_vv_i16m2_b8 (v0, v1,4); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v30", "v31"); + + __riscv_vsm_v_b8 (out,m,vl); +} + +void f3 (int16_t *base,int8_t *out,size_t vl) +{ + vint16mf2_t v0 = __riscv_vle16_v_i16mf2 (base, vl); + vint16mf2_t v1 = __riscv_vle16_v_i16mf2 ((int16_t *)(base + 100), vl); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29"); + + vbool32_t m = __riscv_vmsbc_vv_i16mf2_b32 (v0, v1,4); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v30"); + + __riscv_vsm_v_b32 (out,m,vl); +} + +void f4 (int16_t *base,int8_t *out,size_t vl) +{ + vint16mf2_t v0 = __riscv_vle16_v_i16mf2 (base, vl); + vint16mf2_t v1 = __riscv_vle16_v_i16mf2 ((int16_t *)(base + 100), vl); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29"); + + vbool32_t m = __riscv_vmsbc_vv_i16mf2_b32 (v0, v1,4); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29", "v31"); + + __riscv_vsm_v_b32 (out,m,vl); +} + +void f5 (int16_t *base,int8_t *out,size_t vl) +{ + vint16mf2_t v0 = __riscv_vle16_v_i16mf2 (base, vl); + vint16mf2_t v1 = __riscv_vle16_v_i16mf2 ((int16_t *)(base + 100), vl); + asm volatile("#" :: + : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v29"); + + vbool32_t m = __riscv_vmsbc_vv_i16mf2_b32 (v0, v1,4); + asm volatile("#" :: + : "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", + "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", + "v26", "v27", "v28", "v30", "v31"); + + __riscv_vsm_v_b32 (out,m,vl); +} + +/* { dg-final { scan-assembler-not {vmv} } } */ +/* { dg-final { scan-assembler-not {csrr} } } */