Quoting Jani Nikula (2019-01-17 12:14:03)
>  #define _MASK(__high, __low)   ((u32)GENMASK(__high, __low))
>  
> +#define __POWER_OF_2(x)        ((x) && (((x) & ((x) - 1)) == 0))

Fwiw, I'd go with IS_POWER_OF_2(x) /* compile-time constant version of 
is_power_of_2() */

For constexpr!
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to