Hi Will, on 2022/4/7 10:19 PM, will schmidt wrote: > On Mon, 2022-02-28 at 13:37 +0800, Kewen.Lin via Gcc-patches wrote: >> Hi, >> ... >> ----- >> PR testsuite/103196 >> >> gcc/testsuite/ChangeLog: >> >> * gcc.target/powerpc/p9-vec-length-7.h: Add DO_PRAGMA macro. >> * gcc.target/powerpc/p9-vec-length-epil-7.c: Use unroll pragma to >> disable any unrollings. >> * gcc.target/powerpc/p9-vec-length-full-7.c: Remove useless option. >> * gcc.target/powerpc/p9-vec-length.h: Likewise. > > I suggest a slight rearrangement and correction. > > The -fno-unroll-loops options are removed from *-epil-7.c and *-full-7.c. > > p9-vec-length.h adds the DO_PRAGMA macro. > > p9-vec-length-7.h updates (corrects?) whitespace and adds the PRAGMA call for > "GCC unroll 0" around the test loop. > >
Oops, thanks for catching and suggestion! I should have pasted up-to-date changelogs. >>> /* { dg-additional-options "--param=vect-partial-vector-usage=2" } */ >>> >>> diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vec-length.h >>> b/gcc/testsuite/gcc.target/powerpc/p9-vec-length.h >>> index 83418b0b641..7aefc9b308d 100644 >>> --- a/gcc/testsuite/gcc.target/powerpc/p9-vec-length.h >>> +++ b/gcc/testsuite/gcc.target/powerpc/p9-vec-length.h >>> @@ -1,5 +1,7 @@ >>> #include <stdint.h> >>> >>> +#define DO_PRAGMA(x) _Pragma (#x) >>> + > > I note that I'm used to seeing a different form of the pragma usage, > i.e. > #pragma GCC optimize("O3,unroll-loops") > > though there is one other case in the powerpc testsuite with the > _Pragma style. > _Pragma ("__vector") > > I expect this is fine either way. Though > with just the one call, perhaps the addition of the DO_PRAGMA() macro > is unnecessary? (thoughts?) > > It has to use _Pragma to support pragma in macro definition, the former writing doesn't work here. And yes, the DO_PRAGMA is unnecessary. I noticed that some existing cases in testsuite use it even if it's not required there either, eg: gcc/testsuite/gcc.target//i386/avx512fp16-floatvnhf.c etc. I think it follows the practice as described in https://gcc.gnu.org/onlinedocs/cpp/Pragmas.html with destringizing to make string easy. Will make this brief if Segher like this pragma approach. Thanks! BR, Kewen