svn commit: r278474 - head/sys/sys
Jung-uk Kim
jkim at FreeBSD.org
Mon Feb 9 22:06:07 UTC 2015
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 02/09/2015 16:55, Jung-uk Kim wrote:
> On 02/09/2015 16:08, John Baldwin wrote:
>> On Monday, February 09, 2015 09:03:24 PM John Baldwin wrote:
>>> Author: jhb Date: Mon Feb 9 21:03:23 2015 New Revision:
>>> 278474 URL: https://svnweb.freebsd.org/changeset/base/278474
>>>
>>> Log: Use __builtin_popcnt() to implement a BIT_COUNT()
>>> operation for bitsets and use this to implement CPU_COUNT() to
>>> count the number of CPUs in a cpuset.
>>>
>>> MFC after: 2 weeks
>
>> Yes, __builtin_popcnt() works with GCC 4.2. It should also
>> allow the compiler to DTRT in userland uses of this if -msse4.2
>> is enabled.
>
> Back in 2012, when I submitted a similar patch, bde noted
> __builtin_popcount*() cannot be used with GCC 4.2 for *kernel*
> because it emits a library call.
>
> http://docs.freebsd.org/cgi/mid.cgi?20121116171923.L1135
BTW, __POPCNT__ macro may be used to detect availability of POPCNT
instruction when compiled with Clang.
Jung-uk Kim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJU2S9NAAoJEHyflib82/FGy+kH/20SFWEXK5lSfWxYMvxMp46W
ZjOFW46ZefkUHiDLgPcED4oZd4cmX/KNXns3YSO5lwL4JeFsO+mzTKpmV7llPV22
y1/xHChk3Z3BJwq3lzGZmVeT4Cw2T6Mf4f1PCqfMkijDDsVrkEYBeko+QW3gpGjZ
BrjH8EmFLDZ78rmPP/Nsbm8HZNEI89NOGBYEw615kA5ibuZZ0L2T6ybcipysDaxe
fYpBcIhm58erXIrlNtYeSX6YyZPHMPJBACjkyPEKk8L7eKYR27++VKZGas8flEze
5x/5n9TftKwei2rHXhuogNqClACsLIBkM6a/Y/PNBMDOQ+0OEu6uDr0a63log00=
=zY2U
-----END PGP SIGNATURE-----
More information about the svn-src-all
mailing list