ac/llvm: convert to integer after reductions

These return floating point types for floating point ops.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Backport-to: 25.1
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35489>
(cherry picked from commit 2ff53fd97c)
This commit is contained in:
Rhys Perry 2025-06-12 10:06:45 +01:00 committed by Eric Engestrom
parent df1cf8119b
commit 7d9487439d
2 changed files with 4 additions and 1 deletions

View file

@ -1544,7 +1544,7 @@
"description": "ac/llvm: convert to integer after reductions",
"nominated": true,
"nomination_type": 4,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -2932,14 +2932,17 @@ static bool visit_intrinsic(struct ac_nir_context *ctx, nir_intrinsic_instr *ins
case nir_intrinsic_reduce:
result = ac_build_reduce(&ctx->ac, get_src(ctx, instr->src[0]), instr->const_index[0],
instr->const_index[1]);
result = ac_to_integer(&ctx->ac, result);
break;
case nir_intrinsic_inclusive_scan:
result =
ac_build_inclusive_scan(&ctx->ac, get_src(ctx, instr->src[0]), instr->const_index[0]);
result = ac_to_integer(&ctx->ac, result);
break;
case nir_intrinsic_exclusive_scan:
result =
ac_build_exclusive_scan(&ctx->ac, get_src(ctx, instr->src[0]), instr->const_index[0]);
result = ac_to_integer(&ctx->ac, result);
break;
case nir_intrinsic_quad_broadcast: {
unsigned lane = nir_src_as_uint(instr->src[1]);