nir: handle fmul_rtz in a couple of places

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41179>
This commit is contained in:
Karol Herbst 2026-04-25 16:02:01 +02:00 committed by Marge Bot
parent 4e520f671c
commit 2e09b4ac68
2 changed files with 6 additions and 2 deletions

View file

@ -829,6 +829,7 @@ process_fp_query(struct analysis_state *state, struct analysis_query *aq, uint32
case nir_op_fmax:
case nir_op_fmin:
case nir_op_fmul:
case nir_op_fmul_rtz:
case nir_op_fmulz:
case nir_op_fpow:
case nir_op_vec2:
@ -1030,6 +1031,7 @@ process_fp_query(struct analysis_state *state, struct analysis_query *aq, uint32
break;
case nir_op_fmul:
case nir_op_fmul_rtz:
case nir_op_fmulz: {
bool mulz = alu->op == nir_op_fmulz;
bool src_eq = nir_alu_srcs_equal(alu, alu, 0, 1);
@ -1815,6 +1817,7 @@ get_alu_uub(struct analysis_state *state, struct scalar_query q, uint32_t *resul
break;
case nir_op_fsat:
case nir_op_fmul:
case nir_op_fmul_rtz:
case nir_op_fmulz:
case nir_op_f2u32:
case nir_op_f2i32:
@ -2019,6 +2022,7 @@ get_alu_uub(struct analysis_state *state, struct scalar_query q, uint32_t *resul
}
break;
case nir_op_fmul:
case nir_op_fmul_rtz:
case nir_op_fmulz:
/* infinity/NaN starts at 0x7f800000u, negative numbers at 0x80000000 */
if (src[0] < 0x7f800000u && src[1] < 0x7f800000u) {

View file

@ -376,7 +376,7 @@ is_not_fmul(const nir_search_state *state, const nir_alu_instr *instr, unsigned
if (src_alu->op == nir_op_fneg)
return is_not_fmul(state, src_alu, 0, 0, NULL);
return src_alu->op != nir_op_fmul && src_alu->op != nir_op_fmulz;
return src_alu->op != nir_op_fmul && src_alu->op != nir_op_fmulz && src_alu->op != nir_op_fmul_rtz;
}
static inline bool
@ -392,7 +392,7 @@ is_fmul(const nir_search_state *state, const nir_alu_instr *instr, unsigned src,
if (src_alu->op == nir_op_fneg)
return is_fmul(state, src_alu, 0, 0, NULL);
return src_alu->op == nir_op_fmul || src_alu->op == nir_op_fmulz;
return src_alu->op == nir_op_fmul || src_alu->op == nir_op_fmulz || src_alu->op == nir_op_fmul_rtz;
}
static inline bool