Re: cpu-2.5.64-1

Keith Owens
2003-03-16T11:01:51Z

On Sun, 16 Mar 2003 02:10:55 -0800,
William Lee Irwin III <wli@holomorphy.com> wrote:
>On Sun, Mar 16, 2003 at 08:19:31PM +1100, Keith Owens wrote:
>> Good, it lets us optimize for 1/32/64/lots of cpus. NR_CPUS > 8 *
>> sizeof(unsigned long) is the interesting case, it needs arrays.
>
>Hmm. It shouldn't make a difference with respect to optimizing them.
>My API passes transparently by reference:
>#define cpu_isset(cpu, map) test_bit(cpu, (map).mask)

Some of the 64 bit archs implement test_bit() as taking int * instead
of long *. That generates unoptimized code for the case of NR_CPUS <
64.

#if NR_CPUS < 64
#define cpu_isset(cpu, map) (map.mask & (1UL << (cpu)))
...

generates better code on those architectures. Yet another special case :(