pan/bi: Use FCLAMP pseudo op for clamp prop
authorAlyssa Rosenzweig <alyssa@collabora.com>
Wed, 4 Aug 2021 18:49:30 +0000 (14:49 -0400)
committerAlyssa Rosenzweig <alyssa@collabora.com>
Wed, 11 Aug 2021 18:59:26 +0000 (14:59 -0400)
commitac636f5adb57704696c781a17f11609fad9035ec
treea2910b035d0f4e582e424ab782631e3518c3df04
parenta98790fa963919514398f76a912ed9c228b25ae3
pan/bi: Use FCLAMP pseudo op for clamp prop

Map nir_op_fsat/etc to FCLAMP pseudo ops, instead of FADD. There are
significantly fewer knobs on FCLAMP, meaning significantly fewer things
to get wrong.

This fixes two(!) classes of bugs:

* Swizzles (failing to lower/compose swizzles on clamps)
* Numerical bugs (incorrectly treating +0.0 as an additive identity)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12205>
src/panfrost/bifrost/ISA.xml
src/panfrost/bifrost/bi_lower_swizzle.c
src/panfrost/bifrost/bi_opt_mod_props.c
src/panfrost/bifrost/bifrost_compile.c