This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Improve rotation by mode bitsize - 1 (take 2)
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Richard Biener <rguenther at suse dot de>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 13 May 2013 18:57:29 +0200
- Subject: Re: [PATCH] Improve rotation by mode bitsize - 1 (take 2)
- References: <20130509184556 dot GI1377 at tucnak dot redhat dot com> <20130510134849 dot GD23785 at atrey dot karlin dot mff dot cuni dot cz> <20130510140926 dot GN1377 at tucnak dot redhat dot com> <20130510171538 dot GB7824 at kam dot mff dot cuni dot cz> <20130513164358 dot GB1377 at tucnak dot redhat dot com>
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.