diff options
author | Dylan Baker <[email protected]> | 2018-08-21 09:46:46 -0700 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2018-09-07 10:21:26 -0700 |
commit | 8396043f304bb2a752130230055605c5c966e89f (patch) | |
tree | ee2e8a5494b88bff3b5e67ece8ffdba70d12c087 /src/mesa/main/imports.c | |
parent | 80825abb5d1a7491035880253ffd531c55acae6b (diff) |
Replace uses of _mesa_bitcount with util_bitcount
and _mesa_bitcount_64 with util_bitcount_64. This fixes a build problem
in nir for platforms that don't have popcount or popcountll, such as
32bit msvc.
v2: - Fix additional uses of _mesa_bitcount added after this was
originally written
Acked-by: Eric Engestrom <[email protected]> (v1)
Acked-by: Eric Anholt <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/imports.c')
-rw-r--r-- | src/mesa/main/imports.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index b4685b6dc35..566aac1d385 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -213,44 +213,6 @@ _mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, /*@}*/ -/**********************************************************************/ -/** \name Math */ -/*@{*/ - - -#ifndef HAVE___BUILTIN_POPCOUNT -/** - * Return number of bits set in given GLuint. - */ -unsigned int -_mesa_bitcount(unsigned int n) -{ - unsigned int bits; - for (bits = 0; n > 0; n = n >> 1) { - bits += (n & 1); - } - return bits; -} -#endif - -#ifndef HAVE___BUILTIN_POPCOUNTLL -/** - * Return number of bits set in given 64-bit uint. - */ -unsigned int -_mesa_bitcount_64(uint64_t n) -{ - unsigned int bits; - for (bits = 0; n > 0; n = n >> 1) { - bits += (n & 1); - } - return bits; -} -#endif - -/*@}*/ - - /** Needed due to #ifdef's, above. */ int _mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list args) |