aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/compiler
diff options
context:
space:
mode:
authorDylan Baker <[email protected]>2018-09-06 11:36:19 -0700
committerDylan Baker <[email protected]>2020-04-21 11:09:03 -0700
commite533fad182e7069ee0850154f51316dd779501c3 (patch)
treeaa38ebcd833ad137faf53889fea2202bac7e9eab /src/intel/compiler
parentc1e7c1f4224789f0bc4cc847cecde350e2c6d2f2 (diff)
replace _mesa_is_pow_two with util_is_power_of_two_*
Mostly this uses util_is_power_of_two_or_zero, which has the same behavior as _mesa_is_pow_two when the input is zero. In cases where the value is known to be != 0 ahead of time I used the _nonzero variant as it may be faster on some platforms. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
Diffstat (limited to 'src/intel/compiler')
-rw-r--r--src/intel/compiler/brw_reg.h2
-rw-r--r--src/intel/compiler/brw_vec4_generator.cpp3
2 files changed, 2 insertions, 3 deletions
diff --git a/src/intel/compiler/brw_reg.h b/src/intel/compiler/brw_reg.h
index 60dc2778edd..865cd9e0f36 100644
--- a/src/intel/compiler/brw_reg.h
+++ b/src/intel/compiler/brw_reg.h
@@ -986,7 +986,7 @@ static inline struct brw_reg
spread(struct brw_reg reg, unsigned s)
{
if (s) {
- assert(_mesa_is_pow_two(s));
+ assert(util_is_power_of_two_nonzero(s));
if (reg.hstride)
reg.hstride += cvt(s) - 1;
diff --git a/src/intel/compiler/brw_vec4_generator.cpp b/src/intel/compiler/brw_vec4_generator.cpp
index be5eaf43ca0..bdc45371c4e 100644
--- a/src/intel/compiler/brw_vec4_generator.cpp
+++ b/src/intel/compiler/brw_vec4_generator.cpp
@@ -2064,8 +2064,7 @@ generate_code(struct brw_codegen *p,
*
* where they pack the four bytes from the low and high four DW.
*/
- assert(_mesa_is_pow_two(dst.writemask) &&
- dst.writemask != 0);
+ assert(util_is_power_of_two_nonzero(dst.writemask));
unsigned offset = __builtin_ctz(dst.writemask);
dst.type = BRW_REGISTER_TYPE_UB;