Felix-Gong opened a new pull request, #3375:
URL: https://github.com/apache/brpc/pull/3375

   ## Description
   
   Add a RVV-accelerated `cp()` path for RISC-V 64-bit systems with the Vector 
(RVV) extension.
   
   The `cp()` function is the internal memcpy wrapper used throughout IOBuf for 
all buffer copy operations — optimizing it benefits append, cut, push_back, and 
all other IOBuf data movement.
   
   ## Implementation
   
   - Uses VL-agnostic RVV intrinsics with LMUL=8 (e8m8) for maximum vector width
   - Falls back to memcpy for < 64 bytes (RVV overhead threshold)
   - Uses `__has_include(<riscv_vector.h>)` for broad compiler compatibility
   - Guarded by `__riscv` and `__riscv_vector`
   
   ## Verification
   
   - Compiled on RISC-V 64-bit (SG2044, rv64gcv) with Clang 17
   - Verified RVV instructions generated: `vsetvli`, `vle8.v`, `vse8.v` in the 
object file
   - libbrpc.a built successfully
   - Non-RVV platforms and compilers without riscv_vector.h fall back to memcpy
   
   Signed-off-by: Felix-Gong <[email protected]>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to