Tag Archives: trick

SSE2 bit trick: ffs/fls for XMM registers

For the full “C” code that uses this idea for an arbitrary-length byte vector, see this later blog post In a discussion about all the wonderful uses of the combination movemask(pcmpxx(a,b)), it occurred to me that this gives you a … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Stupid gcc trick #3: list all built-in gcc #define symbols

Ever wonder whether you should use #ifdef linux … or #ifdef __linux? Ever search /usr/include for the header file that defines __INT_MAX__ … and not find it? These are the little mysteries of gcc’s built-in #defines. However, there’s really no … Continue reading

Posted in Uncategorized | Tagged , , , , | 1 Comment