bifrost: Simplify derivatives a bit
authorJason Ekstrand <jason.ekstrand@collabora.com>
Fri, 11 Mar 2022 22:09:28 +0000 (16:09 -0600)
committerMarge Bot <emma+marge@anholt.net>
Sat, 12 Mar 2022 02:27:02 +0000 (02:27 +0000)
commit83010c57a62ce83521da8ebd2f1f716dd86243ce
treec165bc18ff9862e8de703315c4df27d76750950a
parentc043e93ca5349251d9dc6bb066a01be2e225dce8
bifrost: Simplify derivatives a bit

Instead of two magic ternary operations, define a new `axis` temporary
which is 1 for X and 2 for Y.  Then define everything else in terms of
this variable.  In particular, the mask operation we do on LANE_ID is a
mask so it makes more sense to use ~axis than 1/2 but in the other
order.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15352>
src/panfrost/bifrost/bifrost_compile.c