vc4: Add support for TGSI_OPCODE_UCMP.
authorEric Anholt <eric@anholt.net>
Mon, 8 Dec 2014 19:57:15 +0000 (11:57 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 9 Dec 2014 00:08:13 +0000 (16:08 -0800)
This is being emitted now from st_glsl_to_tgsi.cpp.

src/gallium/drivers/vc4/vc4_program.c

index 5fab1deb6bf5281b1b601716eb268e87e8d03b2c..d21522fdcd6bb3780bc56ce141f64ff3947dd82a 100644 (file)
@@ -568,6 +568,17 @@ tgsi_to_qir_cmp(struct vc4_compile *c,
                               src[2 * 4 + i]);
 }
 
+static struct qreg
+tgsi_to_qir_ucmp(struct vc4_compile *c,
+                 struct tgsi_full_instruction *tgsi_inst,
+                 enum qop op, struct qreg *src, int i)
+{
+        qir_SF(c, src[0 * 4 + i]);
+        return qir_SEL_X_Y_ZC(c,
+                              src[1 * 4 + i],
+                              src[2 * 4 + i]);
+}
+
 static struct qreg
 tgsi_to_qir_mad(struct vc4_compile *c,
                 struct tgsi_full_instruction *tgsi_inst,
@@ -1292,6 +1303,7 @@ emit_tgsi_instruction(struct vc4_compile *c,
                 [TGSI_OPCODE_ISLT] = { 0, tgsi_to_qir_islt },
 
                 [TGSI_OPCODE_CMP] = { 0, tgsi_to_qir_cmp },
+                [TGSI_OPCODE_UCMP] = { 0, tgsi_to_qir_ucmp },
                 [TGSI_OPCODE_MAD] = { 0, tgsi_to_qir_mad },
                 [TGSI_OPCODE_RCP] = { QOP_RCP, tgsi_to_qir_rcp },
                 [TGSI_OPCODE_RSQ] = { QOP_RSQ, tgsi_to_qir_rsq },