util: Move util_is_power_of_two to bitscan.h and rename to util_is_power_of_two_or_zero

The new name make the zero-input behavior more obvious.  The next
patch adds a new function with different zero-input behavior.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Suggested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
This commit is contained in:
Ian Romanick
2017-11-13 11:17:41 -08:00
parent a3a16d4aa7
commit d76c204d05
37 changed files with 79 additions and 73 deletions

View File

@@ -1976,7 +1976,7 @@ struct cplx_align {
static void
cplx_align_assert_sane(struct cplx_align a)
{
assert(a.mul > 0 && util_is_power_of_two(a.mul));
assert(a.mul > 0 && util_is_power_of_two_or_zero(a.mul));
assert(a.offset < a.mul);
}
@@ -2028,7 +2028,7 @@ static void
mark_uniform_slots_read(struct uniform_slot_info *slots,
unsigned num_slots, unsigned alignment)
{
assert(alignment > 0 && util_is_power_of_two(alignment));
assert(alignment > 0 && util_is_power_of_two_or_zero(alignment));
assert(alignment <= CPLX_ALIGN_MAX_MUL);
/* We can't align a slot to anything less than the slot size */