Mesa (main): freedreno/ir3: Fix 16-bit bit_count.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 19 20:15:08 UTC 2022


Module: Mesa
Branch: main
Commit: 633cf4eca1dec92605bfcf045c37ffc797132fa3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=633cf4eca1dec92605bfcf045c37ffc797132fa3

Author: Emma Anholt <emma at anholt.net>
Date:   Wed May 11 16:31:33 2022 -0700

freedreno/ir3: Fix 16-bit bit_count.

No need to do the 16-bit lowering if it already is.

Reviewed-by: Matt Turner <mattst88 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16465>

---

 src/freedreno/ir3/ir3_compiler_nir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c
index 980c83b48ba..5a02af2e253 100644
--- a/src/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/freedreno/ir3/ir3_compiler_nir.c
@@ -769,7 +769,7 @@ emit_alu(struct ir3_context *ctx, nir_alu_instr *alu)
       break;
    }
    case nir_op_bit_count: {
-      if (ctx->compiler->gen < 5) {
+      if (ctx->compiler->gen < 5 || (src[0]->dsts[0]->flags & IR3_REG_HALF)) {
          dst[0] = ir3_CBITS_B(b, src[0], 0);
          break;
       }



More information about the mesa-commit mailing list