Mesa (master): zink: add missing 64-bit integer ops

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 11 10:52:38 UTC 2021


Module: Mesa
Branch: master
Commit: 5a11b374c516d800539cd7e12f01892c926afce0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5a11b374c516d800539cd7e12f01892c926afce0

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Sun Jan 10 13:58:26 2021 +0100

zink: add missing 64-bit integer ops

This seems to be all that's missing to support hardware int64 instead of
lowering it.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8403>

---

 src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
index 8789a5db20c..148acc388d3 100644
--- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
+++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
@@ -1273,12 +1273,14 @@ 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_i2i32, SpvOpSConvert)
    UNOP(nir_op_u2u32, SpvOpUConvert)
    UNOP(nir_op_f2f32, SpvOpFConvert)
    UNOP(nir_op_f2i64, SpvOpConvertFToS)
    UNOP(nir_op_f2u64, SpvOpConvertFToU)
    UNOP(nir_op_u2f64, SpvOpConvertUToF)
    UNOP(nir_op_i2f64, SpvOpConvertSToF)
+   UNOP(nir_op_i2i64, SpvOpSConvert)
    UNOP(nir_op_u2u64, SpvOpUConvert)
    UNOP(nir_op_f2f64, SpvOpFConvert)
    UNOP(nir_op_bitfield_reverse, SpvOpBitReverse)
@@ -1293,10 +1295,11 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
       break;
 
    case nir_op_b2i32:
+   case nir_op_b2i64:
       assert(nir_op_infos[alu->op].num_inputs == 1);
       result = emit_select(ctx, dest_type, src[0],
-                           get_ivec_constant(ctx, 32, num_components, 1),
-                           get_ivec_constant(ctx, 32, num_components, 0));
+                           get_ivec_constant(ctx, bit_size, num_components, 1),
+                           get_ivec_constant(ctx, bit_size, num_components, 0));
       break;
 
    case nir_op_b2f32:



More information about the mesa-commit mailing list