Chris Wellons personal blog

A Branchless UTF-8 Decoder

This week I took a crack at writing a branchless UTF-8 decoder: a function that decodes a single UTF-8 code point from a byte stream without any if statements, loops, short-circuit operators, or other sorts of conditional jumps. You can find the source code here along with a test suite and benchmark:
Points
303
HN comments
107
Submissions
1
Cited by
0 commenters

Software EngineeringMath & Algorithms2017

On Hacker News

SubmittedTitle on HNPointsComments
Oct 7, 2017A Branchless UTF-8 Decoder by zdw303107

More from Chris Wellons

All 75 posts →

Related posts from the same era