Low-level integer routines with gcc

Gcc supports low-level integer routines similar to the FORTRAN routines POPCOUNT, ISHIFT...

The examples below are given for long long, the routines name changes for long and int

Ref : From Gnu Compiler Collection Internals

An alternative is to dig directly into the /include/ directory of gcc and find some useful routines: for example in smmintrin.h, one finds a popcount for longs: