diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 99b2526b618..96ac8fa9a3a 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -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; diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py index 0770351c988..ef8c8fe28fe 100644 --- a/src/compiler/nir/nir_opcodes.py +++ b/src/compiler/nir/nir_opcodes.py @@ -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 ({}).