zink/spirv: implement bitwise ops
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 19 Jul 2019 13:02:49 +0000 (15:02 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:47 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c

index a78a26b4bb327cd2f60194e7331a5896481c34af..0455beabfc690aff25d2033450d4610234a08668 100644 (file)
@@ -803,6 +803,7 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
    UNOP(nir_op_f2u32, SpvOpConvertFToU)
    UNOP(nir_op_i2f32, SpvOpConvertSToF)
    UNOP(nir_op_u2f32, SpvOpConvertUToF)
+   UNOP(nir_op_inot, SpvOpNot)
 #undef UNOP
 
 #define BUILTIN_UNOP(nir_op, spirv_op) \
@@ -871,6 +872,8 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
    BINOP(nir_op_ishl, SpvOpShiftLeftLogical)
    BINOP(nir_op_ishr, SpvOpShiftRightArithmetic)
    BINOP(nir_op_ushr, SpvOpShiftRightLogical)
+   BINOP(nir_op_iand, SpvOpBitwiseAnd)
+   BINOP(nir_op_ior, SpvOpBitwiseOr)
 #undef BINOP
 
 #define BUILTIN_BINOP(nir_op, spirv_op) \