[PATCH] strcasestr: check if ne[0] is in hs with strchr or strpbrk as does strstr

Wilco Dijkstra Wilco.Dijkstra@arm.com
Tue Oct 17 09:57:53 GMT 2023


Hi Noah,

>> I ran it on my x86 machine (with proper AVX-512), and the "optimized" strcspn is
>> slower than the simple byte loop on bench-strcasestr.
>
> "optimized" being the sse4 version?

No idea, I just ran the benchmark as a smoke test. However this code looks wrong:

+    s = (char *)strcspn(s, a);

Cheers,
Wilco


More information about the Libc-alpha mailing list