mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
nir: fix nir_alu_type_range_contains_type_range for fp16 to int
The special value "Inf" doesn't fit into an int and therefore we have to
clamp regardless of whether all the other values would fit. And because
f2u32 and f2u64 define out-of-range conversions as UB in nir, we need to
clamp.
This change should have no effect for non saturating conversions.
Fixes "conversions long_sat_*half" CL CTS tests
Cc: mesa-stable
Suggested-by: Rob Clark <rob.clark@oss.qualcomm.com>
Reviewed-by: Rob Clark <rob.clark@oss.qualcomm.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
(cherry picked from commit 8e8fb2ebaa)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40359>
This commit is contained in:
parent
7ee55d3a5f
commit
3d8ff40d58
2 changed files with 1 additions and 6 deletions
|
|
@ -3454,7 +3454,7 @@
|
|||
"description": "nir: fix nir_alu_type_range_contains_type_range for fp16 to int",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -207,11 +207,6 @@ nir_alu_type_range_contains_type_range(nir_alu_type a, nir_alu_type b)
|
|||
a_bit_size > b_bit_size)
|
||||
return true;
|
||||
|
||||
/* 16-bit floats fit in 32-bit integers */
|
||||
if (a_base_type == nir_type_int && a_bit_size >= 32 &&
|
||||
b == nir_type_float16)
|
||||
return true;
|
||||
|
||||
/* All signed or unsigned ints can fit in float or above. A uint8 can fit
|
||||
* in a float16.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue