[PATCH 1/6] powerpc: Add ZERO_GPRS macros for register clears

Segher Boessenkool segher at kernel.crashing.org
Sat Jun 11 00:05:48 AEST 2022


Hi!

On Fri, Jun 10, 2022 at 01:32:58PM +1000, Rohan McLure wrote:
> > On 2 Jun 2022, at 2:00 am, Segher Boessenkool <segher at kernel.crashing.org> wrote:
> > This is for unary operations, not binary operations (there is only one
> > item on the RHS).  You can in principle put a string "a,b" in the rhs
> > parameter, but in practice you need a or b to depend on the loop counter
> > as well, so even such trickiness won't do.  Make the naming less
> > confusing, maybe?  Or don't have an unused extra level of abstraction in
> > the first place :-)

> Yep I see how having a macro to perform rX = rX <> Y for arbitrary infix <> and operand
> is unlikely to find much use outside of ZERO_GPRS.

Aha.  On PowerPC (like on most RISC-like architectures) all the normal
instructions are rD := rA OP rB, not rD := rD OP rA.  It looks like
that is our disconnect :-)


Segher


More information about the Linuxppc-dev mailing list