Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vectorize IPv6 deserialization #24

Open
k0ekk0ek opened this issue Feb 20, 2023 · 0 comments
Open

Vectorize IPv6 deserialization #24

k0ekk0ek opened this issue Feb 20, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@k0ekk0ek
Copy link
Contributor

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 two epi32 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.

@k0ekk0ek k0ekk0ek added enhancement New feature or request good first issue Good for newcomers labels Feb 20, 2023
@k0ekk0ek k0ekk0ek added this to the Release 0.2.0 milestone Feb 20, 2023
@k0ekk0ek k0ekk0ek added the help wanted Extra attention is needed label Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant