nir: add iabs-lowering code
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 10 Jan 2020 21:59:54 +0000 (22:59 +0100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 24 Aug 2020 10:02:47 +0000 (10:02 +0000)
commit5e841e8b4fd689c50e5ff870ccd64788c6181c9e
treee32c46047f5a88f467e6e083070d7c26e969cd19
parent9e5e3be412271ff700c9ad7c0c51453ea1e95007
nir: add iabs-lowering code

Microsoft's DXIL is based on LLVM, which doesn't have an integer ABS
opcode, but instead needs it lowered to NEG + MAX. We need to do this
with an option, to prevent an already existing optimization rule from
undoing this.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5211>
src/compiler/nir/nir.h
src/compiler/nir/nir_opt_algebraic.py