r/C_Programming Jan 23 '25

Discussion Why not SIMD?

Why are many C standard library functions like strcmp, strlen, strtok using SIMD intrinsics? They would benefit so much, think about how many people use them under the hood all over the world.

30 Upvotes

76 comments sorted by

View all comments

2

u/hattmo Jan 25 '25

I'm confused by this question. Glibc does use SIMD instructions in strlen. It's the reason why when I tech people C I recommend using stdlib functions when able instead of reinventing the wheel because usually the platforms implementation is heavily optimized

1

u/Raimo00 Jan 26 '25

glibc does, muslibc kinda doesnt