[PATCH v1 2/3] riscv: Add RVV implementation __strcpy_vector
Jeff Law
jlaw@ventanamicro.com
Fri Sep 19 16:46:17 GMT 2025
On 9/19/25 10:26, Sergei Lewis wrote:
> In previous measurements, reading the vl CSR appears to add noticeable
> latency
>
>
> Why do we ever need to read the vl CSR at all? Sure, vle8ff adjusts it
> if there is a fault. However, consider: strcpy() behaviour is undefined
> if the buffer is not null terminated, so no particular behaviour is
> required in that situation and we are free to choose whatever is
> cheapest; and if it /is/ null terminated, the null byte will be
> available to subsequent operations as normal regardless of what else
> vle8ff does or does not do, and the subsequent comparison and store
> operations will behave correctly without us needing to explicitly
> interact with VL.
My understanding is the VL can be adjusted even when there is _not_ a
fault. For example, to simplify the hardware design a page crossing but
not faulting FoF load can stop the load at the page boundary, updating
VL appropriately and the next load will start on the new page boundary.
We considered (in a different context) if we could just say those
scenarios should happen rarely and let subsequent iterations just use
the lower VL. I don't think we actually ever bothered to benchmark that
behavior.
Jeff
More information about the Libc-alpha
mailing list