nir: disable fp class analysis for 64bit transcendentals

Some backends have terrible precision for these fp64 opcodes, so don't try to
do anything clever.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15334
Fixes: 5a298f3560 ("nir: rewrite fp range analysis as a fp class analysis")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
(cherry picked from commit 599a52174b)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41268>
This commit is contained in:
Georg Lehmann 2026-04-27 09:18:05 +02:00 committed by Eric Engestrom
parent a3e7443e0c
commit 4799e79a5f
2 changed files with 10 additions and 4 deletions

View file

@ -774,7 +774,7 @@
"description": "nir: disable fp class analysis for 64bit transcendentals",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "5a298f3560629943e9140c74547183da1635352e",
"notes": null

View file

@ -1039,7 +1039,11 @@ process_fp_query(struct analysis_state *state, struct analysis_query *aq, uint32
}
case nir_op_frcp:
r = frcp_fp_class(handle_sz(alu, src_res[0]));
/* Some backends have terrible precision for fp64,
* so don't try to do anything clever.
*/
if (alu->def.bit_size < 64)
r = frcp_fp_class(handle_sz(alu, src_res[0]));
break;
case nir_op_mov:
@ -1085,11 +1089,13 @@ process_fp_query(struct analysis_state *state, struct analysis_query *aq, uint32
break;
case nir_op_fsqrt:
r = fsqrt_fp_class(src_res[0]);
if (alu->def.bit_size < 64)
r = fsqrt_fp_class(src_res[0]);
break;
case nir_op_frsq:
r = frcp_fp_class(fsqrt_fp_class(handle_sz(alu, src_res[0])));
if (alu->def.bit_size < 64)
r = frcp_fp_class(fsqrt_fp_class(handle_sz(alu, src_res[0])));
break;
case nir_op_ffloor: {