You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately the instructions that would be perfect don't exist so I had to cobble some things together. No we can parse from 1 to 16 chars with SIMD, with input validation. The two "wishlist" instructions would be "count trailing zeros" for __m128i type, and a left shift with a non-immediate value. I had to emulate both, and unfortunately there is one branch now. The running time is ~2.5 ns for any number of digits up to 16, up from 0.75ns for exactly 16 digits.
I'll continue thinking about other ways to do the same thing, with some other SSE instructions - I'm sure there's a way to get that lower.
See "Faster Integer Parsing" and KholdStare/qnd-integer-parsing-experiments.
KholdStare has graciously licensed this code under the Boost Software License. 😸
The text was updated successfully, but these errors were encountered: