[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: x86 denormal flag handling
From: |
Peter Maydell |
Subject: |
Re: x86 denormal flag handling |
Date: |
Fri, 31 Jan 2025 10:28:44 +0000 |
On Fri, 31 Jan 2025 at 02:03, Michael Morrell <mmorrell@tachyum.com> wrote:
>
> I’ve been following the recent changes to better support denormal handling
> and I don’t think they are doing the right thing for x86.
>
>
>
> I tried a simple program to convert a denormal float value (0x1.0p-127) to a
> double. With the default of DAZ being 0 in MXCSR, x86 sets DE, but QEMU
> doesn’t. This is the opposite behavior of AARCH64 which sets their denormal
> input flag when it flushes a denormal input to 0.
Yes. None of the changes to fix denormal handling have
actually landed in git yet, so what you see at the moment
is still the behaviour QEMU has had for years, where it
doesn't either detect "this denormal input was used without
being flushed" or set the MXCSR DE flag with the correct
semantics.
I have a work in progress branch at
https://git.linaro.org/people/peter.maydell/qemu-arm.git/log/?h=feat-afp
which has the new handling and also at the end the target/i386
changes to get the DE flag right. If you build a QEMU with
those patches then it produces the right result with your
test program.
thanks
-- PMM