[PATCH v2 2/6] Benchtests: Add benchtests for __memcmpeq
Noah Goldstein
goldstein.w.n@gmail.com
Wed Nov 3 17:17:45 GMT 2021
On Wed, Nov 3, 2021 at 8:39 AM Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote:
>
> Hi Noah,
>
> > > As committed, it's literally the same benchmark as memcmp, however I
> > > expected it to call __memcmpeq... You'll need to change the definition of
> > > MEMCMP as well.
>
> > Not certain why, but it does seem to be getting the right ifuncs. Can update it
> > if desirable.
>
> > Is this also true for 'wmemcmp'? I don't see it defining MEMCMP either.
>
> Ifuncs use TEST_NAME (which is right) while there is also IMPL (MEMCMP, 1)
> which is not correct. It is defined in bench-string - it does support wmemcmp,
> but it is missing support for __memcmpeq.
That all makes sense. What's confusing is that despite not setting MEMCMP
for __memcmpeq, the benchmarks still test the correct implementations.
It appears that in FOR_EACH_IMPL:
https://sourceware.org/git/?p=glibc.git;a=blob;f=benchtests/bench-string.h;h=12f27473ff5714e50a94f3f1c5b06a56b99bc742;hb=HEAD#l200
The only check if selecting the function from the ifunc list is that
its name is not
an exact match of whatever MEMCMP is defined as.
Will post a patch to fix but is a bit odd.
>
> Cheers,
> Wilco
More information about the Libc-alpha
mailing list