From 16f3b9d984b30ad61a499df4892af4a0091eee2e Mon Sep 17 00:00:00 2001 From: Mohamed Ahmed Date: Mon, 30 Jun 2025 18:06:04 +0300 Subject: [PATCH] nak: Fix 64-bit bit_count, ufind_msb, ifind_msb, find_lsb Previously, these were going through nir_lower_bit_size, which handles upscaling from lower bit sizes to 32-bit only and is incorrect for higher sizes. This change uses nir_lower_int64 instead, which handles them properly and correctly. Reviewed-by: Faith Ekstrand Part-of: --- src/nouveau/compiler/nak_nir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nouveau/compiler/nak_nir.c b/src/nouveau/compiler/nak_nir.c index d4056dc3117..84a7bc1272e 100644 --- a/src/nouveau/compiler/nak_nir.c +++ b/src/nouveau/compiler/nak_nir.c @@ -247,7 +247,7 @@ lower_bit_size_cb(const nir_instr *instr, void *data) * 32-bit and so the bit size of the instruction is given by the * source. */ - return alu->src[0].src.ssa->bit_size == 32 ? 0 : 32; + return alu->src[0].src.ssa->bit_size >= 32 ? 0 : 32; case nir_op_fabs: case nir_op_fadd: