PERFORCE change 41515 for review
Peter Wemm
peter at FreeBSD.org
Wed Nov 5 17:42:49 PST 2003
http://perforce.freebsd.org/chv.cgi?CH=41515
Change 41515 by peter at peter_daintree on 2003/11/05 17:42:24
sync with vendor branch (mismerge)
Affected files ...
.. //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#22 edit
Differences ...
==== //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#22 (text+ko) ====
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.220 2003/11/03 22:32:03 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.221 2003/11/06 01:24:25 peter Exp $");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
@@ -744,6 +744,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