mesa/src/compiler
Icenowy Zheng 2bffc653ec isaspec: decode: manually print the sign when printing NaN float values
The IEEE754-2019 standard declaring the preceding sign "optional" when
converting NaN values to strings because the standard tries to not
regulate how sign bits in NaNs are interpreted.

In the real world, when using printf-series function to print a number
with type `float` on RISC-V, the sign of NaNs is wiped during the
conversion from `float` to `double` (defined as part of the default
argument promotions rule for variable arguments in the C spec).

Change the code to stop relying on isa_print() to print the negative
sign, instead parse it from the highest bit of value and manually print
it before "nan" string.

This fixes the `etnaviv_isa_disasm` unit test on RISC-V.

Suggested-by: Christian Gmeiner <cgmeiner@igalia.com>
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-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/40887>
2026-04-29 11:39:12 +00:00
..
clc spirv,treewide: rework specialization constant 2026-04-22 06:57:55 +00:00
glsl nir: resolve functions: only resolve functions that are reachable from main 2026-04-28 23:35:17 +00:00
isaspec isaspec: decode: manually print the sign when printing NaN float values 2026-04-29 11:39:12 +00:00
libcl libcl_vk: Add VkCopyMemoryIndirectCommandKHR 2026-02-13 20:53:47 +00:00
nir nir/opt_reassociate: fix exactness bug 2026-04-28 21:14:56 +00:00
rust nir: add nvidias shared memory non unform address shift 2026-02-11 03:41:23 +01:00
spirv spirv: add support for SPV_KHR_constant_data 2026-04-23 11:12:06 +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 compiler: Add missing MESA_SHADER_KERNEL case for SPIR-V dump 2026-04-23 20:36:55 +00:00
shader_enums.h nir: add back color0/1 system values and VARYING_SLOT_PARAM_GEN_AMD 2026-04-15 18:12:07 +00:00
shader_info.h nir: Add tex sources for descriptor heaps 2026-03-30 06:51:22 +00:00