nir/vtn: Support OpOrdered and OpUnordered opcodes
[mesa.git] / 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);