misc: Add functions for doing popcount and power-of-two checking
authorStephan Diestelhorst <stephan.diestelhorst@arm.com>
Thu, 24 Apr 2014 16:41:26 +0000 (17:41 +0100)
committerStephan Diestelhorst <stephan.diestelhorst@arm.com>
Thu, 24 Apr 2014 16:41:26 +0000 (17:41 +0100)
commitfe98cb6be471e8187658fea950bee0ecd5bf959c
treecb9050f97b8961b796982afd5204fbdaed58a406
parentba98d598aef0e3823d2ded7084b1a2829ade5b73
misc: Add functions for doing popcount and power-of-two checking

Adds two public domain algorithms for determining number of set bits and also
whether a value is a power of two, uses the builtin that is available in GCC
and clang for popcount.
src/base/bitfield.hh