[PATCH] Improve rotation by mode bitsize - 1 (take 2)
Uros Bizjak
ubizjak@gmail.com
Mon May 13 16:57:00 GMT 2013
On Mon, May 13, 2013 at 6:43 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Fri, May 10, 2013 at 07:15:38PM +0200, Jan Hubicka wrote:
>> It seems to me that it is not different from normalizing reg-10 into reg+(-10)
>> we do for years (and for good reason). It is still target preference when use
>> add and when sub to perform the arithmetic, but it makes sense to keep single
>> canonical form of the expression both in RTL and Gimple.
>>
>> For example we may want to be able to prove that
>> (rotate reg 31) == (rotatert reg 1)
>> is true or
>> (rotate reg 30) == (rotatert reg 2)
>> is also true or cross jump both variants into one instruction.
>
> Ok, this patch reverts my earlier patch and does the canonicalization, for
> now for RTL only. Bootstrapped/regtested on x86_64-linux and i686-linux, ok
> for trunk?
>
> 2013-05-13 Jakub Jelinek <jakub@redhat.com>
>
> * expmed.c (expand_shift_1): Canonicalize rotates by
> constant bitsize / 2 to bitsize - 1.
> * simplify-rt.x (simplify_binary_operation_1) <case ROTATE,
> case ROTATERT>: Likewise.
>
> Revert:
> 2013-05-10 Jakub Jelinek <jakub@redhat.com>
>
> * config/i386/i386.md (rotateinv): New code attr.
> (*<rotate_insn><mode>3_1, *<rotate_insn>si3_1_zext,
> *<rotate_insn>qi3_1_slp): Emit rorl %eax instead of
> roll $31, %eax, etc.
You can revert your own patch without approval, so the patch approval
depends solely on the approval from ME maintainer.
Thanks,
Uros.
More information about the Gcc-patches
mailing list