qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] target/arm: AArch32 VCVT fixed-point to float is always roun


From: Richard Henderson
Subject: Re: [PATCH] target/arm: AArch32 VCVT fixed-point to float is always round-to-nearest
Date: Tue, 13 Oct 2020 13:20:22 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 10/13/20 3:35 AM, Peter Maydell wrote:
> For AArch32, unlike the VCVT of integer to float, which honours the
> rounding mode specified by the FPSCR, VCVT of fixed-point to float is
> always round-to-nearest. (AArch64 fixed-point-to-float conversions
> always honour the FPCR rounding mode.)
> 
> Implement this by providing _round_to_nearest versions of the
> relevant helpers which set the rounding mode temporarily when making
> the call to the underlying softfloat function.
> 
> We only need to change the VFP VCVT instructions, because the
> standard- FPSCR value used by the Neon VCVT is always set to
> round-to-nearest, so we don't need to do the extra work of saving
> and restoring the rounding mode.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  target/arm/helper.h            | 13 +++++++++++++
>  target/arm/vfp_helper.c        | 23 ++++++++++++++++++++++-
>  target/arm/translate-vfp.c.inc | 24 ++++++++++++------------
>  3 files changed, 47 insertions(+), 13 deletions(-)

I guess this is ok.  I do wonder whether these extra helpers are really that
much better than using set_rmode.  But some of our existing *_round_to_zero
helpers are similar.

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


r~



reply via email to

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