> 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 perhaps better.  Or depending on
> if
> the backend has bswaphi2 or rotate pattern?

Good point. It seems better to keep the status quo.

> 
> Also, perhaps you could short-circuit this if the rotation isn't by constant
> or not a multiple of BITS_PER_UNIT.  So
>         switch (code)
>           {
>           case BIT_IOR_EXPR:
>             break;
>           case LROTATE_EXPR:
>           case RROTATE_EXPR:
>             if (!tree_fits_uhwi_p (gimple_assign_rhs2 (cur_stmt))
>                 || (tree_to_uhwi (gimple_assign_rhs2 (cur_stmt))
>                     % BITS_PER_UNIT))
>               continue;
>             break;
>           default:
>             continue;
>           }
> ?

Right. Thanks for the comments.

Best regards,

Thomas




Reply via email to