diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/igt_aux.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/igt_aux.h b/lib/igt_aux.h index 43dd15fe..faddd478 100644 --- a/lib/igt_aux.h +++ b/lib/igt_aux.h @@ -385,4 +385,9 @@ static inline bool igt_list_empty(const struct igt_list *list) &pos->member != (head); \ pos = tmp, tmp = igt_list_next_entry(pos, member)) +#define igt_hweight(x) \ + __builtin_choose_expr(sizeof(x) == 8, \ + __builtin_popcountll(x), \ + __builtin_popcount(x)) + #endif /* IGT_AUX_H */ |