Eigen pblend
Reference issue
What does this implement/fix?
While addressing some observations by @cantonios , I took this opportunity to apply some lessons learned to clean up the Intel pblend implementations.
- converting an array of
boolto a mask is efficiently accomplished by subtracting the bool (in integer form) from zero. - there is no reason to use floating point comparisons to create bit masks. integer math and comparisons are much faster
-
_mm_movemask_epi8efficiently converts a byte mask into a true bit mask. https://godbolt.org/z/eMsqrz4rM - defer to
pselectinstead of spamming macro guards
Additional information
Edited by Charles Schlosser