by plastic_teeth · 6y ago · 0 comments
initial: 0 0 0 0 3 4 1 2 (characters)
pext: 0 3 0 4 0 1 0 2 (characters)
sub: 0 3 0 4 0 1 0 2
multiply: 3412 412 12 2
Values below '0' will set high bits in the "sub" phase. Do another "sub" to check for values above '9', and branch.
Use of PEXT means potentially very fast handling of separators. Everything can be branchless.
Might not be as fast as SIMD but it should be better than a typical scalar approach.
No comments yet.