diff options
Diffstat (limited to 'gcc/double-int.h')
-rw-r--r-- | gcc/double-int.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/double-int.h b/gcc/double-int.h index 50a9bda5d6a..eab9c3c14a6 100644 --- a/gcc/double-int.h +++ b/gcc/double-int.h @@ -284,6 +284,14 @@ double_int_equal_p (double_int cst1, double_int cst2) return cst1.low == cst2.low && cst1.high == cst2.high; } +/* Return number of set bits of CST. */ + +static inline int +double_int_popcount (double_int cst) +{ + return popcount_hwi (cst.high) + popcount_hwi (cst.low); +} + /* Legacy interface with decomposed high/low parts. */ |