nir: add nir_[fui]gt_imm and nir_[fui]le_imm helpers
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 5 Jun 2023 08:19:58 +0000 (10:19 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 15 Jun 2023 11:33:58 +0000 (13:33 +0200)
commitf7bf0c774f3ec1e9522bcc99ecd65a2e4e0efdba
tree5cb0ac0c0fc51caedeb658908a48298fe566317a
parent4291cc5255741f02eddc2114b7170166658174ce
nir: add nir_[fui]gt_imm and nir_[fui]le_imm helpers

These are similar to the nir_{cmp}_imm variants we already have, except
they negate the condition (apart from equality) and flip the arguments.
The reason we need this, is that we don't have all comparison directions
that would be required to always pass the immediate in the second
argument.

This allows us to create any comparison with an immediate without
having to manually create the immediate value.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23460>
src/compiler/nir/nir_builder.h
src/compiler/nir/nir_builder_opcodes_h.py