nir: add fp_math_ctrl to convert_alu_types
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40630>
This commit is contained in:
Georg Lehmann 2026-03-25 16:52:44 +01:00 committed by Marge Bot
parent 8470bb59f6
commit 0d8e2354ed
2 changed files with 3 additions and 1 deletions

View file

@ -399,7 +399,7 @@ intrinsic("nop", flags=[CAN_ELIMINATE])
intrinsic("use", src_comp=[0], flags=[])
intrinsic("convert_alu_types", dest_comp=0, src_comp=[0],
indices=[SRC_TYPE, DEST_TYPE, ROUNDING_MODE, SATURATE],
indices=[SRC_TYPE, DEST_TYPE, ROUNDING_MODE, SATURATE, FP_MATH_CTRL],
flags=[CAN_ELIMINATE, CAN_REORDER])
intrinsic("load_param", dest_comp=0, indices=[PARAM_IDX], flags=[CAN_ELIMINATE])

View file

@ -58,6 +58,7 @@ lower_convert_alu_types_instr(nir_builder *b, nir_intrinsic_instr *conv, void *d
return false;
b->cursor = nir_instr_remove(&conv->instr);
b->fp_math_ctrl = nir_intrinsic_fp_math_ctrl(conv);
nir_def *val =
nir_convert_with_rounding(b, conv->src[0].ssa,
nir_intrinsic_src_type(conv),
@ -124,6 +125,7 @@ static nir_def *
lower_alu_conversion(nir_builder *b, nir_instr *instr, UNUSED void *_data)
{
nir_alu_instr *alu = nir_instr_as_alu(instr);
b->fp_math_ctrl = alu->fp_math_ctrl;
nir_def *src = nir_ssa_for_alu_src(b, alu, 0);
nir_alu_type src_type = nir_op_infos[alu->op].input_types[0] | src->bit_size;
nir_alu_type dst_type = nir_op_infos[alu->op].output_type;