Bit-twiddling hack where we don't have intrinsics.