Le 10/06/2022 à 05:32, Rohan McLure a écrit :
>> On 2 Jun 2022, at 2:00 am, Segher Boessenkool <seg...@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

Reply via email to