target/arm: Fix mtedesc for do_mem_zpz

Message ID 20200706202345.193676-1-richard.henderson@linaro.org
State Superseded
Headers show
Series
  • target/arm: Fix mtedesc for do_mem_zpz
Related show

Commit Message

Richard Henderson July 6, 2020, 8:23 p.m.
The mtedesc that was contructed was not actually passed in.
Found by Coverity (CID 1429996).

Fixes: d28d12f008e
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 target/arm/translate-sve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.25.1

Comments

Philippe Mathieu-Daudé July 7, 2020, 2:08 a.m. | #1
On 7/6/20 10:23 PM, Richard Henderson wrote:
> The mtedesc that was contructed was not actually passed in.


Typo "constructed".

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


> Found by Coverity (CID 1429996).

> 

> Fixes: d28d12f008e

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  target/arm/translate-sve.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c

> index 08f0fd15b2..88a2fb271d 100644

> --- a/target/arm/translate-sve.c

> +++ b/target/arm/translate-sve.c

> @@ -5275,7 +5275,7 @@ static void do_mem_zpz(DisasContext *s, int zt, int pg, int zm,

>          desc = FIELD_DP32(desc, MTEDESC, ESIZE, 1 << msz);

>          desc <<= SVE_MTEDESC_SHIFT;

>      }

> -    desc = simd_desc(vsz, vsz, scale);

> +    desc = simd_desc(vsz, vsz, desc | scale);

>      t_desc = tcg_const_i32(desc);

>  

>      tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg));

>
Peter Maydell July 7, 2020, 10:42 a.m. | #2
On Mon, 6 Jul 2020 at 21:23, Richard Henderson
<richard.henderson@linaro.org> wrote:
>

> The mtedesc that was contructed was not actually passed in.

> Found by Coverity (CID 1429996).

>

> Fixes: d28d12f008e

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  target/arm/translate-sve.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>



Applied to target-arm.next (with the commit message typo fixed), thanks.

-- PMM

Patch

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 08f0fd15b2..88a2fb271d 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -5275,7 +5275,7 @@  static void do_mem_zpz(DisasContext *s, int zt, int pg, int zm,
         desc = FIELD_DP32(desc, MTEDESC, ESIZE, 1 << msz);
         desc <<= SVE_MTEDESC_SHIFT;
     }
-    desc = simd_desc(vsz, vsz, scale);
+    desc = simd_desc(vsz, vsz, desc | scale);
     t_desc = tcg_const_i32(desc);
 
     tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg));