val->i32[swizzle[i]] is guaranteed to have non-positive value before the __is_power_of_two call, so unary minus is equivalent to abs in this case. --- src/compiler/nir/nir_search_helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/compiler/nir/nir_search_helpers.h b/src/compiler/nir/nir_search_helpers.h index 2e3bd137d6..66e1546ae6 100644 --- a/src/compiler/nir/nir_search_helpers.h +++ b/src/compiler/nir/nir_search_helpers.h @@ -80,7 +80,7 @@ is_neg_power_of_two(nir_alu_instr *instr, unsigned src, unsigned num_components, case nir_type_int: if (val->i32[swizzle[i]] > 0) return false; - if (!__is_power_of_two(abs(val->i32[swizzle[i]]))) + if (!__is_power_of_two(-val->i32[swizzle[i]])) return false; break; default: -- 2.14.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev