Re: [PATCH] Fix PR63259: bswap not recognized when finishing with rotation

2014-10-31 Thread Richard Biener
On Wed, Oct 29, 2014 at 2:30 PM, Thomas Preud'homme wrote: >> From: Richard Biener [mailto:richard.guent...@gmail.com] >> Sent: Wednesday, October 08, 2014 8:27 AM >> >> I wouldn't worry about that too much. Indeed the question would be >> what >> should be canonical on GIMPLE (expanders should c

RE: [PATCH] Fix PR63259: bswap not recognized when finishing with rotation

2014-10-29 Thread Thomas Preud'homme
> From: Richard Biener [mailto:richard.guent...@gmail.com] > Sent: Wednesday, October 08, 2014 8:27 AM > > I wouldn't worry about that too much. Indeed the question would be > what > should be canonical on GIMPLE (expanders should choose the optimal > vairant from both). I think a tree code shou

Re: [PATCH] Fix PR63259: bswap not recognized when finishing with rotation

2014-10-08 Thread Richard Biener
On Wed, Oct 8, 2014 at 9:04 AM, Jakub Jelinek wrote: > On Wed, Oct 08, 2014 at 02:56:46PM +0800, Thomas Preud'homme wrote: >> > From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches- >> > ow...@gcc.gnu.org] On Behalf Of Thomas Preud'homme >> > Sent: Wednesday, October 08, 2014 2:43 PM >> > > Als

Re: [PATCH] Fix PR63259: bswap not recognized when finishing with rotation

2014-10-08 Thread Jakub Jelinek
On Wed, Oct 08, 2014 at 02:56:46PM +0800, Thomas Preud'homme wrote: > > From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches- > > ow...@gcc.gnu.org] On Behalf Of Thomas Preud'homme > > Sent: Wednesday, October 08, 2014 2:43 PM > > > Also, perhaps you could short-circuit this if the rotation isn'

Re: [PATCH] Fix PR63259: bswap not recognized when finishing with rotation

2014-10-07 Thread Andrew Pinski
On Tue, Oct 7, 2014 at 11:43 PM, Thomas Preud'homme wrote: >> From: Jakub Jelinek [mailto:ja...@redhat.com] >> Sent: Wednesday, October 08, 2014 2:39 PM >> >> Doesn't it turn 16-bit {L,R}ROTATE_EXPR used alone into >> __builtin_bswap16? >> For those the question is if the canonical GIMPLE should b

RE: [PATCH] Fix PR63259: bswap not recognized when finishing with rotation

2014-10-07 Thread Thomas Preud'homme
> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches- > ow...@gcc.gnu.org] On Behalf Of Thomas Preud'homme > Sent: Wednesday, October 08, 2014 2:43 PM > > Also, perhaps you could short-circuit this if the rotation isn't by constant Note that do_shift_rotate already check for this. Is it enoug

RE: [PATCH] Fix PR63259: bswap not recognized when finishing with rotation

2014-10-07 Thread Thomas Preud'homme
> From: Jakub Jelinek [mailto:ja...@redhat.com] > Sent: Wednesday, October 08, 2014 2:39 PM > > Doesn't it turn 16-bit {L,R}ROTATE_EXPR used alone into > __builtin_bswap16? > For those the question is if the canonical GIMPLE should be the rotation > or > byteswap, I'd think rotation would be perha

Re: [PATCH] Fix PR63259: bswap not recognized when finishing with rotation

2014-10-07 Thread Jakub Jelinek
On Wed, Oct 08, 2014 at 09:56:51AM +0800, Thomas Preud'homme wrote: > --- a/gcc/tree-ssa-math-opts.c > +++ b/gcc/tree-ssa-math-opts.c > @@ -2377,11 +2377,16 @@ pass_optimize_bswap::execute (function *fun) > { > gimple src_stmt, cur_stmt = gsi_stmt (gsi); > tree fndecl = NUL