qemu-ppc
[Top][All Lists]
Advanced

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

Re: [PATCH v1 2/9] gdbstub: Introduce gdb_get_float64() to get 64-bit fl


From: Richard Henderson
Subject: Re: [PATCH v1 2/9] gdbstub: Introduce gdb_get_float64() to get 64-bit float registers
Date: Fri, 1 May 2020 07:34:54 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 4/30/20 12:01 PM, Alex Bennée wrote:
> From: Philippe Mathieu-Daudé <address@hidden>
> 
> When converted to use GByteArray in commits 462474d760c and
> a010bdbe719, the call to stfq_p() was removed. This call
> serialize a float.
> Since we now use a GByteArray, we can not use stfq_p() directly.
> Introduce the gdb_get_float64() helper to load a float64 register.
> 
> Fixes: 462474d760c ("target/m68k: use gdb_get_reg helpers")
> Fixes: a010bdbe719 ("extend GByteArray to read register helpers")
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> Signed-off-by: Alex Bennée <address@hidden>
> Message-Id: <address@hidden>
> ---
>  include/exec/gdbstub.h          | 11 +++++++++++
>  target/m68k/helper.c            |  3 ++-
>  target/ppc/gdbstub.c            |  4 ++--
>  target/ppc/translate_init.inc.c |  2 +-
>  4 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
> index 20e1072692..4a2b8e3089 100644
> --- a/include/exec/gdbstub.h
> +++ b/include/exec/gdbstub.h
> @@ -134,6 +134,17 @@ static inline int gdb_get_float32(GByteArray *array, 
> float32 val)
>  
>      return sizeof(buf);
>  }
> +
> +static inline int gdb_get_float64(GByteArray *array, float64 val)
> +{
> +    uint8_t buf[sizeof(CPU_DoubleU)];
> +
> +    stfq_p(buf, val);
> +    g_byte_array_append(array, buf, sizeof(buf));
> +
> +    return sizeof(buf);
> +}

I think we'd be better off *removing* ldfl_p/ldfq_p/stfl_p/stfq_p and
everything that specializes on them, like this.


r~



reply via email to

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