[PATCH v3] aarch64: Optimize memcmp for Kunpeng 950 with SVE

Wilco Dijkstra Wilco.Dijkstra@arm.com
Mon May 18 17:39:25 GMT 2026


Hi Weihong,

> Key optimizations:
> - Use SVE predication for branch-free handling of short inputs and tails
> - Use 4-way loop unrolling to maximize pipeline utilization
> - Optimize mismatch detection with early exit logic
>
> Benchmark (bench-memcmp, generic -> this patch):
> - Small (0-128B): 15% - 50% speedup
> - Medium (129-1024B): 21% - 50% speedup
> - Large (2048-4096B): 28% - 50% speedup
>
> Note: regressions may be observed in edge cases where offsets
> are near 4K boundaries. These instances are rare and the overall
> performance gain remains significantly positive.
>
> Also add IFUNC support for memcmp and correct the first-line
> comment in memcpy_kunpeng950.S.

V3 looks good, I've committed it.

Cheers,
Wilco


More information about the Libc-alpha mailing list