diff --git a/.pick_status.json b/.pick_status.json index 704e989705c..967c7fe62bb 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 diff --git a/src/compiler/nir/nir_range_analysis.c b/src/compiler/nir/nir_range_analysis.c index ecfdcbc1ca6..5e4702861ca 100644 --- a/src/compiler/nir/nir_range_analysis.c +++ b/src/compiler/nir/nir_range_analysis.c @@ -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: {