[PATCH v1] ppc64le: Add optimized __memcmpeq for POWER10

Sachin Monga smonga@linux.ibm.com
Tue May 26 09:34:41 GMT 2026


Thanks for the review Adhemerval.

> Is it really worth to duplicate most of the memcmp implementation for this
> specific optimization? A simpler solution would add a ifunc variant that
> returns the already in place memcmp variants.
One clarification on scope: the IFUNC selector aliases to the existing 
|__memcmp_*| variants for everything except POWER10.

Power8, power7, power4, and ppc reuse the in-place memcmp 
implementations exactly as you're describing. The only dedicated file in 
the patch is |memcmpeq-power10.S|.

POWER10 has its own because of the numbers in section 2 of the commit 
message — Dedicated |__memcmpeq_power10| vs the same selector aliased to 
|__memcmp_power10|:

|≥ 512B : ~9% 16MB – 128MB : ~25% – 32% 256MB : ~3% 1GB : on par|

16MB–128MB is the customer workload range — that's the band that 
motivates the dedicated implementation.

Precedent: x86_64 takes the same approach — 
|sysdeps/x86_64/multiarch/memcmpeq-{sse2,avx2,evex}.S| are dedicated 
rather than aliased to |__memcmp_*|.

Regards:
Sachin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20260526/d8fec552/attachment-0001.htm>


More information about the Libc-alpha mailing list