lib/generic.h: Adding macros for common bitwise operations