On Thu, May 17, 2018 at 02:40:11PM -0700, Carl Love wrote: > On Thu, 2018-05-17 at 15:31 -0500, Segher Boessenkool wrote: > > On Wed, May 16, 2018 at 12:53:13PM -0700, Carl Love wrote: > > > diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-12.c > > > b/gcc/testsuite/gcc.target/powerpc/altivec-12.c > > > index b0267b5..1f3175f 100644 > > > --- a/gcc/testsuite/gcc.target/powerpc/altivec-12.c > > > +++ b/gcc/testsuite/gcc.target/powerpc/altivec-12.c > > > @@ -18,7 +18,7 @@ vector char scz; > > > vector unsigned char uca = > > > {0,4,8,1,5,9,2,6,10,3,7,11,15,12,14,13}; > > > vector unsigned char ucb = > > > {6,4,8,3,1,9,2,6,10,3,7,11,15,12,14,13}; > > > vector unsigned char uc_expected = > > > {3,4,8,2,3,9,2,6,10,3,7,11,15,12,14,13}; > > > -vector char ucz; > > > +vector unsigned char ucz; > > > > Why? Was this a bug in the test case, does it quieten a warning? > > I was actually just making the naming consistent with the rest of the > variable naming. It doesn't impact the functionality. The other > variables, uca, ucb for example have their types explicitly stated as > "unsigned char" where the leading "u" stands for unsigned, "c" > represents char. However, we have ucz as type char not explicitly > "unsigned char". So, was just looking for consistency in the > name/declaration.
Ah ok. > > > diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-7-be.c > > > b/gcc/testsuite/gcc.target/powerpc/altivec-7-be.c > > > index 1e690be..f1eb78f 100644 > > > --- a/gcc/testsuite/gcc.target/powerpc/altivec-7-be.c > > > +++ b/gcc/testsuite/gcc.target/powerpc/altivec-7-be.c > > > @@ -1,4 +1,4 @@ > > > -/* { dg-do compile { target powerpc*-*-* } } */ > > > +/* { dg-do compile { target powerpc64-*-* } } */ > > > > This is not correct. The target triple is the (canonical) name of > > the > > architecture the compiler is built for, but you can do for example > > powerpc64-linux-gcc -m32, because we are a biarch target; a typical > > way to test is > > OK, wasn't thinking about the fact that the change makes it a 64-bit > only test. The test is supposed to be for big endian, i.e. the name is > altivec-7-be.c. We have another test file altivec-7-le.c for little > endian testing. The change was trying to make it a BE only test but as > you point out, I lose the 32-bit testing. The 32-bit mode will > obviously be BE. The thinking was powerpc64-*-* restricts the test to > BE where as powerpc64le-*-* restricts the test to LE. So I need to > qualify that on 64-bit I only want to run if I am on a 64-bit BE > system. How can I do that? I attach a patch that introduces "be" and "le" selectors, so you can say /* { dg-do compile { target powerpc64-*-* && be } } */ (completely untested so far, YMMV). > > > diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-1-le.c > > > b/gcc/testsuite/gcc.target/powerpc/builtins-1-le.c > > > index 2dd4953..c74c493 100644 > > > --- a/gcc/testsuite/gcc.target/powerpc/builtins-1-le.c > > > +++ b/gcc/testsuite/gcc.target/powerpc/builtins-1-le.c > > > @@ -1,5 +1,5 @@ > > /* { dg-do compile { target { powerpc64le-*-* } } } */ > > > -/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "- > > > mcpu=*" } { "-mcpu=power8" } } */ > > > +/* { dg-skip-if "do not override -mcpu" { powerpc64le-*-* } { "- > > > mcpu=*" } { "-mcpu=power8" } } */ > > > > This makes no difference, does it? Please keep it as it was. > > Ditto, trying to make this only run on LE as there is also a test file > builtins-1-be.c with /* { dg-do compile { target { powerpc64-*-* } } } > */ for testing on BE. But the testcase already only runs on powerpc64le, this change to the dg-skip-if doesn't change anything afaics. Segher --- 8< --- >From c98a698aa4bc9e753cd9c53a9970713406795195 Mon Sep 17 00:00:00 2001 Message-Id: <c98a698aa4bc9e753cd9c53a9970713406795195.1526679547.git.seg...@kernel.crashing.org> From: Segher Boessenkool <seg...@kernel.crashing.org> Date: Fri, 18 May 2018 16:13:38 +0000 Subject: [PATCH] be/le --- gcc/testsuite/lib/target-supports.exp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index cfc22a2..53367f3 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2641,6 +2641,22 @@ proc check_effective_target_long_neq_int { } { }] } +# Return 1 if we're generating big-endian code. + +proc check_effective_target_be { } { + return [check_no_compiler_messages be object { + int dummy[__BYTE_ORDER__ == ORDER_BIG_ENDIAN__ ? 1 : -1]; + }] +} + +# Return 1 if we're generating little-endian code. + +proc check_effective_target_le { } { + return [check_no_compiler_messages le object { + int dummy[__BYTE_ORDER__ == ORDER_LITTLE_ENDIAN__ ? 1 : -1]; + }] +} + # Return 1 if the target supports long double larger than double, # 0 otherwise. -- 1.8.3.1