From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Richard Henderson <richard.henderson@linaro.org>,
qemu-arm <qemu-arm@nongnu.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH v3 2/5] fpu/softfloat: re-factor float to float conversions
Date: Thu, 10 May 2018 14:03:13 +0100 [thread overview]
Message-ID: <87mux7vf1q.fsf@linaro.org> (raw)
In-Reply-To: <CAFEAcA_8OCa_gCWzhTNhWAoabCVVNoNiN9H7zbJ1=6KJAFveSA@mail.gmail.com>
Peter Maydell <peter.maydell@linaro.org> writes:
> On 10 May 2018 at 10:42, Alex Bennée <alex.bennee@linaro.org> wrote:
>> This allows us to delete a lot of additional boilerplate code which is
>> no longer needed. Currently the ieee flag is ignored (everything is
>> assumed to be ieee). Handling for ARM AHP will be in the next patch.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>>
>> ---
>> v2
>> - pass FloatFmt to float_to_float instead of sizes
>> - split AHP handling to another patch
>> - use rth's suggested re-packing (+ setting .exp)
>> v3
>> - also rm extractFloat16Sign
>> ---
>> fpu/softfloat-specialize.h | 40 ----
>> fpu/softfloat.c | 452 +++++++------------------------------
>> include/fpu/softfloat.h | 8 +-
>> 3 files changed, 88 insertions(+), 412 deletions(-)
>
> This introduces a regression where we don't get tininess-before-rounding
> for double/single to halfprec conversions. This is because we're
> now using the fp_status_f16 status field, and it has not had
> the detect_tininess setting initialized. This fixes it:
>
> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
> index d175c5e94f..7939c6b8ae 100644
> --- a/target/arm/cpu.c
> +++ b/target/arm/cpu.c
> @@ -324,6 +324,8 @@ static void arm_cpu_reset(CPUState *s)
> &env->vfp.fp_status);
> set_float_detect_tininess(float_tininess_before_rounding,
> &env->vfp.standard_fp_status);
> + set_float_detect_tininess(float_tininess_before_rounding,
> + &env->vfp.fp_status_f16);
I'm now wondering if I should have tried harder to rationalise the
various float_status structures we've ended up with.
> #ifndef CONFIG_USER_ONLY
> if (kvm_enabled()) {
> kvm_arm_reset_vcpu(cpu);
>
> (You can see this if you try something like fcvt h1, d0 where
> d0 == 0x3f0f_ffff_ffff_ffff -- we get the right answer of 0x0400
> but fail to set Underflow as well as Inexact.)
>
> thanks
> -- PMM
--
Alex Bennée
next prev parent reply other threads:[~2018-05-10 13:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-10 9:42 [Qemu-devel] [PATCH v3 0/5] refactor float-to-float and fix AHP Alex Bennée
2018-05-10 9:42 ` [Qemu-devel] [PATCH v3 1/5] fpu/softfloat: int_to_float ensure r fully initialised Alex Bennée
2018-05-10 12:40 ` Peter Maydell
2018-05-10 14:50 ` Richard Henderson
2018-05-10 9:42 ` [Qemu-devel] [PATCH v3 2/5] fpu/softfloat: re-factor float to float conversions Alex Bennée
2018-05-10 12:48 ` Peter Maydell
2018-05-10 13:03 ` Alex Bennée [this message]
2018-05-10 9:42 ` [Qemu-devel] [PATCH v3 3/5] fpu/softfloat: support ARM Alternative half-precision Alex Bennée
2018-05-10 9:42 ` [Qemu-devel] [PATCH v3 4/5] target/arm: convert conversion helpers to fpst/ahp_flag Alex Bennée
2018-05-10 9:42 ` [Qemu-devel] [PATCH v3 5/5] target/arm: squash FZ16 behaviour for conversions Alex Bennée
2018-05-10 12:55 ` [Qemu-devel] [PATCH v3 0/5] refactor float-to-float and fix AHP Peter Maydell
2018-05-10 13:34 ` Alex Bennée
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mux7vf1q.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=aurelien@aurel32.net \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).