Mesa (main): intel/compiler: use macro for power-of-two check

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 3 07:49:47 UTC 2022


Module: Mesa
Branch: main
Commit: 2a134347cbd22f8268f2c7e0c3541c83b7b608c8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2a134347cbd22f8268f2c7e0c3541c83b7b608c8

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Tue May 31 13:17:30 2022 +0200

intel/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: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16670>

---

 src/intel/compiler/brw_mesh.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_mesh.cpp b/src/intel/compiler/brw_mesh.cpp
index 342bf5032eb..2644536b04e 100644
--- a/src/intel/compiler/brw_mesh.cpp
+++ b/src/intel/compiler/brw_mesh.cpp
@@ -1064,7 +1064,7 @@ emit_urb_indirect_reads(const fs_builder &bld, nir_intrinsic_instr *instr,
          bld8.MOV(off, quarter(offset_src, q));
          bld8.ADD(off, off, brw_imm_ud(base_in_dwords + c));
 
-         STATIC_ASSERT(util_is_power_of_two_nonzero(REG_SIZE) && REG_SIZE > 1);
+         STATIC_ASSERT(IS_POT(REG_SIZE) && REG_SIZE > 1);
 
          fs_reg comp = bld8.vgrf(BRW_REGISTER_TYPE_UD, 1);
          bld8.AND(comp, off, brw_imm_ud(0x3));



More information about the mesa-commit mailing list