freedreno/ir3: Use imul24 in offset calculations
authorKristian H. Kristensen <hoegsberg@google.com>
Tue, 22 Oct 2019 23:37:35 +0000 (16:37 -0700)
committerKristian H. Kristensen <hoegsberg@google.com>
Fri, 8 Nov 2019 00:36:53 +0000 (16:36 -0800)
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 <hoegsberg@google.com>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/freedreno/ir3/ir3_nir_lower_tess.c

index b4982503f0d568e1f3de2b86955fe861939762dc..acbb02d4108c84aeb508634d069f130f08f1ae36 100644 (file)
@@ -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));