PERFORCE change 38065 for review

Peter Wemm peter at FreeBSD.org
Sun Sep 14 17:02:37 PDT 2003


http://perforce.freebsd.org/chv.cgi?CH=38065

Change 38065 by peter at peter_work on 2003/09/14 17:01:54

	Update the popcnt() stuff

Affected files ...

.. //depot/projects/hammer/sys/i386/i386/mp_machdep.c#13 edit

Differences ...

==== //depot/projects/hammer/sys/i386/i386/mp_machdep.c#13 (text+ko) ====

@@ -2437,6 +2437,12 @@
  * -mcpu=pentiumpro and -march=pentiumpro then gcc-3.1 will use
  * an imull, and in that case it is faster.  In most other cases
  * it appears slightly slower.
+ *
+ * Another variant (also from fortune):
+ * #define BITCOUNT(x)	(((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255)
+ * #define  BX_(x)	((x) - (((x)>>1)&0x77777777)		\
+ *			     - (((x)>>2)&0x33333333)		\
+ *			     - (((x)>>3)&0x11111111))
  */
 static __inline u_int32_t
 popcnt(u_int32_t m)


More information about the p4-projects mailing list