[sgen] Use gcc bitcount intrinsics where appropriate.