mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 15:58:05 +02:00
intel/nir_opt_peephole_ffma: fix fp_math_ctlr for modifiers
If abs/neg don't preserve nan/inf/sz, the whole expressions won't.
Fixes: 1b0808adf3 ("intel/nir: Make ffma peephole optimization preserve fp_fast_math flags")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41101>
This commit is contained in:
parent
bdaf8b6b39
commit
26ec32dada
1 changed files with 2 additions and 1 deletions
|
|
@ -191,6 +191,7 @@ intel_nir_opt_peephole_ffma_instr(nir_builder *b,
|
|||
}
|
||||
|
||||
b->cursor = nir_before_instr(&add->instr);
|
||||
b->fp_math_ctrl = mul->fp_math_ctrl | add->fp_math_ctrl;
|
||||
|
||||
if (abs) {
|
||||
for (unsigned i = 0; i < 2; i++)
|
||||
|
|
@ -201,7 +202,7 @@ intel_nir_opt_peephole_ffma_instr(nir_builder *b,
|
|||
mul_src[0] = nir_fneg(b, mul_src[0]);
|
||||
|
||||
nir_alu_instr *ffma = nir_alu_instr_create(b->shader, nir_op_ffma);
|
||||
ffma->fp_math_ctrl = mul->fp_math_ctrl | add->fp_math_ctrl;
|
||||
ffma->fp_math_ctrl = b->fp_math_ctrl;
|
||||
|
||||
for (unsigned i = 0; i < 2; i++) {
|
||||
ffma->src[i].src = nir_src_for_ssa(mul_src[i]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue