Re: patch parport/bitops

David S. Miller (
Fri, 24 Apr 1998 11:52:25 -0700

Date: Fri, 24 Apr 1998 19:27:20 +0200
From: Thomas Sailer <>

hweight32/hweight16/hweight8 these count the number
of bits set in an N-bit word. The reason why I believe this
should be in an arch specific directory is because
most archs (other than i386, sparc pre v9 popc enhanced)
have instructions to do this. The reason there are 3 funcs
to do this is because the generic implementation is slightly
costly and the cost is lower with less bits.

No actual Sparc-V9 implementations, even UltraSparc, implement the
popc instruction in hardware, it must be emulated via software trap on
the "unimp" exception on all chips. Yes, this ticked me off too
because you can do ffz in constant time with that toy ;-)

David S. Miller

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to