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
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 9 May 2013 21:47:49 +0200
- Subject: Re: [PATCH] Improve rotation by mode bitsize - 1
- References: <20130509184556 dot GI1377 at tucnak dot redhat dot com>
On Thu, May 9, 2013 at 8:45 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> This is something I've noticed while working on the rotate recognizer
> patch I've just posted. We emit say
> roll %eax
> instead of
> roll $1, %eax
> because the former is shorter, but emit
> roll $31, %eax
> instead of the equivalent, but shorter
> rorl %eax
> The following patch let us optimize even those. Bootstrapped/regtested
> on x86_64-linux and i686-linux, ok for trunk?
>
> 2013-05-09 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.
OK.
Thanks,
Uros.