4 ms·
One can vectorize LUTs as well https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#avxnewtechs=AVX2&text=gather https://www.intel.com/conte
by petermcneeley 2y ago
One can vectorize LUTs as well
https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#avxnewtechs=AVX2&text=gather https://www.intel.com/content/www/us/en/docs/intrinsics-guid...
I wrote about the kinds of things that are possible with LUTs awhile back https://darkcephas.blogspot.com/2018/10/validating-utf8-strings-with-lookup.html https://darkcephas.blogspot.com/2018/10/validating-utf8-stri...
- boulos 2y agoYes, but a direct `exp` implementation is only like 10-20 FMAs depending on how much accuracy you want. No gathering or permuting will really compete with straight math.
- janwas 2y agoWith AVX-512 one can have a 128-byte table with one vector of lookups produced each cycle :)
- celrod 2y agoYes, I have an AVX512 double precision exp implementation that does this thanks to iperm2pd. This approach was also recommended by the Intel optimization manual -- a great resource. I just went with straight math for single-precision, though.