Hi @ll,

the "magic" constants 0x55...55, 0x33...33, 0x0f...0f and 0x01...01 used
in the popcountsi2() and popcountdi2() functions defined in libgcc2.c are
currently generated iterative via the 4 macros POPCOUNTCST, POPCOUNTCST8,
POPCOUNTCST4 and POPCOUNTCST2 from 2 nibbles over 4 and 8 nibbles to
finally 16 nibbles.

The patch removes these macros and builds the constants from expressions
  ~(U*Wtype) 0 / 3u  = 0x55...55,    ~(U*Wtype) 0 / 5u   = 0x33...33,
  ~(U*Wtype) 0 / 17u = 0x0f...0f and ~(U*Wtype) 0 / 255u = 0x01...01
of the appropriate type (and size).

Additionally the patch lower-cases the single lonesome lingering ULL; all
other suffixes are already lower case.

regards
Stefan

Attachment: libgcc2.diff
Description: Binary data

Reply via email to