summaryrefslogtreecommitdiffstats
path: root/src/util/bitscan.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/bitscan.h')
-rw-r--r--src/util/bitscan.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util/bitscan.h b/src/util/bitscan.h
index a5dfa1f9e3b..32e027165cc 100644
--- a/src/util/bitscan.h
+++ b/src/util/bitscan.h
@@ -226,6 +226,15 @@ u_bit_consecutive(unsigned start, unsigned count)
return ((1u << count) - 1) << start;
}
+static inline uint64_t
+u_bit_consecutive64(unsigned start, unsigned count)
+{
+ assert(start + count <= 64);
+ if (count == 64)
+ return ~(uint64_t)0;
+ return (((uint64_t)1 << count) - 1) << start;
+}
+
#ifdef __cplusplus
}