nir: Add an imad opcode

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27159>
This commit is contained in:
Faith Ekstrand 2024-01-18 16:48:41 -06:00
parent 1881d97c27
commit f4fb5277c3
2 changed files with 6 additions and 0 deletions

View file

@ -3875,6 +3875,9 @@ typedef struct nir_shader_compiler_options {
* to imul with masked inputs */
bool has_umul24;
/** Backend supports 32-bit imad */
bool has_imad32;
/** Backend supports umad24, if not set umad24 will automatically be lowered
* to imul with masked inputs and iadd */
bool has_umad24;

View file

@ -1029,6 +1029,9 @@ triop("flrp", tfloat, "", "src0 * (1 - src2) + src1 * src2")
triop("iadd3", tint, _2src_commutative + associative, "src0 + src1 + src2",
description = "Ternary addition")
triop("imad", tint, _2src_commutative + associative, "src0 * src1 + src2",
description = "Integer multiply-add")
csel_description = """
A vector conditional select instruction (like ?:, but operating per-
component on vectors). The condition is {} bool ({}).