[Mesa-dev] [RFC 2/4] nir: Add a new ALU nir_op_imad
Eric Anholt
eric at anholt.net
Fri Jan 25 17:46:56 UTC 2019
Eduardo Lima Mitev <elima at igalia.com> writes:
> ir3 compiler has an integer multiply-add instruction (IMAD_S24)
> that is used for different offset calculations in the backend.
> Since we intend to move some of these calculations to NIR, we need
> a new ALU op that can represent it.
> ---
> src/compiler/nir/nir_opcodes.py | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py
> index d32005846a6..b61845fd514 100644
> --- a/src/compiler/nir/nir_opcodes.py
> +++ b/src/compiler/nir/nir_opcodes.py
> @@ -754,6 +754,7 @@ def triop_horiz(name, output_size, src1_size, src2_size, src3_size, const_expr):
> [tuint, tuint, tuint], "", const_expr)
>
> triop("ffma", tfloat, "src0 * src1 + src2")
> +triop("imad", tint, "src0 * src1 + src2")
The constant-folding expression should be corrected to what the backend
operation actually does, and you should probably call it imad24 or
something in that case.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190125/ddc9a4bd/attachment.sig>
More information about the mesa-dev
mailing list