nir: Add opcodes for fused comp + csel and optimizations
authorGert Wollny <gert.wollny@collabora.com>
Wed, 10 Mar 2021 08:42:22 +0000 (09:42 +0100)
committerGert Wollny <gert.wollny@collabora.com>
Mon, 22 Mar 2021 14:19:46 +0000 (15:19 +0100)
commit0f5b3c37c5d757f6ffe994bae24071c0462bb13f
treeab29c346dc1b2a585c761c5075bf8d2a20dd5701
parenta5747f8ab357ff00c630b937b221e5fb59d90289
nir: Add opcodes for fused comp + csel and optimizations

Some backends, like r600 support a fused version of int and float compare
against zero and and csel. Adding these opcodes here makes it possible to
optimize this in nir.

v2: Add rules for float compare + csel

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9452>
src/compiler/nir/nir.h
src/compiler/nir/nir_opcodes.py
src/compiler/nir/nir_opt_algebraic.py