On 10 May 2018 at 10:42, Alex Bennée <alex.ben...@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.ben...@linaro.org> > Reviewed-by: Richard Henderson <richard.hender...@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); #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