bug in arch/ppc/kernel/misc.S: __ashrdi3?

Benjamin Herrenschmidt benh at kernel.crashing.org
Sun Jul 17 04:24:57 EST 2005


On Sat, 2005-07-16 at 20:02 +0200, Andreas Schwab wrote:
> Benjamin Herrenschmidt <benh at kernel.crashing.org> writes:
> 
> > On Fri, 2005-07-15 at 18:01 +0200, Frank van Maarseveen wrote:
> >> I don't really grok the code but an operand seems to be missing and the
> >> assembler makes something out of it I don't trust:
> >> 
> >> _GLOBAL(__ashrdi3)
> >> 	...
> >> 	rlwinm  r8,r7,0,32      # t3 = (count < 32) ? 32 : 0
> >
> > This is equivalent to r8 = r7 & 32. It will definitely not do what the
> > comment says though. If (count < 64), however, it will do something
> > like r8 = (r7 < 32) ? 0 : 32. Paul, maybe we should dbl check what's
> > going in there ?
> 
> r7 is count + 32, and ((count + 32) & 32) is equivalent to the expression
> above if count < 64.

Ok, with some context it makes more sense :)

Ben.





More information about the Linuxppc-dev mailing list