[PATCH 1/6] powerpc: Add ZERO_GPRS macros for register clears
Christophe Leroy
christophe.leroy at csgroup.eu
Sat Jun 11 18:42:27 AEST 2022
Le 10/06/2022 à 05:32, Rohan McLure a écrit :
>> On 2 Jun 2022, at 2:00 am, Segher Boessenkool <segher at kernel.crashing.org> wrote:
>>
>> Hi!
>>
>> On Wed, Jun 01, 2022 at 03:48:45PM +1000, Rohan McLure wrote:
>>> +.macro BINOP_REGS op, rhs, start, end
>>> + .Lreg=\start
>>> + .rept (\end - \start + 1)
>>> + \op .Lreg, \rhs
>>> + .Lreg=.Lreg+1
>>> + .endr
>>> +.endm
>>
>> 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 :-)
>>
>>
>> Segher
>
> Thanks Segher, Christophe for reviewing this.
>
> 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. As I resubmit this patch series I
> will rename it to ZERO_REGS or similar to be more explicitly coupled to ZERO_GPRS.
>
> Something like this I was thinking:
>
> .macro ZERO_REGS start, end
> .Lreg=\start
> .rept (\end - \start + 1)
> li .Lreg, 0
> .Lreg=.Lreg+1
> .endr
> .endm
>
I'd have a preference for using a verb, for instance ZEROISE_REGS or
CLEAR_REGS
Christophe
More information about the Linuxppc-dev
mailing list