[PATCH v2] ppc64le: Add optimized __memcmpeq for POWER10
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Mon Jun 1 13:40:31 GMT 2026
Hi Sachin,
> I benchmarked 4 different variants of multiple power10 machines, taking the median across runs.
> Variant0: Initial Changes (in v1)
> VariantA: Comparing after 64 bytes
> VariantB: Comparing after 32 bytes
> VariantC: Independent accumulators per COMPARE_32 with a reduction tree at the end of each iteration.
>
> All of these variants cater to different size ranges with mild and inconsistent gains, and the gaps at large sizes fall within same-machine run-to-run noise.
> VariantC adds extra VORs without stable payoff.
I think it depends on how you do it - in principle you can reduce
the number of VORs. Basically when you have N inputs, you need
N-1 VOR instructions. Using an accumulator adds a XOR to initialize
it plus an extra VOR every iteration (or 2 for v2).
>So, I want to go with variantA because ( at times ) I can see a mild improvement (2-3%) over the initial patch above certain data size.
> Commit message stays as before. Follow-up for __memcmp_power10 should come separately.
Yes smaller blocks should be better as you do less extra work if a
mismatch happens at the start of a block.
LGTM.
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Cheers,
Wilco
More information about the Libc-alpha
mailing list