Mesa (master): vc4: Add support for UMAD.

Eric Anholt anholt at kemper.freedesktop.org
Mon Dec 15 22:33:32 UTC 2014


Module: Mesa
Branch: master
Commit: ade7704685df3054c04203232334e1475d87ac46
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ade7704685df3054c04203232334e1475d87ac46

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Dec 15 09:24:16 2014 -0800

vc4: Add support for UMAD.

---

 src/gallium/drivers/vc4/vc4_program.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index 781e7e2..1362170 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -432,6 +432,14 @@ tgsi_to_qir_umul(struct vc4_compile *c,
 }
 
 static struct qreg
+tgsi_to_qir_umad(struct vc4_compile *c,
+                 struct tgsi_full_instruction *tgsi_inst,
+                 enum qop op, struct qreg *src, int i)
+{
+        return qir_ADD(c, tgsi_to_qir_umul(c, NULL, 0, src, i), src[2 * 4 + i]);
+}
+
+static struct qreg
 tgsi_to_qir_idiv(struct vc4_compile *c,
                  struct tgsi_full_instruction *tgsi_inst,
                  enum qop op, struct qreg *src, int i)
@@ -1286,6 +1294,7 @@ emit_tgsi_instruction(struct vc4_compile *c,
                 [TGSI_OPCODE_NOT] = { QOP_NOT, tgsi_to_qir_alu },
 
                 [TGSI_OPCODE_UMUL] = { 0, tgsi_to_qir_umul },
+                [TGSI_OPCODE_UMAD] = { 0, tgsi_to_qir_umad },
                 [TGSI_OPCODE_IDIV] = { 0, tgsi_to_qir_idiv },
                 [TGSI_OPCODE_INEG] = { 0, tgsi_to_qir_ineg },
 




More information about the mesa-commit mailing list