[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH v3 2/5] fpu/softfloat: re-factor float to float co
From: |
Alex Bennée |
Subject: |
Re: [Qemu-arm] [PATCH v3 2/5] fpu/softfloat: re-factor float to float conversions |
Date: |
Thu, 10 May 2018 14:03:13 +0100 |
User-agent: |
mu4e 1.1.0; emacs 26.1 |
Peter Maydell <address@hidden> writes:
> On 10 May 2018 at 10:42, Alex Bennée <address@hidden> 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 <address@hidden>
>> Reviewed-by: Richard Henderson <address@hidden>
>>
>> ---
>> 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
- [Qemu-arm] [PATCH v3 0/5] refactor float-to-float and fix AHP, Alex Bennée, 2018/05/10
- [Qemu-arm] [PATCH v3 1/5] fpu/softfloat: int_to_float ensure r fully initialised, Alex Bennée, 2018/05/10
- [Qemu-arm] [PATCH v3 5/5] target/arm: squash FZ16 behaviour for conversions, Alex Bennée, 2018/05/10
- [Qemu-arm] [PATCH v3 4/5] target/arm: convert conversion helpers to fpst/ahp_flag, Alex Bennée, 2018/05/10
- [Qemu-arm] [PATCH v3 3/5] fpu/softfloat: support ARM Alternative half-precision, Alex Bennée, 2018/05/10
- [Qemu-arm] [PATCH v3 2/5] fpu/softfloat: re-factor float to float conversions, Alex Bennée, 2018/05/10
- Re: [Qemu-arm] [PATCH v3 0/5] refactor float-to-float and fix AHP, Peter Maydell, 2018/05/10