broadcom/compiler: use macro for power-of-two check

This will allow the use of static_assert here instead of our
compiler-specific implementation.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16670>
This commit is contained in:
Erik Faye-Lund 2022-05-31 13:20:00 +02:00 committed by Marge Bot
parent 2a134347cb
commit 873ec432b3

View file

@ -3572,7 +3572,7 @@ ntq_emit_intrinsic(struct v3d_compile *c, nir_intrinsic_instr *instr)
/* This is basically the batch index, which is the Local
* Invocation Index divided by the SIMD width).
*/
STATIC_ASSERT(util_is_power_of_two_nonzero(V3D_CHANNELS));
STATIC_ASSERT(IS_POT(V3D_CHANNELS) && V3D_CHANNELS > 0);
const uint32_t divide_shift = ffs(V3D_CHANNELS) - 1;
struct qreg lii = emit_load_local_invocation_index(c);
ntq_store_dest(c, &instr->dest, 0,