[PATCH] powerpc: Optimise the 64bit optimised __clear_user

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri Jun 8 10:51:37 EST 2012


On Thu, 2012-06-07 at 12:51 -0500, Scott Wood wrote:
> 
> The assembler can't tell that you used r0 rather than 0, because
> that's
> handled by the preprocessor, but it seems like a bug (or at least lax
> error checking) that it accepts %r0 there, and that objdump decodes it
> as "dcbz r0,r3" rather than "dcbz 0,r3".

Well, this is the domain of bike shed painting :-) the syntax of the
instruction is:

	dcbz RA,RB

Now, of course, like other RA,RB pairs it has the semantic that

if RA = 0 then b <- 0
else           b <- (RA)
EA <- b + (RB)

If we were to be pendantic and our assembly could also enforce the use
of % for registers, I suppose it would make sense to require 0 rather
than %0 for those "RA" forms to make it absolutely clear that we are
talking about 0 and not r0 in this specific case, I agree, but in the
current shape of the asm, I don't think that's something to expect.

Cheers,
Ben.




More information about the Linuxppc-dev mailing list