nir/opcodes: Add nir_op_f2fmp
authorNeil Roberts <nroberts@igalia.com>
Wed, 9 Oct 2019 10:36:22 +0000 (12:36 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 24 Feb 2020 17:24:13 +0000 (17:24 +0000)
commit125f867d3dc32c7269c17d3426e35a0dcd5aadc4
tree46e7893c4b8d7b1eb7a3cd61407971f39daf667a
parent18124d727865f1c53b0dac644560bce177b7d233
nir/opcodes: Add nir_op_f2fmp

This opcode is the same as the f2f16 opcode except that it comes with
a promise that it is safe to optimise it out if the result is
immediately converted back to a 32-bit float again. Normally this
would be a lossy conversion and so it would be visible to the
application, but if the conversion is generated as part of the mediump
lowering process then this removal doesn’t matter. The opcode is
eventually replaced with a regular f2f16 in the late optimisations so
the backends don’t need to handle it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3822>
src/compiler/nir/nir_opcodes.py
src/compiler/nir/nir_opt_algebraic.py