This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [PR testsuite/81010] Fix PPC test


On 01/07/2018 10:09 AM, Segher Boessenkool wrote:
> Hi!
> 
> On Sun, Jan 07, 2018 at 12:58:25AM -0700, Jeff Law wrote:
>> As you note in the comments, the code we generate now is actually more
>> efficient so the test needs to be tweaked.
>>
>> Rather than checking the form in doloop, I check the form in .combine
>> and look for
>>
>> (compare:CC (zero_extend:DI (reg:SI
>>
>> The test is also twiddled to run on ppc64le.
>>
>> OK for the trunk?
>>
>> Jeff
> 
>> 	PR testsuite/81010
>> 	* gcc.target/powerpc/pr56605.c: Run on ppc64le too.  Verify
>> 	the zero extension is part of the test in the combiner dump.
>>
>>
>>
>> diff --git a/gcc/testsuite/gcc.target/powerpc/pr56605.c b/gcc/testsuite/gcc.target/powerpc/pr56605.c
>> index 3bc335f..be6456c 100644
>> --- a/gcc/testsuite/gcc.target/powerpc/pr56605.c
>> +++ b/gcc/testsuite/gcc.target/powerpc/pr56605.c
>> @@ -1,7 +1,7 @@
>>  /* PR rtl-optimization/56605 */
>> -/* { dg-do compile { target { powerpc64-*-* && lp64 } } } */
>> +/* { dg-do compile { target { powerpc64*-*-* && lp64 } } } */
> 
> You could as well do powerpc*-*-* afaics?
> 
>>  /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
> 
> And you could delete this line, since nothing in the testcase _needs_ the
> -mcpu=power7.
> 
>> -/* { dg-options "-O3 -mvsx -mcpu=power7 -fno-unroll-loops -fdump-rtl-loop2_doloop" } */
>> +/* { dg-options "-O3 -mvsx -mcpu=power7 -fno-unroll-loops -fdump-rtl-combine" } */
> 
> Something should check powerpc_vsx_ok, hrm.  Or just remove -mvsx?
> 
>>  
>>  void foo (short* __restrict sb, int* __restrict ia)
>>  {
>> @@ -10,4 +10,4 @@ void foo (short* __restrict sb, int* __restrict ia)
>>      ia[i] = (int) sb[i];
>>  }
>>  
>> -/* { dg-final { scan-rtl-dump-times "\\\(compare:CC \\\(subreg:SI \\\(reg:DI" 1 "loop2_doloop" } } */
>> +/* { dg-final { scan-rtl-dump-times "\\\(compare:CC \\\(zero_extend:DI \\\(reg:SI" 1 "combine" } } */
> 
> Yay, toothpickeritus ;-)
> 
> But none of that is new, so okay with or without those extra cleanups.
I've implemented most of the cleanups suggested.  Essentially bringing
the dg selectors/options in line with other vsx tests.

As expected this is still unsupported on ppc32.  Also as expected if I
force it to run, it would fail because we don't have the problematical
conversions between SImode and DImode.

And (of course) we pass the updated test on ppc64 and ppc64le.  Attached
is the final version of the patch that I've installed.

Jeff
	PR testsuite/81010
	* gcc.target/powerpc/pr56605.c: Update various dg- directives to
	better match other tests which require vsx.  Verify the zero
	extension is part of the test in the combiner dump.

diff --git a/gcc/testsuite/gcc.target/powerpc/pr56605.c b/gcc/testsuite/gcc.target/powerpc/pr56605.c
index 3bc335f..dc87640 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr56605.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr56605.c
@@ -1,7 +1,9 @@
 /* PR rtl-optimization/56605 */
-/* { dg-do compile { target { powerpc64-*-* && lp64 } } } */
+/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
-/* { dg-options "-O3 -mvsx -mcpu=power7 -fno-unroll-loops -fdump-rtl-loop2_doloop" } */
+/* { dg-options "-O3 -mvsx -mcpu=power7 -fno-unroll-loops -fdump-rtl-combine" } */
 
 void foo (short* __restrict sb, int* __restrict ia)
 {
@@ -10,4 +12,5 @@ void foo (short* __restrict sb, int* __restrict ia)
     ia[i] = (int) sb[i];
 }
 
-/* { dg-final { scan-rtl-dump-times "\\\(compare:CC \\\(subreg:SI \\\(reg:DI" 1 "loop2_doloop" } } */
+/* { dg-final { scan-rtl-dump-times "\\\(compare:CC \\\(zero_extend:DI \\\(reg:SI" 1 "combine" } } */
+

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]