i915g: Use the devmaster quadratic approximation for sin/cos.
authorEmma Anholt <emma@anholt.net>
Thu, 5 Aug 2021 22:41:04 +0000 (15:41 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 9 Aug 2021 04:40:21 +0000 (04:40 +0000)
commit01e9824997dcd6e361e5208826d8a997f41c8b7b
treee91edd85eb79958047b62f36d1884275fec58f55
parentf800b9182b9d82685c6a43471c681142ff5bba62
i915g: Use the devmaster quadratic approximation for sin/cos.

11 instructions, but now processes up to 4 channels at once (since TGSI
splits to scalar for these math ops) while being higher accuracy.
Previously we used 6 instructions per channel, but it didn't look like a
sine wave.  i915c managed it in 9 instructions per scalar channel, thanks
to avoiding an extra mov we do for the fabs (should be fixable), and
avoiding an extra MUL (maybe just needs reassociation of our immediates?).
But, the ALU count win from doing 4 channels at once will be way more
important for making sure that programs compile than those 2 ALU ops, plus
now we do it in NIR instead of assembly.

Closes: #4981
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12250>
src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt
src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt
src/gallium/drivers/i915/ci/traces-i915.yml
src/gallium/drivers/i915/i915_fpc.h
src/gallium/drivers/i915/i915_fpc_translate.c
src/gallium/drivers/i915/i915_nir.c [new file with mode: 0644]
src/gallium/drivers/i915/i915_state.c
src/gallium/drivers/i915/meson.build