diff options
Diffstat (limited to 'disas/libvixl/utils.cc')
-rw-r--r-- | disas/libvixl/utils.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/disas/libvixl/utils.cc b/disas/libvixl/utils.cc index c9c05d1e18..4d4fcbdad4 100644 --- a/disas/libvixl/utils.cc +++ b/disas/libvixl/utils.cc @@ -124,4 +124,14 @@ int CountSetBits(uint64_t value, int width) { return value; } + + +uint64_t LowestSetBit(uint64_t value) { + return value & -value; +} + + +bool IsPowerOf2(int64_t value) { + return (value != 0) && ((value & (value - 1)) == 0); +} } // namespace vixl |