Vectorize IPv6 deserialization #24
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Milestone
IPv6 addresses in binary form require 128-bits, which fits
__m128i
nicely 🙂 Since text representation is in hexadecimal (or two__m128i
, or one__m256i
), therefore a vectorized algorithm in it's simplest form could be a shuffle on the high four bits to determine the ASCII code by which to lower the input byte followed by a right shift of all uneven input bytes, followed by a binary OR.The tricky part here, in my initial experiments, is the short-hand notation. e.g.
::1
. Once::
occurs, which is basically true for all IPv6 address, the numbers are relative to the lsb rather than the msb. First getting the location of all:
's and doing a shift to end up with the location of one of the:
's in::
allows one to quickly solve that problem. Initially, using scalar logic for coming up with twoepi32
load masks seems quickest, but more experimentation is required.Lastly, IPv6 supported a dotted notation to represent the lower 32-bits. I believe that notation is deprecated, and whether we want to support that can be debated. Should we choose to support dotted notation, a slow path may be required.
The text was updated successfully, but these errors were encountered: