mesa/src/compiler
Faith Ekstrand 9c2b19219a nir/lower_bool_to_bitsize: Make all bN_csel sources match
Previously, we assumed that the selector for bcsel could be whatever,
regardless of the bit sizes of the data and we'd just fix it in the
back-end.  This works okay for scalars but falls over the moment we
vectorize because all our vector handling assumes bit sizes match.
Since matching bit sizes is what the hardware wants anyway, it's better
to do the right thing in NIR and hope copy-propagation can fold in
conversions if needed.

Unfortunately, copy prop isn't that smart yet so this does hurt a bit:

    Instrs: 1193679 -> 1198086 (+0.37%); split: -0.06%, +0.43%
    CodeSize: 11915136 -> 11950592 (+0.30%); split: -0.05%, +0.34%
    Full: 160985 -> 160941 (-0.03%); split: -0.04%, +0.01%
    Estimated normalized CVT cycles: 4456.938557000181 -> 4480.876069000186 (+0.54%); split: -0.13%, +0.67%
    Estimated normalized SFU cycles: 6350.9375 -> 6392.21875 (+0.65%)
    Estimated normalized Load/Store cycles: 205773.0 -> 205795.0 (+0.01%)
    Maximum number of threads: 12864 -> 12863 (-0.01%)
    Number of spill instructions: 22487 -> 22489 (+0.01%)
    Number of fill instructions: 52179 -> 52219 (+0.08%)

Hurt shaders:

    google-meet-clvk/BgBlur
    google-meet-clvk/Relight
    parallel-rdp/small_subgroup
    parallel-rdp/small_uber_subgroup

The proper solution here is to teach copy-prop about this stuff so that
it can propagate swizzles into ALU ops when they're supported:
https://gitlab.freedesktop.org/panfrost/mesa/-/issues/265

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14945
Cc: mesa-stable
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
(cherry picked from commit 3fd471dca5)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40359>
2026-03-11 23:21:12 +01:00
..
clc compiler/clc: Fix const correctness in libclc_add_generic_variants 2026-02-11 14:54:47 +00:00
glsl glsl: add workaround for MDK2 HD 2026-03-11 23:21:10 +01: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/lower_bool_to_bitsize: Make all bN_csel sources match 2026-03-11 23:21:12 +01:00
rust compiler/rust: drop "borrow of a value the compiler would automatically borrow" 2025-12-20 00:13:19 +01:00
spirv spirv: Fix spec constant to handle Select for non-native floats 2026-03-11 23:21:10 +01: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-11 23:21:10 +01: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: document that both input and output denorms have to be flushed 2026-01-19 16:11:28 +00:00
shader_info.h glsl/nir: Add texture_buffers to shader info 2026-01-13 10:00:58 +01:00