From 2cd9dd1fd77077ba8f85fc5c68e53af0c786521c Mon Sep 17 00:00:00 2001 From: squidbus Date: Sun, 26 Apr 2026 18:37:13 -0700 Subject: [PATCH] kk: Fix emitting negative infinity Fixes subgroup max tests, which use -INFINITY as a base when calculating the reference maximum value. Reviewed-by: Aitor Camacho Part-of: --- src/kosmickrisp/compiler/msl_type_inference.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kosmickrisp/compiler/msl_type_inference.c b/src/kosmickrisp/compiler/msl_type_inference.c index 30e3b472785..449ec61a62a 100644 --- a/src/kosmickrisp/compiler/msl_type_inference.c +++ b/src/kosmickrisp/compiler/msl_type_inference.c @@ -746,8 +746,10 @@ emit_src_component(struct nir_to_msl_ctx *ctx, nir_src *src, unsigned comp) switch (type) { case TYPE_FLOAT: { double v = nir_src_comp_as_float(*src, comp); - if (isinf(v)) { + if (v == INFINITY) { P(ctx, "(INFINITY"); + } else if (v == -INFINITY) { + P(ctx, "(-INFINITY"); } else if (isnan(v)) { P(ctx, "(NAN"); } else {