qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 2/5] target/s390x: Fix SRDA CC calculation


From: David Hildenbrand
Subject: Re: [PATCH v4 2/5] target/s390x: Fix SRDA CC calculation
Date: Thu, 13 Jan 2022 16:33:02 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0

On 12.01.22 17:50, Ilya Leoshkevich wrote:
> SRDA uses r1_D32 for binding the first operand and s64 for setting CC.
> cout_s64() relies on o->out being the shift result, however,
> wout_r1_D32() clobbers it.
> 
> Fix by using a temporary.
> 
> Fixes: a79ba3398a0a ("target-s390: Convert SHIFT DOUBLE")
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>  target/s390x/tcg/translate.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
> index f180853e7a..766b4c87b2 100644
> --- a/target/s390x/tcg/translate.c
> +++ b/target/s390x/tcg/translate.c
> @@ -5420,9 +5420,11 @@ static void wout_r1_P32(DisasContext *s, DisasOps *o)
>  static void wout_r1_D32(DisasContext *s, DisasOps *o)
>  {
>      int r1 = get_field(s, r1);
> +    TCGv_i64 t = tcg_temp_new_i64();
>      store_reg32_i64(r1 + 1, o->out);
> -    tcg_gen_shri_i64(o->out, o->out, 32);
> -    store_reg32_i64(r1, o->out);
> +    tcg_gen_shri_i64(t, o->out, 32);
> +    store_reg32_i64(r1, t);
> +    tcg_temp_free_i64(t);
>  }
>  #define SPEC_wout_r1_D32 SPEC_r1_even
>  

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb




reply via email to

[Prev in Thread] Current Thread [Next in Thread]