Patchwork Allow widening multiplication in tree-ssa/slsr-*.c

login
register
mail settings
Submitter Hurugalawadi, Naveen
Date Jan. 16, 2013, 5:21 a.m.
Message ID <F3068DEED1A463459E0887A091B15493384B48@BY2PRD0710MB364.namprd07.prod.outlook.com>
Download mbox | patch
Permalink /patch/212390/
State New
Headers show

Comments

Hurugalawadi, Naveen - Jan. 16, 2013, 5:21 a.m.
Hi,

The slsr-*.c testsuite failures are due to not matching widening add
(or multiply-add) in AARCH64.
The LP64 targets generates WIDEN_MULT_PLUS_EXPR which is correct and
even better code generation will be produced. However, the testcase
expects +OP2 in these cases and hence FAIL's.

Please find attached the patch that checks "+ OP2" as earlier OR 
", OP2>" as produced with "WIDEN_MULT_PLUS_EXPR <1(D), 4, 12>" in LP64
targets that use a widening multiplication. 

Tested on aarch64-thunder-elf, x86_64-elf, arm-none-eabi and rx-elf.

Please review the patch and let me know if there should be any further
modifications in pattern check.

Regards,
Naveen

2013-01-16   Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

gcc/testsuite/
	* gcc.dg/tree-ssa/slsr-1.c: Allow widening multiplications.
	* gcc.dg/tree-ssa/slsr-2.c: Likewise.
	* gcc.dg/tree-ssa/slsr-3.c: Likewise.
Andrew Pinski - Jan. 16, 2013, 5:26 a.m.
On Tue, Jan 15, 2013 at 9:21 PM, Hurugalawadi, Naveen
<Naveen.Hurugalawadi@caviumnetworks.com> wrote:
> Hi,
>
> The slsr-*.c testsuite failures are due to not matching widening add
> (or multiply-add) in AARCH64.
> The LP64 targets generates WIDEN_MULT_PLUS_EXPR which is correct and
> even better code generation will be produced. However, the testcase
> expects +OP2 in these cases and hence FAIL's.
>
> Please find attached the patch that checks "+ OP2" as earlier OR
> ", OP2>" as produced with "WIDEN_MULT_PLUS_EXPR <1(D), 4, 12>" in LP64
> targets that use a widening multiplication.

It is not the target is LP64 but rather the target supports unsigned
widening from 32bit to 64bit multiple/plus instruction.
It is one of the few targets which support this.

Thanks,
Andrew Pinski

>
> Tested on aarch64-thunder-elf, x86_64-elf, arm-none-eabi and rx-elf.
>
> Please review the patch and let me know if there should be any further
> modifications in pattern check.
>
> Regards,
> Naveen
>
> 2013-01-16   Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>
>
> gcc/testsuite/
>         * gcc.dg/tree-ssa/slsr-1.c: Allow widening multiplications.
>         * gcc.dg/tree-ssa/slsr-2.c: Likewise.
>         * gcc.dg/tree-ssa/slsr-3.c: Likewise.

Patch

--- gcc/testsuite/gcc.dg/tree-ssa/slsr-1.c	2013-01-15 14:57:30.307425565 +0530
+++ gcc/testsuite/gcc.dg/tree-ssa/slsr-1.c	2013-01-15 15:04:02.087432920 +0530
@@ -14,7 +14,7 @@  f (int *p, unsigned int n)
     foo (*(p + 48 + n * 4));
 }
 
-/* { dg-final { scan-tree-dump-times "\\+ 128" 1 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\+ 64" 1 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\+ 192" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 128|\\, 128>" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 64|\\, 64>" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 192|\\, 192>" 1 "optimized" } } */
 /* { dg-final { cleanup-tree-dump "optimized" } } */
--- gcc/testsuite/gcc.dg/tree-ssa/slsr-2.c	2012-12-14 09:53:42.925262994 +0530
+++ gcc/testsuite/gcc.dg/tree-ssa/slsr-2.c	2013-01-15 15:05:30.543434580 +0530
@@ -11,6 +11,6 @@  f (int *p, int n)
   foo (*(p + 16 + n * 4));
 }
 
-/* { dg-final { scan-tree-dump-times "\\+ 144" 1 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\+ 96" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 144|\\, 144>" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 96|\\, 96>" 1 "optimized" } } */
 /* { dg-final { cleanup-tree-dump "optimized" } } */
--- gcc/testsuite/gcc.dg/tree-ssa/slsr-3.c	2012-12-14 09:53:42.925262994 +0530
+++ gcc/testsuite/gcc.dg/tree-ssa/slsr-3.c	2013-01-15 15:47:23.447481757 +0530
@@ -16,7 +16,7 @@  foo (int a[], int b[], int i)
 }
 
 /* { dg-final { scan-tree-dump-times "\\* 4" 1 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\+ 4" 2 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\+ 8" 1 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\+ 12" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 4|\\, 4>" 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 8|\\, 8>" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 12|\\, 12>" 1 "optimized" } } */
 /* { dg-final { cleanup-tree-dump "optimized" } } */