From patchwork Mon Jun 12 09:44:58 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: 106383 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2465062vqr; Mon, 12 Jun 2023 02:45:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60H89ZQWYLWUAVGVgRvnavYNhRSgzHWH8Jqf78D6KK16uAoLaH05bm8HaByTcHLScQMrSq X-Received: by 2002:a17:907:60d3:b0:978:8937:19ba with SMTP id hv19-20020a17090760d300b00978893719bamr9339924ejc.44.1686563139177; Mon, 12 Jun 2023 02:45:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686563139; cv=none; d=google.com; s=arc-20160816; b=UBHMbLzuPTQ9G4j1uJJUaZL8Oocz1uOrljyrlpQjEqaId6AH+IHoyiE2Xa0WF/UKOC /t/6/4ot/+IpEXaYZPhaWqXqhfIop3IRnqwr+i41CTbIwWBI59mXz1NXmz8p2SQJL4AD JcAFS+qm+Bof93cW0z1jWrRQ/rwGEAGtHXHWzoiiuInCP+xd1LQ6Ah76+pyZA1VvvDI1 AS78EpyyGxU0b7c0zDgJPfQi9HbglbR0F4DaWJNcRqhhKw4LdSbjRXFbP2a7ZKW+K2bR D+XCUthMrKk7n01LBiUciBEW35OiV3ArLSu8f38WcFx+RdHoiH+7P5hhqxy3jtK0FVso 2JDg== 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=LtjE0/gUsplzYGTLm0U9ddUa7PVkNYaYKsFrJ4v9i7g=; b=DdWODBcS/KzGBvmVt2smpAJawjRdImKo+TLbmtuK60uazAy0uasjgBylAmBGe6Qp87 JkpRNx3S4eCqhr7L7y+t7q43FG84sL/+DZ3JkBE7bO/0y7L0G0Eeh3MSOorULQRcXpjT IgMZAVgvxoWI8Re/tx+Jh7U7BxICFDWtnjb/SgF0IWj0KNwnakc0hrMxudzwJxlbXM8N A6v34bFj1/5bVBmpjjQ0DMquAoVmzP7nDgm8tTNYmynU82ILk/KPhoOE257ITj8dQCw8 qyQ6TPYjN9x1XADeQXRq9oT/BUBmD/dbH+qvCfwNu8CCC+J2nTEw6EWG+3g2mLj2TMcI kobA== 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 k8-20020a17090666c800b00977e0843714si5184411ejp.1002.2023.06.12.02.45.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:45:39 -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 A6B7B3858C74 for ; Mon, 12 Jun 2023 09:45:33 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgbr1.qq.com (smtpbgbr1.qq.com [54.207.19.206]) by sourceware.org (Postfix) with ESMTPS id 19C0C3858D20 for ; Mon, 12 Jun 2023 09:45:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 19C0C3858D20 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: bizesmtp79t1686563100tkpos00b Received: from rios-cad5.localdomain ( [58.60.1.11]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 12 Jun 2023 17:44:59 +0800 (CST) X-QQ-SSF: 01400000000000F0S000000A0000000 X-QQ-FEAT: cGHDSTRkEGRWj7EgYGqDDvm5QPgb1/trgmSuF+DNbS5M1ae3ZFI5Gye+A2+oQ cER++qXeBPBQqnWfR6Z9ajP1UF++YocJaDgs7BL/SUdyH5gAsWO5Wu2MUGQPw2sER6oKcmT 9K2D/Ug9HjDgjJkbGOCndkjCjWNoe15N9sA24RaNoIYevIcdWuRhF4FX6FNpnV+lENXxEVK JRA0hDFUwLqtihpYp1KdZ3Ipb0EGDvfPK2tz0apvee9h3iwNItdXA44943KuuKScgKGlVFf nQMPanKdvWylr9Orkz38Mnnyw5YZFpVERwifAwmD5PUjme3VtNv1cCXiy1jPu0FfcO2I/6N 1w97pQVHYwwiDhuZQ2ZdW7u2u2QLQLGDVBgavSoSmPCUkw7Ho8p/AOoAavVBeRsfeO+o0n1 X-QQ-GoodBg: 2 X-BIZMAIL-ID: 17585555690391734417 From: juzhe.zhong@rivai.ai To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, kito.cheng@sifive.com, palmer@dabbelt.com, palmer@rivosinc.com, jeffreyalaw@gmail.com, rdapp.gcc@gmail.com, Juzhe-Zhong Subject: [PATCH V2] RISC-V: Add ZVFHMIN block autovec testcase Date: Mon, 12 Jun 2023 17:44:58 +0800 Message-Id: <20230612094458.1230512-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:qybglogicsvrgz:qybglogicsvrgz7a-one-0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, 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?1768489630568919951?= X-GMAIL-MSGID: =?utf-8?q?1768489630568919951?= From: Juzhe-Zhong To be safe, add ZVFHMIN autovec block testcase to make sure we won't enable autovec in ZVFHMIN by mistakes. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/zvfhmin-1.c: New test. --- .../gcc.target/riscv/rvv/autovec/zvfhmin-1.c | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/zvfhmin-1.c diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/zvfhmin-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/zvfhmin-1.c new file mode 100644 index 00000000000..08da48d0270 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/zvfhmin-1.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv32gcv_zvfhmin -mabi=ilp32d --param riscv-autovec-preference=scalable -fdump-tree-vect-details" } */ + +void f0 (_Float16 * __restrict a, _Float16 * __restrict b, int n) +{ + for (int i = 0; i < n; i++) + a[i] = -b[i]; +} + +void f1 (_Float16 * __restrict a, _Float16 * __restrict b, int n) +{ + for (int i = 0; i < n; i++) + a[i] = a[i]+b[i]; +} + +void f2 (_Float16 * __restrict a, _Float16 * __restrict b, int n) +{ + for (int i = 0; i < n; i++) + a[i] = a[i]-b[i]; +} + +void f3 (_Float16 * __restrict a, _Float16 * __restrict b, int n) +{ + for (int i = 0; i < n; i++) + a[i] = a[i]*b[i]; +} + +void f4 (_Float16 * __restrict a, _Float16 * __restrict b, int n) +{ + for (int i = 0; i < n; i++) + a[i] = a[i]/b[i]; +} + +/* We can't enable FP16 NEG/PLUS/MINUS/MULT/DIV auto-vectorization when -march="*zvfhmin*". */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 0 "vect" } } */