From bac43d28a92130077bbbd46c81d7f0800f36626c Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 20 Feb 2026 21:24:24 -0500 Subject: [PATCH] agx: use util_is_probably_float To demonstrate that this helper is legitimately useful cross-tree and should be made common code :-) Sample AGX IR with this patch: 10 = mov_imm #0x3f5680f1 /* 0.837905 */ Signed-off-by: Alyssa Rosenzweig Reviewed-by: Mary Guillemard Part-of: --- src/asahi/compiler/agx_print.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/asahi/compiler/agx_print.c b/src/asahi/compiler/agx_print.c index de099dd005f..23e17e19fe8 100644 --- a/src/asahi/compiler/agx_print.c +++ b/src/asahi/compiler/agx_print.c @@ -5,6 +5,7 @@ */ #include "util/lut.h" +#include "util/u_math.h" #include "agx_builder.h" #include "agx_compiler.h" @@ -191,7 +192,10 @@ agx_print_instr(const agx_instr *I, FILE *fp) else print_comma = true; - fprintf(fp, "#%" PRIx64, I->imm); + fprintf(fp, "#0x%" PRIx64, I->imm); + if (I->imm && util_is_probably_float(I->imm)) { + fprintf(fp, " /* %f */", uif(I->imm)); + } } if (info.immediates & AGX_IMMEDIATE_DIM) {