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/intel/compiler/brw_nir.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/intel/compiler/brw_nir.c')
-rw-r--r-- | src/intel/compiler/brw_nir.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index ce865e2ce71..b38c3ba383d 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -26,6 +26,7 @@ #include "common/gen_debug.h" #include "compiler/glsl_types.h" #include "compiler/nir/nir_builder.h" +#include "util/u_math.h" static bool is_input(nir_intrinsic_instr *intrin) @@ -243,7 +244,7 @@ brw_nir_lower_vs_inputs(nir_shader *nir, BITFIELD64_BIT(SYSTEM_VALUE_VERTEX_ID_ZERO_BASE) | BITFIELD64_BIT(SYSTEM_VALUE_INSTANCE_ID)); - const unsigned num_inputs = _mesa_bitcount_64(nir->info.inputs_read); + const unsigned num_inputs = util_bitcount64(nir->info.inputs_read); nir_foreach_function(function, nir) { if (!function->impl) @@ -322,7 +323,7 @@ brw_nir_lower_vs_inputs(nir_shader *nir, * before it and counting the bits. */ int attr = nir_intrinsic_base(intrin); - int slot = _mesa_bitcount_64(nir->info.inputs_read & + int slot = util_bitcount64(nir->info.inputs_read & BITFIELD64_MASK(attr)); nir_intrinsic_set_base(intrin, slot); break; |