pan: use imm-helpers
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 15 Jun 2023 18:20:41 +0000 (20:20 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 29 Jun 2023 07:08:18 +0000 (07:08 +0000)
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23855>

src/panfrost/midgard/midgard_compile.c
src/panfrost/util/pan_lower_framebuffer.c

index d4136de..50448b7 100644 (file)
@@ -262,7 +262,7 @@ midgard_nir_lower_global_load_instr(nir_builder *b, nir_instr *instr,
          comps[ncomps++] = nir_channel(b, load, i);
 
       totalsz -= loadsz;
-      addr = nir_iadd(b, addr, nir_imm_intN_t(b, loadsz / 8, addr->bit_size));
+      addr = nir_iadd_imm(b, addr, loadsz / 8);
    }
 
    assert(ncomps == nir_dest_num_components(intr->dest));
index 9317613..f2154cd 100644 (file)
@@ -266,14 +266,12 @@ pan_pack_unorm_1010102(nir_builder *b, nir_ssa_def *v)
 
    nir_ssa_def *bottom2 = nir_iand(b, s, nir_imm_ivec4(b, 0x3, 0x3, 0x3, 0x3));
 
-   nir_ssa_def *top = nir_ior(
-      b,
+   nir_ssa_def *top =
       nir_ior(b,
-              nir_ishl(b, nir_channel(b, bottom2, 0), nir_imm_int(b, 24 + 0)),
-              nir_ishl(b, nir_channel(b, bottom2, 1), nir_imm_int(b, 24 + 2))),
-      nir_ior(b,
-              nir_ishl(b, nir_channel(b, bottom2, 2), nir_imm_int(b, 24 + 4)),
-              nir_ishl(b, nir_channel(b, bottom2, 3), nir_imm_int(b, 24 + 6))));
+              nir_ior(b, nir_ishl_imm(b, nir_channel(b, bottom2, 0), 24 + 0),
+                      nir_ishl_imm(b, nir_channel(b, bottom2, 1), 24 + 2)),
+              nir_ior(b, nir_ishl_imm(b, nir_channel(b, bottom2, 2), 24 + 4),
+                      nir_ishl_imm(b, nir_channel(b, bottom2, 3), 24 + 6)));
 
    nir_ssa_def *p = nir_ior(b, top, top8_rgb);
    return nir_replicate(b, p, 4);