Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
ape4
· 1y ago · 0 comments
Yeah look at even strlen()
https://github.com/lattera/glibc/blob/master/string/strlen.c
Comments
[–]
GabrielTFS
1y ago
That's the generic implementation - it's not used on most popular architectures (I think the most popular architecture it's used on would be RISC-V or MIPS) because they all have architecture-specific implementations. The implementation running on the average (x86) computer is likely to be
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86...
(if you have AVX512),
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86...
(if you have AVX2 and not AVX512) or
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86...
(if you have neither AVX2 nor AVX512 - rather rare these days)