SWAR algorithm to count characters in a UTF-8 string
I’m enjoying this world of SIMD hyperoptimization — “SWAR” in this case refers to “SIMD within a register” — performing SIMD parallel operations on data contained in a single processor register.
(tags: simd swar hacks performance optimization coding utf-8)