From 77b96b843e4d58a1462976dacf6ae314de815881 Mon Sep 17 00:00:00 2001 From: "Kristian H. Kristensen" Date: Tue, 22 Oct 2019 16:37:35 -0700 Subject: [PATCH] freedreno/ir3: Use imul24 in offset calculations With the imul24 opcode in place, we can now use it for computing local offsets (ie for ldlw/stlw). Signed-off-by: Kristian H. Kristensen Acked-by: Eric Anholt Reviewed-by: Rob Clark --- src/freedreno/ir3/ir3_nir_lower_tess.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freedreno/ir3/ir3_nir_lower_tess.c b/src/freedreno/ir3/ir3_nir_lower_tess.c index b4982503f0d..acbb02d4108 100644 --- a/src/freedreno/ir3/ir3_nir_lower_tess.c +++ b/src/freedreno/ir3/ir3_nir_lower_tess.c @@ -85,7 +85,7 @@ build_local_offset(nir_builder *b, struct state *state, { nir_ssa_def *primitive_stride = nir_load_vs_primitive_stride_ir3(b); nir_ssa_def *primitive_offset = - nir_imul(b, build_local_primitive_id(b, state), primitive_stride); + nir_imul24(b, build_local_primitive_id(b, state), primitive_stride); nir_ssa_def *attr_offset; nir_ssa_def *vertex_stride; @@ -99,7 +99,7 @@ build_local_offset(nir_builder *b, struct state *state, unreachable("bad shader stage"); } - nir_ssa_def *vertex_offset = nir_imul(b, vertex, vertex_stride); + nir_ssa_def *vertex_offset = nir_imul24(b, vertex, vertex_stride); return nir_iadd(b, nir_iadd(b, primitive_offset, vertex_offset), nir_iadd(b, attr_offset, offset)); -- 2.30.2