agx: use util_is_probably_float
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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 <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40021>
This commit is contained in:
Alyssa Rosenzweig 2026-02-20 21:24:24 -05:00 committed by Marge Bot
parent da4296c27c
commit bac43d28a9

View file

@ -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) {