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
> 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
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
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'
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
> 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
> 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
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
Currently the bswap pass only look for bswap pattern by examining bitwise
OR statement and doing following def-use chains. However a rotation
(left or right) can finish a manual byteswap, as shown in the following example:
unsigned
byteswap_ending_with_rotation (unsigned in)
{
in = ((in & 0xff