From patchwork Wed Oct 11 05:15:02 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: 151117 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp313199vqb; Tue, 10 Oct 2023 22:15:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDV7bSu9UVaR7VRZ4ssFkhTn3UGlHhTYxXiOrSfAAlVCUWh1K2kgh8P6j1qGEXd6blKC+W X-Received: by 2002:a05:6402:4306:b0:53d:e5d7:4148 with SMTP id m6-20020a056402430600b0053de5d74148mr217919edc.1.1697001346809; Tue, 10 Oct 2023 22:15:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697001346; cv=none; d=google.com; s=arc-20160816; b=riRHyV9ywUN+tbBnuiBORNlRP4HErKH5ekny+oPIyZf25SycSXMg8o8fO6jhcvNAho b5d3laCfXFowJaK3RMLiLGUh/+c4HNpjaFOzLacChbb/hX+V4JvVNdJ8m2wJFFsHIWdB D61PY0zzGeAj8NGswgHYa2ZHaCpAulf8gPpG06M8jnjkahRf4gkkV6AyUYa0Agd37xIn MarxaC4Z6TGnE+d3lE3bsS4z+Gdm7pTl4KV5zj5Z9/1oH54MsTjsBlZZvLhb5Z3cYL9f qQfVFW55UrO1OEUcZpQ/4MvLmj65ZArztryj0WbXjq/i8jNbyRXUk3GAPxdafbC1qfz+ z69A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=webLrPJ+1QWBYV4beYYd4FN0oQcScUVsb96Hxm2DAjM=; fh=12MRPJmZ1mgDpHqWoogMKqnaGRGM2b7lcuJroqfjJiw=; b=MoBe5hd8PzNAvMoQIlL60nRdh7wL3nQLJbQZxBMNZo2fYC+rSZM9u0kftVfaqIEh8i +KwLyPU7t2wFhJJKsCD/6gWkNG8uTAuKZsRlBtgbSJhDHdSqUuReWTOgM4RQWOIqsZET LtDLZYJdyqK/qguyaBsvijVsdtCW8d6qv5F/22LKughWRFAPMtWHJncUoLstrySMOPRO v5wXIXzmOlx4m2G8SMrVlmpnl0vTAF3FE4UavqOs3ymsdXm6QQy2KgjAYneRkmTOwlIq 1geRIoFIgCpYB6sjkxV5+2zFKVzyPzb4moerJXb41bRFBmaJq3lqLbuvMoVoq6giIh7O ZwJA== 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 server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id k8-20020aa7d8c8000000b00533ff29423csi6268260eds.161.2023.10.10.22.15.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 22:15:46 -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 36F88385B531 for ; Wed, 11 Oct 2023 05:15:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) by sourceware.org (Postfix) with ESMTPS id 5868E3858C41 for ; Wed, 11 Oct 2023 05:15:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5868E3858C41 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: bizesmtp72t1697001305tgk8v0ly Received: from rios-cad121.hadoop.rioslab.org ( [58.60.1.9]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 11 Oct 2023 13:15:04 +0800 (CST) X-QQ-SSF: 01400000000000G0V000000A0000000 X-QQ-FEAT: KvvwR/hcPA1oFZzyvtZsOkDriAa1WBZ4ZEQTwjPgduH/Wn8L22N0HUXeWaiW+ zbZ+qP8rbHX/WmgZjRwPKDhBisDs4vkWlvCt+wX5zeVJKhGi6Oi+Nf+qEVSq7rGNDrtba9Y BNFv3M1m/0anhcWlREwXZxEb1U+mwA5W1ApRwDeSFpXNvS/tG+9hFyEf1xDsL9TWQBCmAhm DgfrlWooS5YDeN0JdXOfN9HgobBxEHlOy8wDn7bPFBBKKn5k0vKVZeb8B8hU+Bkis9qAkme fPl2QcR2Z5Yr4PsVj1LMeAYqC8zcrJNOPmI8huy5Q7cJokEdB5rW7A7HLv5oC/fRcanDKoP jSgDCWzNEDr6Pehp/+MKdG5pmtSMSl0zetacAGaKeVSA76Vd43DGtdmfVKwGRnRl4ly1aRF bEjQhdeIkt4= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 1404599850130578282 From: Juzhe-Zhong To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, kito.cheng@sifive.com, jeffreyalaw@gmail.com, rdapp.gcc@gmail.com, Juzhe-Zhong Subject: [PATCH] RISC-V: Enable full coverage vect tests Date: Wed, 11 Oct 2023 13:15:02 +0800 Message-Id: <20231011051502.1695577-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.2 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 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.30 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779434884201256095 X-GMAIL-MSGID: 1779434884201256095 I have analyzed all existing FAILs. Except these following FAILs need to be addressed: FAIL: gcc.dg/vect/slp-reduc-7.c -flto -ffat-lto-objects execution test FAIL: gcc.dg/vect/slp-reduc-7.c execution test FAIL: gcc.dg/vect/vect-cond-arith-2.c -flto -ffat-lto-objects scan-tree-dump optimized " = \\.COND_(LEN_)?SUB" FAIL: gcc.dg/vect/vect-cond-arith-2.c scan-tree-dump optimized " = \\.COND_(LEN_)?SUB" All other FAILs are dumple fail can be ignored (Confirm ARM SVE also has such FAILs and didn't fix them on either tests or implementation). Now, It's time to enable full coverage vect tests including vec_unpack, vec_pack, vec_interleave, ... etc. To see what we are still missing: Before this patch: === gcc Summary === # of expected passes 182839 # of unexpected failures 79 # of unexpected successes 11 # of expected failures 1275 # of unresolved testcases 4 # of unsupported tests 4223 After this patch: === gcc Summary === # of expected passes 183411 # of unexpected failures 93 # of unexpected successes 7 # of expected failures 1285 # of unresolved testcases 4 # of unsupported tests 4157 There is an important issue increased that I have noticed after this patch: FAIL: gcc.dg/vect/vect-gather-1.c -flto -ffat-lto-objects scan-tree-dump vect "Loop contains only SLP stmts" FAIL: gcc.dg/vect/vect-gather-1.c scan-tree-dump vect "Loop contains only SLP stmts" FAIL: gcc.dg/vect/vect-gather-3.c -flto -ffat-lto-objects scan-tree-dump vect "Loop contains only SLP stmts" FAIL: gcc.dg/vect/vect-gather-3.c scan-tree-dump vect "Loop contains only SLP stmts" It has a related PR: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111721 I am gonna fix this first in the middle-end after commit this patch. Ok for trunk ? gcc/testsuite/ChangeLog: * lib/target-supports.exp: Add RVV. --- gcc/testsuite/lib/target-supports.exp | 45 ++++++++++++++++++++------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index b454b07359a..8037dbcee53 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -7876,7 +7876,9 @@ proc check_effective_target_vect_sdot_qi { } { || [istarget aarch64*-*-*] || [istarget arm*-*-*] || ([istarget mips*-*-*] - && [et-is-effective-target mips_msa]) }}] + && [et-is-effective-target mips_msa]) + || ([istarget riscv*-*-*] + && [check_effective_target_riscv_v]) }}] } # Return 1 if the target plus current options supports a vector @@ -7891,7 +7893,9 @@ proc check_effective_target_vect_udot_qi { } { || [istarget arm*-*-*] || [istarget ia64-*-*] || ([istarget mips*-*-*] - && [et-is-effective-target mips_msa]) }}] + && [et-is-effective-target mips_msa]) + || ([istarget riscv*-*-*] + && [check_effective_target_riscv_v]) }}] } # Return 1 if the target plus current options supports a vector @@ -7918,7 +7922,9 @@ proc check_effective_target_vect_sdot_hi { } { || [istarget ia64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*] || ([istarget mips*-*-*] - && [et-is-effective-target mips_msa]) }}] + && [et-is-effective-target mips_msa]) + || ([istarget riscv*-*-*] + && [check_effective_target_riscv_v]) }}] } # Return 1 if the target plus current options supports a vector @@ -7930,7 +7936,9 @@ proc check_effective_target_vect_udot_hi { } { return [check_cached_effective_target_indexed vect_udot_hi { expr { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) || ([istarget mips*-*-*] - && [et-is-effective-target mips_msa]) }}] + && [et-is-effective-target mips_msa]) + || ([istarget riscv*-*-*] + && [check_effective_target_riscv_v]) }}] } # Return 1 if the target plus current options supports a vector @@ -7945,7 +7953,9 @@ proc check_effective_target_vect_usad_char { } { || ([istarget aarch64*-*-*] && ![check_effective_target_aarch64_sve]) || ([istarget powerpc*-*-*] - && [check_p9vector_hw_available])}}] + && [check_p9vector_hw_available]) + || ([istarget riscv*-*-*] + && [check_effective_target_riscv_v]) }}] } # Return 1 if the target plus current options supports both signed @@ -7971,8 +7981,10 @@ proc check_effective_target_vect_mulhrs_hi {} { # by power-of-2 operations on vectors of 4-byte integers. proc check_effective_target_vect_sdiv_pow2_si {} { - return [expr { [istarget aarch64*-*-*] - && [check_effective_target_aarch64_sve] }] + return [expr { ([istarget aarch64*-*-*] + && [check_effective_target_aarch64_sve]) + || ([istarget riscv*-*-*] + && [check_effective_target_riscv_v]) }] } # Return 1 if the target plus current options supports a vector @@ -7992,7 +8004,9 @@ proc check_effective_target_vect_pack_trunc { } { && [et-is-effective-target mips_msa]) || ([istarget s390*-*-*] && [check_effective_target_s390_vx]) - || [istarget amdgcn*-*-*] }}] + || [istarget amdgcn*-*-*] + || ([istarget riscv*-*-*] + && [check_effective_target_riscv_v]) }}] } # Return 1 if the target plus current options supports a vector @@ -8012,7 +8026,9 @@ proc check_effective_target_vect_unpack { } { && [check_effective_target_arm_little_endian]) || ([istarget s390*-*-*] && [check_effective_target_s390_vx]) - || [istarget amdgcn*-*-*] }}] + || [istarget amdgcn*-*-*] + || ([istarget riscv*-*-*] + && [check_effective_target_riscv_v]) }}] } # Return 1 if the target plus current options does not guarantee @@ -8662,7 +8678,8 @@ proc check_effective_target_vect_masked_store { } { # Return 1 if the target supports vector gather loads via internal functions. proc check_effective_target_vect_gather_load_ifn { } { - return [expr { [check_effective_target_aarch64_sve] }] + return [expr { [check_effective_target_aarch64_sve] + || [check_effective_target_riscv_v] }] } # Return 1 if the target supports vector scatter stores. @@ -8816,7 +8833,9 @@ proc check_effective_target_vect_extract_even_odd { } { && ([et-is-effective-target mips_msa] || [et-is-effective-target mpaired_single])) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) }}] + && [check_effective_target_s390_vx]) + || ([istarget riscv*-*-*] + && [check_effective_target_riscv_v]) }}] } # Return 1 if the target supports vector interleaving, 0 otherwise. @@ -8832,7 +8851,9 @@ proc check_effective_target_vect_interleave { } { && ([et-is-effective-target mpaired_single] || [et-is-effective-target mips_msa])) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) }}] + && [check_effective_target_s390_vx]) + || ([istarget riscv*-*-*] + && [check_effective_target_riscv_v]) }}] } foreach N {2 3 4 5 6 7 8} {