From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by sourceware.org (Postfix) with ESMTPS id 7444E3858C60 for ; Fri, 7 Jul 2023 06:34:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7444E3858C60 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2b6f52e1c5cso23045861fa.1 for ; Thu, 06 Jul 2023 23:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688711620; x=1691303620; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8JvGKauEf5cAIKpjPrcsnQu0pJmXpg3zepzQhLhsxow=; b=U4/zcbEzySdIz4VKVOzO0oKU4tWXNOB3IeR5Z7nP4SzPu+C4GAgyZ/n+H/LW9Yhit4 32bqNhm6u2Q7H5ZryhcDMT2QG6Re9Mqjk7/u1Btsfc/P/CRTg+QF52dFOFnStxa6sb5W X3u1Ov9MeNnwF4xN+cB2WQ7uNUBK4Hl5uEH0dGO4/o+88k+j3BpS6pN9UqvVdd6GojGq hjIBg1dybqGJUQON+sO1IsYhcU5TwkaFBUyqmy5OvrSdV9gfQB6K/SVtvXup5GagvEnu OALP3kq7SEP6NaEVgisgKEnj2jvIzfbhSEIzEkm7rD58eNYWcMqxopC/eJrD+BdYoXgz D+Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688711620; x=1691303620; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8JvGKauEf5cAIKpjPrcsnQu0pJmXpg3zepzQhLhsxow=; b=CuvC3nBeZayPqd0hlMPiHr95SEyI+efOjXY6y3flNMDbH8x6GRIxTOawxKAEqdAbKT IV/SBD7dZRaEhyUaeWTovU6oAY2evfcAYh/DH0BFZW0c79Onj3oAwEZk3QPWEngEXYbW laqdsjIgVBXJjrTWoM/bAdrEXKb4HraTPliTLXMTJn+dznq40XC/QkRG40shMYj1uihU 1VEu/ZD/r1ijHeD24ofAytNwzPB82OHDEv7Fml0pTctT8VzF3qGkWUz5g8twpfg4RkXQ rpNNZnBrxSgQakFe6JOSDqifOMAxinoiAQ1yvRiiGhZbPG7MfWgC3GuUC6K01A0NcHco UGQw== X-Gm-Message-State: ABy/qLaIMk/HrRsjyASE9iOsQ0/BDxLeUvzS7BZ3isz4PuWHaKy2CXdJ eRweNqFCtuVGtQM/kYo7K9kuV70FQmdInRy+p7tJ9ODilqs= X-Google-Smtp-Source: APBJJlEuFGgxJXggPzL7hKPeU1JjQJasRAQisvnp1kPtaNXpdcef+93k6TBJTZis6GqUl9Eqs77M6988WOaN3hNC9O8= X-Received: by 2002:a2e:9dd0:0:b0:2b4:6f17:31f7 with SMTP id x16-20020a2e9dd0000000b002b46f1731f7mr3448245ljj.27.1688711619501; Thu, 06 Jul 2023 23:33:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Fri, 7 Jul 2023 08:33:27 +0200 Message-ID: Subject: Re: [PATCH 2/3] testsuite: Require 128-bit vectors for bb-slp-pr95839.c To: "Maciej W. Rozycki" Cc: Rainer Orth , Mike Stump , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Jul 6, 2023 at 11:37=E2=80=AFPM Maciej W. Rozycki wrote: > > The bb-slp-pr95839.c test assumes quad-single float vector support, but > some targets only support pairs of floats, causing this test to fail > with such targets. Limit this test to targets that support at least > 128-bit vectors then, and add a complementing test that can be run with > targets that have support for 64-bit vectors only. There is no need to > adjust bb-slp-pr95839-2.c as 128 bits are needed even for the smallest > vector of doubles, so support is implied by the presence of vectors of > doubles. I wonder why you see the testcase FAIL, on x86-64 when doing typedef float __attribute__((vector_size(32))) v4f32; v4f32 f(v4f32 a, v4f32 b) { /* Check that we vectorize this CTOR without any loads. */ return (v4f32){a[0] + b[0], a[1] + b[1], a[2] + b[2], a[3] + b[3], a[4] + b[4], a[5] + b[5], a[6] + b[6], a[7] + b[7]}; } I see we vectorize the add and the "store". We fail to perform extraction from the incoming vectors (unless you enable AVX), that's a missed optimization. So with paired floats I would expect sth similar? Maybe x86 is saved by kind-of-presence (but disabled) of V8SFmode vectors. That said, we should handle this better so can you file an enhancement bugreport for this? Thanks, Richard. > gcc/testsuite/ > * gcc.dg/vect/bb-slp-pr95839.c: Limit to `vect128' targets. > * gcc.dg/vect/bb-slp-pr95839-v8.c: New test. > --- > gcc/testsuite/gcc.dg/vect/bb-slp-pr95839-v8.c | 14 ++++++++++++++ > gcc/testsuite/gcc.dg/vect/bb-slp-pr95839.c | 1 + > 2 files changed, 15 insertions(+) > > gcc-test-bb-slp-pr95839-vect128.diff > Index: gcc/gcc/testsuite/gcc.dg/vect/bb-slp-pr95839-v8.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- /dev/null > +++ gcc/gcc/testsuite/gcc.dg/vect/bb-slp-pr95839-v8.c > @@ -0,0 +1,14 @@ > +/* { dg-do compile } */ > +/* { dg-require-effective-target vect_float } */ > +/* { dg-require-effective-target vect64 } */ > +/* { dg-additional-options "-w -Wno-psabi" } */ > + > +typedef float __attribute__((vector_size(8))) v2f32; > + > +v2f32 f(v2f32 a, v2f32 b) > +{ > + /* Check that we vectorize this CTOR without any loads. */ > + return (v2f32){a[0] + b[0], a[1] + b[1]}; > +} > + > +/* { dg-final { scan-tree-dump "optimized: basic block" "slp2" } } */ > Index: gcc/gcc/testsuite/gcc.dg/vect/bb-slp-pr95839.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc.orig/gcc/testsuite/gcc.dg/vect/bb-slp-pr95839.c > +++ gcc/gcc/testsuite/gcc.dg/vect/bb-slp-pr95839.c > @@ -1,5 +1,6 @@ > /* { dg-do compile } */ > /* { dg-require-effective-target vect_float } */ > +/* { dg-require-effective-target vect128 } */ > /* { dg-additional-options "-w -Wno-psabi" } */ > > typedef float __attribute__((vector_size(16))) v4f32;