Marc Glisse | 3 Aug 2012 22:47
Picon
Picon
Favicon

[rtl, i386] combine concat+permutation

Hello,

this is a follow up to the patch applied after this discussion:
http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00504.html

It handles the -mavx __builtin_shuffle case mentioned there.

It passes bootstrap (languages=c,c++) and regtest on x86_64.

2012-08-04  Marc Glisse  <marc.glisse <at> inria.fr>

gcc/
 	* simplify-rtx.c (simplify_binary_operation_1): Optimize shuffle of
 	a concatenation.

gcc/testsuite/
 	* gcc.target/i386/perm-concat.c: New test.

--

-- 
Marc Glisse
Index: gcc/testsuite/gcc.target/i386/perm-concat.c
===================================================================
--- gcc/testsuite/gcc.target/i386/perm-concat.c	(revision 0)
+++ gcc/testsuite/gcc.target/i386/perm-concat.c	(revision 0)
 <at>  <at>  -0,0 +1,13  <at>  <at> 
+/* { dg-do compile } */
+/* { dg-options "-O -mavx -mfpmath=sse" } */
+
+typedef double v2df __attribute__ ((__vector_size__ (16)));
(Continue reading)

Marc Glisse | 17 Aug 2012 12:43
Picon
Picon
Favicon

Re: [rtl, i386] combine concat+permutation


Ping
http://gcc.gnu.org/ml/gcc-patches/2012-08/msg00205.html

(Cc: the nice reviewer of the previous patch)

On Fri, 3 Aug 2012, Marc Glisse wrote:

> Hello,
>
> this is a follow up to the patch applied after this discussion:
> http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00504.html
>
> It handles the -mavx __builtin_shuffle case mentioned there.
>
> It passes bootstrap (languages=c,c++) and regtest on x86_64.
>
>
> 2012-08-04  Marc Glisse  <marc.glisse <at> inria.fr>
>
> gcc/
> 	* simplify-rtx.c (simplify_binary_operation_1): Optimize shuffle of
> 	a concatenation.
>
> gcc/testsuite/
> 	* gcc.target/i386/perm-concat.c: New test.

--

-- 
Marc Glisse

(Continue reading)

Jakub Jelinek | 17 Aug 2012 12:52
Picon
Favicon

Re: [rtl, i386] combine concat+permutation

On Fri, Aug 03, 2012 at 10:47:25PM +0200, Marc Glisse wrote:
> Hello,
> 
> this is a follow up to the patch applied after this discussion:
> http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00504.html
> 
> It handles the -mavx __builtin_shuffle case mentioned there.
> 
> It passes bootstrap (languages=c,c++) and regtest on x86_64.

Ok.  Thanks.

> 2012-08-04  Marc Glisse  <marc.glisse <at> inria.fr>
> 
> gcc/
> 	* simplify-rtx.c (simplify_binary_operation_1): Optimize shuffle of
> 	a concatenation.
> 
> gcc/testsuite/
> 	* gcc.target/i386/perm-concat.c: New test.

	Jakub

Marc Glisse | 18 Aug 2012 17:03
Picon
Picon
Favicon

Re: [rtl, i386] combine concat+permutation

On Fri, 17 Aug 2012, Jakub Jelinek wrote:

> On Fri, Aug 03, 2012 at 10:47:25PM +0200, Marc Glisse wrote:
>> Hello,
>>
>> this is a follow up to the patch applied after this discussion:
>> http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00504.html
>>
>> It handles the -mavx __builtin_shuffle case mentioned there.
>>
>> It passes bootstrap (languages=c,c++) and regtest on x86_64.
>
> Ok.  Thanks.
>
>> 2012-08-04  Marc Glisse  <marc.glisse <at> inria.fr>
>>
>> gcc/
>> 	* simplify-rtx.c (simplify_binary_operation_1): Optimize shuffle of
>> 	a concatenation.
>>
>> gcc/testsuite/
>> 	* gcc.target/i386/perm-concat.c: New test.

Thanks, committed.

I just noticed that for __builtin_shuffle, this is an optimization that 
fold_ternary knows, but which never happens for 2 reasons:

1) the first time it sees the VEC_PERM_EXPR, the last argument is a 
CONSTRUCTOR but it only handles VECTOR_CST (this also breaks constexpr 
(Continue reading)


Gmane