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

Author: Eric Anholt <[email protected]>
Date:   Wed Apr  1 15:19:38 2015 -0700

vc4: Add support for nir_iabs.

Tested using the GLSL 1.30 tests for integer abs().  Not currently used,
but it was one of the new opcodes used by robclark's idiv lowering.

---

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

diff --git a/src/gallium/drivers/vc4/vc4_program.c 
b/src/gallium/drivers/vc4/vc4_program.c
index 5ed2165..bcceb3c 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -1069,9 +1069,14 @@ ntq_emit_alu(struct vc4_compile *c, nir_alu_instr *instr)
         case nir_op_fsign:
                 *dest = ntq_fsign(c, src[0]);
                 break;
+
         case nir_op_fabs:
                 *dest = qir_FMAXABS(c, src[0], src[0]);
                 break;
+        case nir_op_iabs:
+                *dest = qir_MAX(c, src[0],
+                                qir_SUB(c, qir_uniform_ui(c, 0), src[0]));
+                break;
 
         default:
                 fprintf(stderr, "unknown NIR ALU inst: ");

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to