Date: Wed, 5 Nov 2003 17:42:46 -0800 (PST) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 41515 for review Message-ID: <200311060142.hA61gkLY072540@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=41515 Change 41515 by peter@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)help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311060142.hA61gkLY072540>
