4 ms·
Those constants are somewhat obfuscated. 3472328296227680304 == 0x3030303030303030 9241421688590303745 == 0x8040201008040201 72340172838076673 == 0x0101010
by vardump 4y ago
Those constants are somewhat obfuscated.
3472328296227680304 == 0x3030303030303030
9241421688590303745 == 0x8040201008040201
72340172838076673 == 0x0101010101010101
... and suddenly things are a lot less mysterious.
Similar tricks were used for poor man's SIMD in one 32-bit register before MMX, Altivec etc. You could for example do just one multiply RGB 5-5-5 bit alpha blending instead of 3! ("Cooked" / premultiplied alpha of course.)
- AdamH12113 4y agoThank you, that makes much more sense.
- glouwbug 4y agoIsn't that poor man SIMD an Abrash Black Book trick?
- vardump 4y agoPerhaps, although a lot of people invented these tricks independently. I think some of the first ones have been known since seventies.
- Twisol 4y agoHah. From the article: > Of course, the last thing I did was changing the constants to decimal - they look way more scary this way ;>