mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-15 17:48:22 +02:00
nir: add fp_math_ctrl to convert_alu_types
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40630>
This commit is contained in:
parent
8470bb59f6
commit
0d8e2354ed
2 changed files with 3 additions and 1 deletions
|
|
@ -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])
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue