Use bitwise test instead of popcount to check if one bit is set
authorMichael Forney <mforney@mforney.org>
Tue, 4 Jun 2019 21:01:02 +0000 (14:01 -0700)
committerMichael Forney <mforney@mforney.org>
Mon, 10 Jun 2019 18:15:55 +0000 (11:15 -0700)
commit9d58bbd4ffdce319128215443f7b8859f35da6b7
treea7dd731e5d826786e12f2051fb669cd02cc96a94
parentdb7e79e78df07723dd07c8d00283244092dd8816
Use bitwise test instead of popcount to check if one bit is set

We don't need to determine the total number of bits set to determine if
exactly one is set.

Additionally, on x86_64 without any -march=* flag, __builtin_popcount
will get compiled to a function call to the compiler runtime (on gcc),
or a long sequence of bit operations (on clang).

Signed-off-by: Michael Forney <mforney@mforney.org>
configure.ac
meson.build
src/state.c
src/utils.h