zink: handle more opcodes for CL

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19212>
This commit is contained in:
Karol Herbst
2022-10-21 03:14:26 +02:00
committed by Marge Bot
parent 4629fe2aab
commit 813b76aeb6
2 changed files with 6 additions and 1 deletions
@@ -2028,6 +2028,8 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
UNOP(nir_op_fddy, SpvOpDPdy)
UNOP(nir_op_fddy_coarse, SpvOpDPdyCoarse)
UNOP(nir_op_fddy_fine, SpvOpDPdyFine)
UNOP(nir_op_f2i8, SpvOpConvertFToS)
UNOP(nir_op_f2u8, SpvOpConvertFToU)
UNOP(nir_op_f2i16, SpvOpConvertFToS)
UNOP(nir_op_f2u16, SpvOpConvertFToU)
UNOP(nir_op_f2i32, SpvOpConvertFToS)
@@ -2036,6 +2038,7 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
UNOP(nir_op_i2f32, SpvOpConvertSToF)
UNOP(nir_op_u2f16, SpvOpConvertUToF)
UNOP(nir_op_u2f32, SpvOpConvertUToF)
UNOP(nir_op_i2i8, SpvOpSConvert)
UNOP(nir_op_i2i16, SpvOpSConvert)
UNOP(nir_op_i2i32, SpvOpSConvert)
UNOP(nir_op_u2u8, SpvOpUConvert)
@@ -2061,6 +2064,7 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
result = emit_unop(ctx, SpvOpNot, dest_type, src[0]);
break;
case nir_op_b2i8:
case nir_op_b2i16:
case nir_op_b2i32:
case nir_op_b2i64:
@@ -2162,6 +2166,7 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
BINOP(nir_op_udiv, SpvOpUDiv)
BINOP(nir_op_umod, SpvOpUMod)
BINOP(nir_op_imod, SpvOpSMod)
BINOP(nir_op_irem, SpvOpSRem)
BINOP(nir_op_fadd, SpvOpFAdd)
BINOP(nir_op_fsub, SpvOpFSub)
BINOP(nir_op_fmul, SpvOpFMul)
@@ -1510,7 +1510,7 @@ spirv_builder_const_bool(struct spirv_builder *b, bool val)
SpvId
spirv_builder_const_int(struct spirv_builder *b, int width, int64_t val)
{
assert(width >= 16);
assert(width >= 8);
SpvId type = spirv_builder_type_int(b, width);
if (width <= 32)
return emit_constant_32(b, type, val);