On Fri, Nov 20, 2020 at 11:08:41AM +0100, Stefan Kanthak wrote: > The construction of the "magic" constants 0x55...55, 0x33...33, 0x0f...0f > and 0x01...01 in __popcountSI2 and __popcountDI2 with macros is awkward; > these constants can simply be written as ((UWtype) ~0 / 3), > ((UWtype) ~0 / 5), ((UWtype) ~0 / 17) and ((UWtype) ~0 / 255)
(UWtype) ~0 will only work if UWtype is unsigned int, don't you really mean ~(UWtype) 0 instead? Jakub