This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch]: Fix 16457, missed ppc optimization


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.

eg.
  li 9,3
  rlwinm 10,9,0,31,0	# r10 = r9 & 0x80000001 ???

will result in r10 = 0x300000001
 
-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]