intel/nir: do not apply the fsin and fcos trig workarounds for consts
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 4 Dec 2018 15:41:36 +0000 (16:41 +0100)
committerAndres Gomez <agomez@igalia.com>
Tue, 17 Sep 2019 20:39:18 +0000 (23:39 +0300)
commit3c474f851313db5318d727d017b763ea2cb01e6d
tree932672cc1f67828cd2e5f16bb10cd5993c26ec5b
parentdba4d0a319f6938263e362a44201ed1099353cac
intel/nir: do not apply the fsin and fcos trig workarounds for consts

If we have fsin or fcos trigonometric operations with constant values
as inputs, we will multiply the result by 0.99997 in
brw_nir_apply_trig_workarounds, making the result wrong.

Adjusting the rules so they do not apply to const values we let a
later constant fold to deal with it.

v2:
- Do not early constant fold but only apply the trig workaround for
  non constants (Caio).
- Add fixes tag to commit log (Caio).

Fixes: bfd17c76c12 "i965: Port INTEL_PRECISE_TRIG=1 to NIR."
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/intel/compiler/brw_nir_trig_workarounds.py