------- Comment #5 from burnus at gcc dot gnu dot org  2010-08-25 14:26 -------
(In reply to comment #3)
> About POPCNT and POPPAR, beware! Implementations are much harder than simply
> using the GCC __builtin_popcount{,l,ll}

Well, the difference is that one should be able to easily handle 128 bit values
at TREE level using
  __builtin_popcount ((unsigned long) X) + __builtin_popcount((unsigned long) X
<< 64)
and
  __builtin_parity ((unsigned long) X) != __builtin_parity ((unsigned long) X
<< 64)

The proper solution is too add them as new builtins to gcc/libgcc2.{c,h}; cf.
libgcc/Makefile.in - and update the docs.

At the same time, one could move CTZ/CLZ also to libgcc2.c, cf.

http://gcc.gnu.org/viewcvs/trunk/libgfortran/intrinsics/bit_intrinsics.c?view=markup


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38282

Reply via email to