From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by sourceware.org (Postfix) with ESMTPS id 04A7F3850429 for ; Sat, 24 Oct 2020 00:59:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 04A7F3850429 Received: by mail-pf1-x442.google.com with SMTP id x13so2782049pfa.9 for ; Fri, 23 Oct 2020 17:59:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GHny4CcLJj7TWWQcCGVrSAz2TNbq/HKvpIqmj6M+P6k=; b=Jco6BtDSm74JvHJ/DTr50BuPo1KzNZrOW8y3bcYAUQS3H8jtkpc/qMTQk80e9zLlqh 4UZrD4zMIEbtLmuX0PBM99aDITXuG5GkaHAnU5UeoONw3cZfUzqIPS2TGcYcIZMX2gzG OnhfeU6alLK4iGJoX7BNBVm4/PUxHd+C7QlzxH7kPVi9rrEESFqAm6ivAUPQVa45UNv1 p7GhJv8DTwLysh8GmR6YTorbE+IR4mnzJRyJ4TQvQgfJW0a2GpTIuUD3lkUm47wAQuBg hlM3nEZclxI79XjWnffobuq8H884JUN/sWcWk84ltFYq1V7JK74vhMAXNl4KCAUct50o Z3bw== X-Gm-Message-State: AOAM530gvXB1T4pxR5JcBo5epXCTNa3mvLdGcjXHqSpHcoIfPOSd4aEb 0Z3Ty+5vtlUmJ3LTc5jrDHCkU1tFc1I= X-Google-Smtp-Source: ABdhPJxeyRaeFXUXlXtoqQC1KPnj8PuMNffp0DFugvJyBsoafl1Fshyw8z9iZ6MXRqkqtTXM/H/u2A== X-Received: by 2002:a65:5a4d:: with SMTP id z13mr3816303pgs.297.1603501156379; Fri, 23 Oct 2020 17:59:16 -0700 (PDT) Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:d0e8:5a4d:f762:6d99]) by smtp.gmail.com with ESMTPSA id e6sm2755814pgn.9.2020.10.23.17.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 17:59:15 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id D56B082990; Sat, 24 Oct 2020 11:29:10 +1030 (ACDT) Date: Sat, 24 Oct 2020 11:29:10 +1030 From: Alan Modra To: Segher Boessenkool Cc: gcc-patches@gcc.gnu.org Subject: Re: [RS6000] Adjust testcases for power10 instructions Message-ID: <20201024005910.GC15973@bubble.grove.modra.org> References: <20201022070346.GL4898@bubble.grove.modra.org> <20201022125509.GN4898@bubble.grove.modra.org> <20201023061529.GR4898@bubble.grove.modra.org> <20201023182231.GF2672@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201023182231.GF2672@gate.crashing.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Sat, 24 Oct 2020 00:59:19 -0000 On Fri, Oct 23, 2020 at 01:22:31PM -0500, Segher Boessenkool wrote: > On Fri, Oct 23, 2020 at 04:45:29PM +1030, Alan Modra wrote: > > Revised patch, removing changes to > > gcc.target/powerpc/fold-vec-st-double.c, > > gcc.target/powerpc/fold-vec-st-longlong.c, > > gcc.target/powerpc/fold-vec-st-pixel.c. Fixing fails on those three > > tests will be the subject of another patch. > > Okido. > > > Most of these changes are fairly obvious. Duplicated setbcr in > > +/* { dg-final { scan-assembler-times {\maddic\M|\msetbcr\M} 4 } } */ > > +/* { dg-final { scan-assembler-times {\msubfe\M|\msetbcr\M} 1 } } */ > > is due to addic;subfe being replaced in one function with setbcr. > > But that won't really work. If there is more than one addic replaced by > setbcr, that second scan fails (because it matches at least two times > then). Sure it works. I did test the patch! If future code gen changes, the test will need updating at that point. scan-assembler tests require maintenance.. > > * gcc.dg/pr56727-2.c, > ... > > * gcc.target/powerpc/ppc-eq0-1.c, > > * gcc.target/powerpc/ppc-ne0-1.c, > > * gcc.target/powerpc/pr86731-fwrapv-longlong.c: Match power10 insns. > > This should all be behind only one "*" (so delete it on all but the > first line here). Huh, ok. > > --- a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a-pr63175.c > > +++ b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a-pr63175.c > > @@ -25,6 +25,6 @@ main1 (void) > > with no word loads (lw, lwu, lwz, lwzu, or their indexed forms) > > or word stores (stw, stwu, stwx, stwux, or their indexed forms). */ > > > > -/* { dg-final { scan-assembler "\t(lvx|lxv|lvsr|stxv)" } } */ > > +/* { dg-final { scan-assembler "\t(lvx|lxv|lvsr|stxv|plxv|pstxv)" } } */ > > /* { dg-final { scan-assembler "\t(lvx|p?lxv|lvsr|p?stxv)" } } */ > might be more readable/maintainable/extensible? OK. > > --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-char.c > > +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-char.c > > @@ -36,4 +36,4 @@ BUILD_VAR_TEST( test10, vector unsigned char, signed long long, vector unsigned > > BUILD_VAR_TEST( test11, vector unsigned char, signed int, vector unsigned char); > > BUILD_CST_TEST( test12, vector unsigned char, 8, vector unsigned char); > > > > -/* { dg-final { scan-assembler-times {\mlxvw4x\M|\mlxvd2x\M|\mlxvx\M|\mlvx\M} 12 } } */ > > +/* { dg-final { scan-assembler-times {\mlxvw4x\M|\mlxvd2x\M|\mlxvx\M|\mlvx\M|\mplxv\M} 12 } } */ > > Here, it did not allow lxv before. Should it? > > (in many files) We don't generate lxv due to the insn only supporting DQ offsets. For example, on power9 test3_cst from this test is li 9,2 lxvx 34,3,9 blr On power10 plxv 34,2(3) blr > Have you verified the p10 code generation actually makes sense? Yes, I did. > > --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-longlong.c > > +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-longlong.c > > @@ -25,7 +25,7 @@ vector signed long long test_sll () { const vector signed long long y = {34, 45} > > vector unsigned long long test_ull () { const vector unsigned long long y = {56, 67}; return vec_splat (y, 0b00010); } > > > > /* Assorted load instructions for the initialization with known constants. */ > > -/* { dg-final { scan-assembler-times {\mlvx\M|\mlxvd2x\M|\mlxv\M} 3 } } */ > > +/* { dg-final { scan-assembler-times {\mlvx\M|\mlxvd2x\M|\mlxv\M|\mplxv\M|\mplxv\M} 3 } } */ > > You have plxv twice here. Oops. > > --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-char.c > > +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-char.c > > @@ -36,4 +36,4 @@ BUILD_VAR_TEST( test10, vector unsigned char, signed long long, vector unsigned > > BUILD_VAR_TEST( test11, vector unsigned char, signed int, vector unsigned char ); > > BUILD_CST_TEST( test12, vector unsigned char, 12, vector unsigned char ); > > > > -/* { dg-final { scan-assembler-times {\mstxvw4x\M|\mstxvd2x\M|\mstxvx\M|\mstvx\M} 12 } } */ > > +/* { dg-final { scan-assembler-times {\mstxvw4x\M|\mstxvd2x\M|\mstxvx\M|\mstvx\M|\mpstxv\M} 12 } } */ > > Similarly, should it have plain stxv as well? No. Same reason as to why lxv isn't generated. > > --- a/gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c > > +++ b/gcc/testsuite/gcc.target/powerpc/lvsl-lvsr.c > > @@ -1,12 +1,10 @@ > > -/* Test expected code generation for lvsl and lvsr on little endian. > > - Note that lvsl and lvsr are each produced once, but the filename > > - causes them to appear twice in the file. */ > > +/* Test expected code generation for lvsl and lvsr on little endian. */ > > > > /* { dg-do compile { target { powerpc64le-*-* } } } */ > > /* { dg-options "-O0 -Wno-deprecated" } */ > > -/* { dg-final { scan-assembler-times "lvsl" 2 } } */ > > -/* { dg-final { scan-assembler-times "lvsr" 2 } } */ > > -/* { dg-final { scan-assembler-times {\mlxvd2x\M|\mlxv\M} 2 } } */ > > +/* { dg-final { scan-assembler-times {\slvsl\s} 1 } } */ > > +/* { dg-final { scan-assembler-times {\slvsr\s} 1 } } */ > > This could use a comment (we normally use \m \M). Seriously? That's about as useful as "i++; /* increment i */" > Better is to just rename the file, of course :-) I thought of that, but I'm not doing it. > > +/* { dg-final { scan-assembler-times {\mlxvd2x\M|\mlxv\M|\mplxv\M} 2 } } */ > > \mp?lxv\M Yeah, I'll change all of those. > > --- a/gcc/testsuite/gcc.target/powerpc/ppc-ne0-1.c > > +++ b/gcc/testsuite/gcc.target/powerpc/ppc-ne0-1.c > > @@ -2,9 +2,9 @@ > > /* { dg-do compile } */ > > /* { dg-options "-O2 -mno-isel" } */ > > > > -/* { dg-final { scan-assembler-times "addic" 4 } } */ > > -/* { dg-final { scan-assembler-times "subfe" 1 } } */ > > -/* { dg-final { scan-assembler-times "addze" 3 } } */ > > +/* { dg-final { scan-assembler-times {\maddic\M|\msetbcr\M} 4 } } */ > > +/* { dg-final { scan-assembler-times {\msubfe\M|\msetbcr\M} 1 } } */ > > +/* { dg-final { scan-assembler-times {\maddze\M} 3 } } */ > > So this one won't work like this. But it does. -- Alan Modra Australia Development Lab, IBM