zink/spirv: implement ball_fequal[2-4]
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 31 Oct 2019 12:21:53 +0000 (13:21 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 6 Nov 2019 12:43:14 +0000 (13:43 +0100)
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c

index 2e430c63a3ff2b44ba1edb28320886d6e20d1ba6..ccbf49efb27df20b348c1500fa677a13d876e62f 100644 (file)
@@ -1040,6 +1040,18 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
       result = emit_unop(ctx, SpvOpAny, dest_type, result);
       break;
 
+   case nir_op_ball_fequal2:
+   case nir_op_ball_fequal3:
+   case nir_op_ball_fequal4:
+      assert(nir_op_infos[alu->op].num_inputs == 2);
+      assert(alu_instr_src_components(alu, 0) ==
+             alu_instr_src_components(alu, 1));
+      result = emit_binop(ctx, SpvOpFOrdEqual,
+                          get_bvec_type(ctx, alu_instr_src_components(alu, 0)),
+                          src[0], src[1]);
+      result = emit_unop(ctx, SpvOpAll, dest_type, result);
+      break;
+
    case nir_op_bany_inequal2:
    case nir_op_bany_inequal3:
    case nir_op_bany_inequal4: