mesa/src/compiler
Georg Lehmann 93d05cdfd8 nir/opt_algebraic: move fsat last for fsqrt(fsat(a))
This should be exact, even for all special values:

fsqrt(NaN) -> NaN
fsqrt(-0.0) -> 0.0
fsqrt(-Inf) -> NaN
fsqrt(negative finite) -> NaN

So all of these get saturated to +0.0

All numbers >= 1.0 will have a square root >= 1.0,
which will be saturate to 1.0

Moving the fsat guarantees that it can use an output modifier
for hardware that has those, and shouldn't harm other hardware either.

Foz-DB Navi21:
Totals from 255 (0.31% of 82151) affected shaders:
Instrs: 664906 -> 664194 (-0.11%)
CodeSize: 3623500 -> 3619188 (-0.12%)
Latency: 11336397 -> 11335688 (-0.01%); split: -0.01%, +0.00%
InvThroughput: 2716430 -> 2715726 (-0.03%); split: -0.03%, +0.00%
VALU: 442603 -> 441891 (-0.16%)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39202>
2026-01-09 07:34:46 +00:00
..
clc nir: move exact bit to nir_fp_math_control 2026-01-07 09:40:57 +00:00
glsl nir: move exact bit to nir_fp_math_control 2026-01-07 09:40:57 +00:00
isaspec treewide: use BITSET_BYTES, BITSET_RZALLOC 2025-11-05 18:44:23 +00:00
libcl libcl: avoid calling UNREACHABLE(str) macro without arguments 2025-08-04 23:15:18 +02:00
nir nir/opt_algebraic: move fsat last for fsqrt(fsat(a)) 2026-01-09 07:34:46 +00:00
rust compiler/rust: drop "borrow of a value the compiler would automatically borrow" 2025-12-20 00:13:19 +01:00
spirv nir: move exact bit to nir_fp_math_control 2026-01-07 09:40:57 +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 glsl, mesa: add EXT_shader_pixel_local_storage extension 2025-11-18 20:25:43 +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,radeonsi: simplify load_color0 & load_color1 intrinsics and shader_info 2026-01-01 18:30:28 +00:00
shader_enums.h nir,radeonsi: simplify load_color0 & load_color1 intrinsics and shader_info 2026-01-01 18:30:28 +00:00
shader_info.h nir,radeonsi: simplify load_color0 & load_color1 intrinsics and shader_info 2026-01-01 18:30:28 +00:00