diff options
author | Dylan Baker <[email protected]> | 2018-09-06 11:36:19 -0700 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2020-04-21 11:09:03 -0700 |
commit | e533fad182e7069ee0850154f51316dd779501c3 (patch) | |
tree | aa38ebcd833ad137faf53889fea2202bac7e9eab /src/util | |
parent | c1e7c1f4224789f0bc4cc847cecde350e2c6d2f2 (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/util')
-rw-r--r-- | src/util/imports.h | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/util/imports.h b/src/util/imports.h index 4ebae04ffc7..03a6c0ef358 100644 --- a/src/util/imports.h +++ b/src/util/imports.h @@ -190,16 +190,6 @@ static inline int IFLOOR(float f) #endif } - -/** - * Is x a power of two? - */ -static inline int -_mesa_is_pow_two(int x) -{ - return !(x & (x - 1)); -} - /** * Round given integer to next higer power of two * If X is zero result is undefined. |