From patchwork Mon Aug 21 11:58:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 136380 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp2948663vqi; Mon, 21 Aug 2023 04:59:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtNh5K9gHfCkEZxS1WbLA4sPXnCRYt0RtU8ARvSXVflhvFtxHwkT+yol8VLls4Jtvozr2R X-Received: by 2002:a17:906:31d4:b0:9a1:6858:a729 with SMTP id f20-20020a17090631d400b009a16858a729mr4763495ejf.67.1692619181125; Mon, 21 Aug 2023 04:59:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692619181; cv=none; d=google.com; s=arc-20160816; b=vot7AS+j0TRV+fhKacA2GGhO2GhSZAoDuH0d+kWTLXZFkyFI2wXmuxyWzYtR/bfp1t 8ZSRbhR7vCltYmSnzRNL09s1c0pJETtojbO8iPTBQDi2M4rh1QyHa7TKxg7AsjYVubBV JJfYRkSfAOIRI5/Zn9fZmYTHQngTlud2XizDjijKZrhOKFH1gqPBenPODJP2kYIL7WmS IzghO4hlfMESZOQPaTt/6Ktya94gOv+I8FqUlu7jRRff+Gzf4AP4jKEYd+CL6LiIvx4B LPtnRitTPeIIE7P0LT29++pU9fzc2AJK+Us6G2txpH0xBnmpFwyTP/uJUqQLWASQW0IR keyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:sender:errors-to:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:user-agent:subject:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=PXb65Wah0PBDqWkeZiMqvFWceULebrSR5ezB+YuSGFI=; fh=etb9MYHN7HLF/sff76ICVdPeKiI8ZsjoOL2bcdG0aog=; b=UmZVbjvqqIYQMp9EQL+bWVyV98xpGe0a+b7ALRQ+n9rHVlM5pHk4V6QK3ffYJrUFQA 3/4qfcmxtHc5nisEBDzSRiannH51+2q75FfbcaVyfpDPKMdPYqEf5ETKTKcTEzEloyIU kqzX1WASwEwRNqYi2L63O42E+0re3VAvmhGV/uPYRvlXQHn4/J5b44DXwEvYvCIToR+r LhK2yyXFgiz6T9gnG9VM6vHKYuoprGlQhX/UiCfmC7VH6ZU9iRmFMBobDQAh5GFvC7ru foceb+fHt0hO6xDULsmUkVsfHynRnVuVNdRCVHx+Dt8WRkamjPnN0xIRxUwsC0TAHyRz ZPNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=gp2Bxz3b; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q15-20020a1709060f8f00b0099cb00485b0si5466432ejj.498.2023.08.21.04.59.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 04:59:41 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=gp2Bxz3b; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 C86BE3857722 for ; Mon, 21 Aug 2023 11:59:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C86BE3857722 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692619179; bh=PXb65Wah0PBDqWkeZiMqvFWceULebrSR5ezB+YuSGFI=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=gp2Bxz3bKzS1+5+A525JaQgfM4V1X1h7D2BJVMqdjE/nV2B12xbP+pjsKny9da834 Udv4jza4BFUAIgM3yji6XVz/325Rg+X+IPUwLFfZcEJvcaqU7KaWSxbsnzrvS/c1pl RkygK9CPDM9/4u2+xYKP3UDONw2y3yzZT2kQZTaw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 601713858025 for ; Mon, 21 Aug 2023 11:58:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 601713858025 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 8C53222C3D for ; Mon, 21 Aug 2023 11:58:54 +0000 (UTC) Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 871282C143 for ; Mon, 21 Aug 2023 11:58:54 +0000 (UTC) Date: Mon, 21 Aug 2023 11:58:54 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix gcc.dg/vect/bb-slp-subgroups-2.c with 256bit vectors User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MISSING_MID, SPF_HELO_NONE, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" Message-Id: <20230821115939.C86BE3857722@sourceware.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774839850721465900 X-GMAIL-MSGID: 1774839850721465900 The following adds vect128, vect256 and vect512 effective targets and adjusts gcc.dg/vect/bb-slp-subgroups-2.c accordingly. Tested on x86_64-unknown-linux-gnu, pushed. * gcc.dg/vect/bb-slp-subgroups-2.c: Properly handle the vect256 case. --- gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c | 3 ++- gcc/testsuite/lib/target-supports.exp | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c index ead8d92f202..9431bcb9d5c 100644 --- a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c @@ -39,4 +39,5 @@ main (int argc, char **argv) } /* { dg-final { scan-tree-dump-times "Basic block will be vectorized using SLP" 1 "slp2" } } */ -/* { dg-final { scan-tree-dump-times "optimized: basic block" 2 "slp2" } } */ +/* { dg-final { scan-tree-dump-times "optimized: basic block" 2 "slp2" { target { ! vect256 } } } } */ +/* { dg-final { scan-tree-dump-times "optimized: basic block" 1 "slp2" { target { vect256 } } } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 5b5f8655184..d4623ee6b45 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8634,6 +8634,24 @@ proc check_effective_target_vect_variable_length { } { return [expr { [lindex [available_vector_sizes] 0] == 0 }] } +# Return 1 if the target supports vectors of 512 bits. + +proc check_effective_target_vect512 { } { + return [expr { [lsearch -exact [available_vector_sizes] 512] >= 0 }] +} + +# Return 1 if the target supports vectors of 256 bits. + +proc check_effective_target_vect256 { } { + return [expr { [lsearch -exact [available_vector_sizes] 256] >= 0 }] +} + +# Return 1 if the target supports vectors of 128 bits. + +proc check_effective_target_vect128 { } { + return [expr { [lsearch -exact [available_vector_sizes] 128] >= 0 }] +} + # Return 1 if the target supports vectors of 64 bits. proc check_effective_target_vect64 { } {