nir/lower_int64: Lower 8 and 16-bit downcasts with nir_lower_mov64
authorJason Ekstrand <jason@jlekstrand.net>
Sat, 28 Mar 2020 16:22:43 +0000 (11:22 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 31 Mar 2020 00:18:05 +0000 (00:18 +0000)
We have the code to do the lowering, we were just missing the
boilerplate bits to make should_lower_int64_alu_instr return true.

Fixes: 62d55f12818e "nir: Wire up int64 lowering functions"
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4365>

src/compiler/nir/nir_lower_int64.c

index 6e3f8526f7be52899f11befa62ae9dc8dedf26c1..e18a54812259f8d3ee4f5fdc6d1b382e8e18c1a9 100644 (file)
@@ -692,8 +692,12 @@ nir_lower_int64_op_to_options_mask(nir_op opcode)
       return nir_lower_divmod64;
    case nir_op_b2i64:
    case nir_op_i2b1:
+   case nir_op_i2i8:
+   case nir_op_i2i16:
    case nir_op_i2i32:
    case nir_op_i2i64:
+   case nir_op_u2u8:
+   case nir_op_u2u16:
    case nir_op_u2u32:
    case nir_op_u2u64:
    case nir_op_bcsel:
@@ -855,7 +859,11 @@ should_lower_int64_alu_instr(const nir_instr *instr, const void *_options)
 
    switch (alu->op) {
    case nir_op_i2b1:
+   case nir_op_i2i8:
+   case nir_op_i2i16:
    case nir_op_i2i32:
+   case nir_op_u2u8:
+   case nir_op_u2u16:
    case nir_op_u2u32:
       assert(alu->src[0].src.is_ssa);
       if (alu->src[0].src.ssa->bit_size != 64)