This is the mail archive of the
mailing list for the GCC project.
Re: [patch]: Fix 16457, missed ppc optimization
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>,David Edelsohn <dje at watson dot ibm dot com>
- Date: Tue, 9 Nov 2004 11:50:50 +1030
- Subject: Re: [patch]: Fix 16457, missed ppc optimization
- References: <418F9EA0.firstname.lastname@example.org>
On Mon, Nov 08, 2004 at 04:28:16PM +0000, Nathan Sidwell wrote:
> + /* We can use a single rlwinm insn if no upper bits of C are set
> + AND there are zero, one or two transitions in the _whole_ of
> + C. */
Are you sure about this? rlwinm rt,rs,0,mb,me performs an AND operation
using a mask generated with 1's from bit mb+32 to me+32. When mb is
larger than me, the mask wraps around and you get all 1's in the upper
32 bits. What's more, the low 32 bit word of rs is duplicated in the
high 32 bit word before the AND operation.
rlwinm 10,9,0,31,0 # r10 = r9 & 0x80000001 ???
will result in r10 = 0x300000001
IBM OzLabs - Linux Technology Centre