mirror of
https://github.com/apache/nuttx.git
synced 2026-10-21 21:59:47 +00:00
Reduce branch overhead in the memcmp main loop by comparing four words per iteration: XOR each pair, OR the four differences together, and branch once. On a mismatch the single-word loop locates the exact differing word within four words of the fault. Add a beqz guard at .Lbyte_cmp entry to handle the case where the 4-word loop consumes all remaining bytes exactly. Measured on QEMU RV32: memcmp(128) 313 -> 271 cycles (13% faster). Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: ganjing <ganjing@xiaomi.com> |
||
|---|---|---|
| .. | ||
| libbuiltin | ||
| libc | ||
| libdsp | ||
| libm | ||
| libnx | ||
| libxx | ||
| CMakeLists.txt | ||