Re:Base64 encoding and decoding at almost the speed of a mem...
by londons_explore on Wednesday November 06, 2019 @05:03AM
(#21461125)
Why can't you use lookup tables?
[ Parent
| on HN ]
Re:Base64 encoding and decoding at almost the speed of a mem...
by fanf2 on Wednesday November 06, 2019 @06:00AM
(#21461381)
Part of the point of this paper is that the lookup tables for base64 fit into a 512 bit vector register.
Re:Base64 encoding and decoding at almost the speed of a mem...
by vardump on Wednesday November 06, 2019 @12:50PM
(#21464969)
Notably this technique only works in this special case (or other small LUTs). Generic (larger) lookup tables can't be vectorized yet.
Re:Base64 encoding and decoding at almost the speed of a mem...
by vardump on Wednesday November 06, 2019 @05:26AM
(#21461223)
Because table lookups don't vectorize. You could try to use vectorized gather (VPGATHERDD [0]), but so far in my experience it's been just as slow as using scalar code. (Then again, even gather instructions operate just on 32-bit data, so it wouldn't help anyways.)
So to perform multiple operations in parallel per core (SIMD), you'll have to write some code to perform the "lookup" transformation instead.
[0]: https://www.felixcloutier.com/x86/vpgatherdd:vpgatherqd