mesa/src/compiler
Christian Gmeiner 651cf906e2 isaspec: Use %g format for float display to ensure round-trip fidelity
Change the TYPE_FLOAT display format from %f to %g with sufficient
significant digits (%.5g for f16, %.9g for f32), so that float
immediates round-trip correctly through disassembly and assembly.

The %f format loses precision for small values: f16 0x0001 (denormal
~5.96e-8) displays as 0.000000, which parses back as 0x0000. The %g
format uses the minimum significant digits per IEEE 754 and strips
trailing zeros, using scientific notation when needed. Whole-number
values use %.1f to keep them unambiguously float (e.g. "1.0").

Update the etnaviv PEST grammar and the freedreno ir3 lexer/parser to
accept the new output formats (scientific notation, stripped zeros).

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40207>
2026-03-04 22:42:27 +00:00
..
clc nir: only set fp_math_ctrl if meaningful 2026-02-18 14:04:22 +00:00
glsl glsl: relax precision matching on unused uniforms ES 2026-03-03 22:03:18 +00:00
isaspec isaspec: Use %g format for float display to ensure round-trip fidelity 2026-03-04 22:42:27 +00:00
libcl libcl_vk: Add VkCopyMemoryIndirectCommandKHR 2026-02-13 20:53:47 +00:00
nir nir: remove lower_vector_cmp 2026-03-04 19:50:28 +00:00
rust nir: add nvidias shared memory non unform address shift 2026-02-11 03:41:23 +01:00
spirv spirv: Remove conversions from vtn_nir_alu_op_for_spirv_opcode() 2026-03-04 22:04:45 +00:00
builtin_types.py compiler: add float8 glsl types 2025-06-23 07:59:24 +00:00
builtin_types_c.py util,vulkan,mesa,compiler: Generate source files with utf8 encoding from mako template 2023-12-07 12:41:07 +00:00
builtin_types_h.py compiler: Generate files with newline at end 2025-06-24 14:01:04 +00:00
glsl_types.c compiler: Add FP8 types to GLSL type decoder 2025-12-19 00:09:53 +00:00
glsl_types.h spirv: Fix spec constant to handle Select for non-native floats 2026-03-04 22:04:45 +00:00
list.h nir: remove unused stuff from list.h 2025-07-31 20:23:04 +00:00
meson.build nir, glsl: Add support for softfloat32 2025-11-14 19:31:17 +00:00
shader_enums.c nir, ir3: Make ir3 GS varyings use a proper index 2026-01-21 20:54:15 +00:00
shader_enums.h nir: add ACCESS_SPARSE 2026-02-02 17:56:52 +00:00
shader_info.h glsl/nir: Add texture_buffers to shader info 2026-01-13 10:00:58 +01:00