mirror of
https://git.freebsd.org/src.git
synced 2026-01-16 23:02:24 +00:00
linuxkpi: Use __builtin_popcountg() instead of bitcount*()
The DRM drivers generic code started to use `HWEIGHT64()` in the definition of an array field in a structure. Therefore, the array size needs to be known at compile time. This was not the case with the `HWEIGHT*()` macros based on `bitcount*()`. The use of `__builtin_popcountg()` solves that problem. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50995
This commit is contained in:
parent
d17bfb2370
commit
7cbc4d8759
1 changed files with 4 additions and 4 deletions
|
|
@ -62,10 +62,10 @@
|
|||
#define hweight64(x) bitcount64(x)
|
||||
#define hweight_long(x) bitcountl(x)
|
||||
|
||||
#define HWEIGHT8(x) (bitcount8((uint8_t)(x)))
|
||||
#define HWEIGHT16(x) (bitcount16(x))
|
||||
#define HWEIGHT32(x) (bitcount32(x))
|
||||
#define HWEIGHT64(x) (bitcount64(x))
|
||||
#define HWEIGHT8(x) (__builtin_popcountg((uint8_t)(x)))
|
||||
#define HWEIGHT16(x) (__builtin_popcountg((uint16_t)(x)))
|
||||
#define HWEIGHT32(x) (__builtin_popcountg((uint32_t)(x)))
|
||||
#define HWEIGHT64(x) (__builtin_popcountg((uint64_t)(x)))
|
||||
|
||||
static inline int
|
||||
__ffs(int mask)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue