[PATCH v1] ppc64le: Add optimized __memcmpeq for POWER10
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Tue May 26 12:33:27 GMT 2026
On 26/05/26 06:34, Sachin Monga wrote:
> 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_*|.
Right, I was not expecting that the COMPARE_32 change would yield that much
difference.
More information about the Libc-alpha
mailing list