[EXT] Re: [PATCH 1/1] riscv: Add Zbkb optimized repeat_bytes helper

Peter Bergner bergner@tenstorrent.com
Fri Sep 12 18:07:39 GMT 2025


On 9/12/25 5:53 AM, Pincheng Wang wrote:
> 在 2025/9/12 03:45, Adhemerval Zanella Netto 写道:
>> This is already within 'defined __riscv_zbkb', so there is no need for the
>> fallback nor check if __riscv_zbkb is defined. Just add a variant for
>> __riscv_xlen == 64 and another for 32.
>>
> 
> Thank you for your feedback. You're right, and I'll fix this in the next 
> version. However, would it be appropriate to add an `#error` in the 
> fallback branch, similar to how it's done in sysdeps/riscv/sys/asm.h?

_If_ there is a chance that __riscv_xlen could be something other than
32 or 64, then we would _need_ the #error.  Is that the case though?

That said, even if 32 and 64 are the only (current) valid values, I don't
see that it hurts anything, especially since we have precedent to check that.

Peter




More information about the Libc-alpha mailing list