Re: [PATCH 00/17] Introduce and use generic parity32/64 helper
Jeremy Kerr <[email protected]>
| Newsgroups | dev.linux.lists.brcm80211,org.freedesktop.lists.dri-devel,org.infradead.lists.linux-mtd,org.kernel.vger.bpf,org.kernel.vger.linux-input,org.kernel.vger.linux-kernel,org.kernel.vger.linux-media,org.kernel.vger.linux-serial,org.kernel.vger.linux-wireless,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
Hi Kuan-Wei, > Several parts of the kernel contain redundant implementations of parity > calculations for 32-bit and 64-bit values. Introduces generic > parity32() and parity64() helpers in bitops.h, providing a standardized > and optimized implementation. More so than __builtin_parity() ? I'm all for reducing the duplication, but the compiler may well have a better parity approach than the xor-folding implementation here. Looks like we can get this to two instructions on powerpc64, for example. Cheers, Jeremy