nir/vtn: Support OpOrdered and OpUnordered opcodes
authorJesse Natalie <jenatali@microsoft.com>
Wed, 24 Jun 2020 17:58:36 +0000 (10:58 -0700)
committerJesse Natalie <jenatali@microsoft.com>
Mon, 17 Aug 2020 22:34:16 +0000 (15:34 -0700)
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6355>

src/compiler/spirv/vtn_alu.c

index 41be1a18dc86567c919518caa6598e21b11f170d..e92a48f24a63962b5cc86e828f483ffe7ec9ad37 100644 (file)
@@ -516,6 +516,16 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
       dest->def = nir_fne(&b->nb, src[0], src[0]);
       break;
 
+   case SpvOpOrdered:
+      dest->def = nir_iand(&b->nb, nir_feq(&b->nb, src[0], src[0]),
+                                   nir_feq(&b->nb, src[1], src[1]));
+      break;
+
+   case SpvOpUnordered:
+      dest->def = nir_ior(&b->nb, nir_fne(&b->nb, src[0], src[0]),
+                                  nir_fne(&b->nb, src[1], src[1]));
+      break;
+
    case SpvOpIsInf: {
       nir_ssa_def *inf = nir_imm_floatN_t(&b->nb, INFINITY, src[0]->bit_size);
       dest->def = nir_ieq(&b->nb, nir_fabs(&b->nb, src[0]), inf);