This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use __builtin_popcount in __sched_cpucount [BZ #21696]
- From: Florian Weimer <fweimer at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Sat, 1 Jul 2017 16:26:35 +0200
- Subject: Re: [PATCH] Use __builtin_popcount in __sched_cpucount [BZ #21696]
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 39B723B702
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 39B723B702
- References: <20170701011435.GA24085@gmail.com> <bdfff56e-5487-f90f-5035-b6be87cf462d@redhat.com> <20170701141209.GA18342@gmail.com>
On 07/01/2017 04:12 PM, H.J. Lu wrote:
> posix/sched_cpucount.c assumes that size of __cpu_mask == size of long,
> which is incorrect for x32. This patch uses __builtin_popcount, which
> is availabe in GCC 4.9, in posix/sched_cpucount.c.
>
> Tested on i686, x86-64 and x32 with multi-arch disabled.
>
> 2017-07-01 Florian Weimer <fweimer@redhat.com>
> H.J. Lu <hongjiu.lu@intel.com>
>
> [BZ #21696]
> * posix/sched_cpucount.c: Don't include <limits.h>.
> (__sched_cpucount): Use __builtin_popcount.
Patch looks good to me. Thanks.
Florian