From 45e7e162221b8e203f0e707658c509343b1b7116 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 15 Jun 2023 20:20:41 +0200 Subject: [PATCH] pan: use imm-helpers Reviewed-by: Alyssa Rosenzweig Reviewed-by: Kenneth Graunke Part-of: --- src/panfrost/midgard/midgard_compile.c | 2 +- src/panfrost/util/pan_lower_framebuffer.c | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index d4136de..50448b7 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -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)); diff --git a/src/panfrost/util/pan_lower_framebuffer.c b/src/panfrost/util/pan_lower_framebuffer.c index 9317613..f2154cd 100644 --- a/src/panfrost/util/pan_lower_framebuffer.c +++ b/src/panfrost/util/pan_lower_framebuffer.c @@ -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); -- 2.7.4