Commit graph

5 commits

Author SHA1 Message Date
Karol Herbst
5bb3c9f69c nir: rename fsin_amd and fcos_amd to a more generic name
Nvidia implements both the same way as AMD does, so it makes sense to
allow for code sharing here.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40541>
2026-03-31 01:47:29 +02:00
Georg Lehmann
9cba104e11 nir/opt_fp_math_ctrl: use ddx/ddy fp_math_ctrl
No Foz-DB changes.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40630>
2026-03-26 13:15:50 +00:00
Georg Lehmann
d2be2fd4c1 nir/opt_fp_math_ctrl: ignore ffract input sign of zero
ffract(-0.0) = fract(+0.0) = +0.0

Foz-DB Navi48:
Totals from 23 (0.01% of 205040) affected shaders:
Instrs: 12036 -> 11836 (-1.66%)
CodeSize: 58392 -> 57716 (-1.16%); split: -1.19%, +0.03%
Latency: 57532 -> 57204 (-0.57%); split: -0.61%, +0.04%
InvThroughput: 10399 -> 10217 (-1.75%)
VClause: 72 -> 70 (-2.78%)
Copies: 324 -> 335 (+3.40%)
PreVGPRs: 640 -> 646 (+0.94%)
VALU: 8561 -> 8364 (-2.30%)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40630>
2026-03-26 13:15:49 +00:00
Georg Lehmann
769606e2e6 nir/opt_fp_math_ctrl: handle input/output no_signed_zero flag
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40323>
2026-03-11 16:47:15 +00:00
Georg Lehmann
7c217e540c nir: add a pass to optimize fp_math_ctrl
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40098>
2026-03-07 08:16:27 +01:00