lima: use imul for calculations with intrinsic src
authorVasily Khoruzhick <anarsoul@gmail.com>
Thu, 23 Jan 2020 04:30:31 +0000 (20:30 -0800)
committerMarge Bot <eric+marge@anholt.net>
Thu, 23 Jan 2020 21:16:22 +0000 (21:16 +0000)
It's source is supposed to be int, so we have to use integer
multiplication otherwise we'll get undefined result.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3529>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3529>

src/gallium/drivers/lima/ir/lima_nir_lower_uniform_to_scalar.c

index 3b1103702777755e66d934ca11eef3b403480fb8..d77386bf020bf8ec6e7709e1b07f5bf04948be7e 100644 (file)
@@ -44,7 +44,7 @@ lower_load_uniform_to_scalar(nir_builder *b, nir_intrinsic_instr *intr)
       nir_intrinsic_set_type(chan_intr, nir_intrinsic_type(intr));
 
       chan_intr->src[0] =
-         nir_src_for_ssa(nir_fmul_imm(b, intr->src[0].ssa, 4));
+         nir_src_for_ssa(nir_imul_imm(b, intr->src[0].ssa, 4));
 
       nir_builder_instr_insert(b, &chan_intr->instr);