nir/format_convert: nir_shift -> nir_shift_imm
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 4 May 2021 18:08:09 +0000 (14:08 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 7 Jul 2021 13:41:37 +0000 (13:41 +0000)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10619>

src/compiler/nir/nir_format_convert.h
src/intel/blorp/blorp_blit.c

index 1a86fea..265a86d 100644 (file)
@@ -26,7 +26,7 @@
 #include "util/format_rgb9e5.h"
 
 static inline nir_ssa_def *
-nir_shift(nir_builder *b, nir_ssa_def *value, int left_shift)
+nir_shift_imm(nir_builder *b, nir_ssa_def *value, int left_shift)
 {
    if (left_shift > 0)
       return nir_ishl(b, value, nir_imm_int(b, left_shift));
@@ -40,7 +40,7 @@ static inline nir_ssa_def *
 nir_mask_shift(struct nir_builder *b, nir_ssa_def *src,
                uint32_t mask, int left_shift)
 {
-   return nir_shift(b, nir_iand(b, src, nir_imm_int(b, mask)), left_shift);
+   return nir_shift_imm(b, nir_iand(b, src, nir_imm_int(b, mask)), left_shift);
 }
 
 static inline nir_ssa_def *
@@ -135,7 +135,7 @@ nir_format_pack_uint_unmasked(nir_builder *b, nir_ssa_def *color,
    nir_ssa_def *packed = nir_imm_int(b, 0);
    unsigned offset = 0;
    for (unsigned i = 0; i < num_components; i++) {
-      packed = nir_ior(b, packed, nir_shift(b, nir_channel(b, color, i),
+      packed = nir_ior(b, packed, nir_shift_imm(b, nir_channel(b, color, i),
                                                offset));
       offset += bits[i];
    }
index c664bdc..17538e4 100644 (file)
@@ -894,7 +894,7 @@ bit_cast_color(struct nir_builder *b, nir_ssa_def *color,
          if (src_fmtl->channels_array[c].type == ISL_UNORM)
             chan = nir_format_float_to_unorm(b, chan, &chan_bits);
 
-         packed = nir_ior(b, packed, nir_shift(b, chan, chan_start_bit));
+         packed = nir_ior(b, packed, nir_shift_imm(b, chan, chan_start_bit));
       }
 
       nir_ssa_def *chans[4] = { };
@@ -906,7 +906,7 @@ bit_cast_color(struct nir_builder *b, nir_ssa_def *color,
 
          const unsigned chan_start_bit = dst_fmtl->channels_array[c].start_bit;
          const unsigned chan_bits = dst_fmtl->channels_array[c].bits;
-         chans[c] = nir_iand(b, nir_shift(b, packed, -(int)chan_start_bit),
+         chans[c] = nir_iand(b, nir_shift_imm(b, packed, -(int)chan_start_bit),
                                 nir_imm_int(b, BITFIELD_MASK(chan_bits)));
 
          if (dst_fmtl->channels_array[c].type == ISL_UNORM)