Re: [PATCH] Simplify a VEC_SELECT fed by its own inverse

2014-06-02 Thread Andreas Schwab
Bill Schmidt writes: > Index: gcc/testsuite/gcc.target/powerpc/vsxcopy.c > === > --- gcc/testsuite/gcc.target/powerpc/vsxcopy.c(revision 0) > +++ gcc/testsuite/gcc.target/powerpc/vsxcopy.c(working copy) > @@ -0,0 +1,1

Re: [PATCH] Simplify a VEC_SELECT fed by its own inverse

2014-04-22 Thread Bill Schmidt
Hi, Below is the revised patch addressing Richard's concerns about the assertions. Bootstrapped and tested on powerpc64[,le]-unknown-linux-gnu. Ok for trunk? Thanks, Bill [gcc] 2014-04-22 Bill Schmidt * simplify-rtx.c (simplify_binary_operation_1): Optimize case of nested

Re: [PATCH] Simplify a VEC_SELECT fed by its own inverse

2014-04-22 Thread Richard Sandiford
Marc Glisse writes: > On Mon, 21 Apr 2014, Richard Henderson wrote: > >> On 04/21/2014 01:19 PM, Bill Schmidt wrote: >>> + if (GET_CODE (trueop0) == VEC_SELECT >>> + && GET_MODE (XEXP (trueop0, 0)) == mode) >>> + { >>> + rtx op0_subop1 = XEXP (trueop0, 1); >>> + gcc_assert (GET_

Re: [PATCH] Simplify a VEC_SELECT fed by its own inverse

2014-04-21 Thread Marc Glisse
On Mon, 21 Apr 2014, Richard Henderson wrote: On 04/21/2014 01:19 PM, Bill Schmidt wrote: + if (GET_CODE (trueop0) == VEC_SELECT + && GET_MODE (XEXP (trueop0, 0)) == mode) + { + rtx op0_subop1 = XEXP (trueop0, 1); + gcc_assert (GET_CODE (op0_subop1) == PARALLE

Re: [PATCH] Simplify a VEC_SELECT fed by its own inverse

2014-04-21 Thread Bill Schmidt
On Mon, 2014-04-21 at 13:48 -0700, Richard Henderson wrote: > On 04/21/2014 01:19 PM, Bill Schmidt wrote: > > + if (GET_CODE (trueop0) == VEC_SELECT > > + && GET_MODE (XEXP (trueop0, 0)) == mode) > > + { > > + rtx op0_subop1 = XEXP (trueop0, 1); > > + gcc_assert (GET_CODE (op0_su

Re: [PATCH] Simplify a VEC_SELECT fed by its own inverse

2014-04-21 Thread Richard Henderson
On 04/21/2014 01:19 PM, Bill Schmidt wrote: > + if (GET_CODE (trueop0) == VEC_SELECT > + && GET_MODE (XEXP (trueop0, 0)) == mode) > + { > + rtx op0_subop1 = XEXP (trueop0, 1); > + gcc_assert (GET_CODE (op0_subop1) == PARALLEL); > + gcc_assert (XVECLEN (trueop1, 0) =

Re: [PATCH] Simplify a VEC_SELECT fed by its own inverse

2014-04-21 Thread Bill Schmidt
Hi, Here's a revised patch in response to Marc's comments. Again, bootstrapped and tested on powerpc64[,le]-unknown-linux-gnu. Is this ok for trunk? Thanks, Bill [gcc] 2014-04-21 Bill Schmidt * simplify-rtx.c (simplify_binary_operation_1): Optimize case of nested VEC_SELE

Re: [PATCH] Simplify a VEC_SELECT fed by its own inverse

2014-04-21 Thread Bill Schmidt
Hi Marc, Good points! I will rework the patch with your suggestions in mind. Thanks! Bill On Mon, 2014-04-21 at 18:51 +0200, Marc Glisse wrote: > On Mon, 21 Apr 2014, Bill Schmidt wrote: > > > Note that it would be possible to do a more general transformation here, > > in which any vec_select

Re: [PATCH] Simplify a VEC_SELECT fed by its own inverse

2014-04-21 Thread Marc Glisse
On Mon, 21 Apr 2014, Bill Schmidt wrote: Note that it would be possible to do a more general transformation here, in which any vec_select feeding another could be replaced by a vec_select performing the composite function of the other two. I have not done this because I am unaware of this situa

[PATCH] Simplify a VEC_SELECT fed by its own inverse

2014-04-21 Thread Bill Schmidt
Hi, This patch adds a small RTL simplification for the case where the first operand to a VEC_SELECT is another VEC_SELECT with an inverse selection function. E.g., (vec_select:V4SF (vec_select:V4SF (OP:V4SF) (parallel [2 3 0 1])) (parallel [2 3 0 1])) may be simplified to (OP:V