From patchwork Mon Jun 12 09:36:21 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: 106376 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2461811vqr; Mon, 12 Jun 2023 02:37:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5XGpXegN280KK5YpIyf4dh8tFuaQ/vV3PBw131oAT7MJ1VrTacMCKu31OXECuKaPSDIflm X-Received: by 2002:aa7:c794:0:b0:515:46f2:d3bf with SMTP id n20-20020aa7c794000000b0051546f2d3bfmr4330400eds.40.1686562625092; Mon, 12 Jun 2023 02:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562625; cv=none; d=google.com; s=arc-20160816; b=07DH7sI0jUCOLSlt4Q8HPbKTMJSkuFTUjfoKyrYDbbVu4HRbIs9O6Lt2Wvr25bWQe5 bkm6fw9HLmniHHj/jh6mjZSU7pef0bL49HK/aCMNOHuSKmdMrAIxQLj2WnQre/zhW14E gMCn40MRYeRMBjsKBdETIYmINCaWa/49OVUmMcQjmdNdppfKVxmpnyWsE0JWCpF2a/DH a2A6ryEUz5MoUyhi6X4Jgm7gB0wIOJUfBkxfbmhUsyf43TVm/IwlbxGy23ZFxVVxzHfY wYED/Ol2nRTWfrPSsTfOLRgo3ztEVKfeHuRxfbPAAoZ8wCBn942AhumL0LuZeG1c7mnX C6LQ== 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=ly8w6UjdOTlVxZLbYfGeJ4mr7m/hSyd5Sf8uae/5UY8=; b=0zmiQusejaCZW50dyLEUOvPipDZbR2/LmnM1i26oRfQt/7nr09juTAmj6aFuNlp6Wm T85UDqy2bgYkkzpJ6jqxDBtmlPPVBAlS+KxoGrxklnpyCFjO2Fc60oFzREvc+ec/HgD+ 4MZTf33eYWUkdMS5XvS+ltjjWvNYo+Xh3wTIEBJac9pJP1biv7m9EmuCcoUsDl8xv9HC yg6iWrsAhLhTXgadJsZ5AFvm8rR/kMxqVgMzinfhZKHYFMRDnMLBuM9lPCwCmwTDoLJ/ 6pWqXK/baI6FpdJ83yr8/3mBsbBmF7eSc2qUX3GIpQplNAfI6BWkecDMDc4uADhX+TIQ hxLg== 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 z18-20020aa7c652000000b0051494c50054si5536513edr.537.2023.06.12.02.37.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:37:05 -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 A859C3858422 for ; Mon, 12 Jun 2023 09:37:00 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbguseast2.qq.com (smtpbguseast2.qq.com [54.204.34.130]) by sourceware.org (Postfix) with ESMTPS id 92ADD3858D20 for ; Mon, 12 Jun 2023 09:36:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 92ADD3858D20 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: bizesmtp74t1686562583tp795i78 Received: from rios-cad5.localdomain ( [58.60.1.11]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 12 Jun 2023 17:36:22 +0800 (CST) X-QQ-SSF: 01400000000000F0S000000A0000000 X-QQ-FEAT: 3M0okmaRx3gqlM1HN44zWuD6aaL2kOrfk2QzuZoiHY6H2W/dmC3IbOAvvqLtr 63+R92hPbEaCcc7vh10s3I4//p5PhSjrcg7cojctZSp9nGDt3sJNh6U3pvJWQDsUbeG/gez rbhR0Ua9pyjl76vGQ41PPa+73wFEhsHsGTIErzHTz+ICem+ob+X7H/NKS4ghhGEGTvASe7H 5kAIg72ul6wd7aTEPqHjTpjdWiYMT5NktCFtReevw61Ln88hhU+3/vqIVHnJe9a77wOOo9l 0k62S7HUNl16wHD0YgPXbWmO5q/3qB+RVBVw/ea5p4aC8QRTjcY0GnccDuAL9YCAF+7jypJ IZhvV71Ea8DMcVpamtlItJ1uOz5d0+GuqSH/ZdLOlAPyYwkoHmxafU2UJpCOjvr+qLxjG5M 3FWY5M1Zmtg= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 15565855489735606894 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] RISC-V: Add ZVFHMIN autovec block testcase Date: Mon, 12 Jun 2023 17:36:21 +0800 Message-Id: <20230612093621.1223856-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?1768489091616401072?= X-GMAIL-MSGID: =?utf-8?q?1768489091616401072?= 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 | 34 +++++++++++++++++++ 1 file changed, 34 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..934d42c5d5c --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/zvfhmin-1.c @@ -0,0 +1,34 @@ +/* { 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]; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 0 "vect" } } */