mbox series

[0/4] target/i386: Emulate ftz and denormal flag bits correctly

Message ID 20250213142613.151308-1-peter.maydell@linaro.org (mailing list archive)
Headers show
Series target/i386: Emulate ftz and denormal flag bits correctly | expand

Message

Peter Maydell Feb. 13, 2025, 2:26 p.m. UTC
This is a set of four patches to target/i386 which use the core
fpu functionality we just landed for Arm FEAT_AFP to correct
the emulation of some corner cases of x86 floating point:
 * when we are flushing denormal outputs to zero, this should
   be done after rounding, not before
 * the MXCSR.DE and FPUS.DE bits indicate when a denormal input
   was not flushed and was used in an fp operation; we previously
   weren't implementing these semantics

All four patches have been reviewed by RTH. Testing is a bit
light (make check-tcg and make check-functional), because AFAIK
there is no freely available comprehensive FP testsuite for x86,
and risu doesn't support x86 currently so I can't do the same kind
of random-instruction-testing I could for Arm.

thanks
-- PMM

Peter Maydell (4):
  target/i386: Detect flush-to-zero after rounding
  target/i386: Use correct type for get_float_exception_flags() values
  target/i386: Wire up MXCSR.DE and FPUS.DE correctly
  tests/tcg/x86_64/fma: add test for exact-denormal output

 target/i386/ops_sse.h        |  16 +++---
 target/i386/tcg/fpu_helper.c | 101 +++++++++++++++++------------------
 tests/tcg/x86_64/fma.c       |  17 ++++--
 3 files changed, 68 insertions(+), 66 deletions(-)

Comments

Peter Maydell Feb. 24, 2025, 2:47 p.m. UTC | #1
Ping? Would an i386 maintainer like to pick these up?

thanks
-- PMM

On Thu, 13 Feb 2025 at 14:26, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> This is a set of four patches to target/i386 which use the core
> fpu functionality we just landed for Arm FEAT_AFP to correct
> the emulation of some corner cases of x86 floating point:
>  * when we are flushing denormal outputs to zero, this should
>    be done after rounding, not before
>  * the MXCSR.DE and FPUS.DE bits indicate when a denormal input
>    was not flushed and was used in an fp operation; we previously
>    weren't implementing these semantics
>
> All four patches have been reviewed by RTH. Testing is a bit
> light (make check-tcg and make check-functional), because AFAIK
> there is no freely available comprehensive FP testsuite for x86,
> and risu doesn't support x86 currently so I can't do the same kind
> of random-instruction-testing I could for Arm.
>
> thanks
> -- PMM
>
> Peter Maydell (4):
>   target/i386: Detect flush-to-zero after rounding
>   target/i386: Use correct type for get_float_exception_flags() values
>   target/i386: Wire up MXCSR.DE and FPUS.DE correctly
>   tests/tcg/x86_64/fma: add test for exact-denormal output
>
>  target/i386/ops_sse.h        |  16 +++---
>  target/i386/tcg/fpu_helper.c | 101 +++++++++++++++++------------------
>  tests/tcg/x86_64/fma.c       |  17 ++++--
>  3 files changed, 68 insertions(+), 66 deletions(-)
>
> --
> 2.43.0
Peter Maydell March 7, 2025, 10:38 a.m. UTC | #2
Ping^2 for pickup of reviewed patches.

thanks
-- PMM

On Mon, 24 Feb 2025 at 14:47, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> Ping? Would an i386 maintainer like to pick these up?
>
> thanks
> -- PMM
>
> On Thu, 13 Feb 2025 at 14:26, Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > This is a set of four patches to target/i386 which use the core
> > fpu functionality we just landed for Arm FEAT_AFP to correct
> > the emulation of some corner cases of x86 floating point:
> >  * when we are flushing denormal outputs to zero, this should
> >    be done after rounding, not before
> >  * the MXCSR.DE and FPUS.DE bits indicate when a denormal input
> >    was not flushed and was used in an fp operation; we previously
> >    weren't implementing these semantics
> >
> > All four patches have been reviewed by RTH. Testing is a bit
> > light (make check-tcg and make check-functional), because AFAIK
> > there is no freely available comprehensive FP testsuite for x86,
> > and risu doesn't support x86 currently so I can't do the same kind
> > of random-instruction-testing I could for Arm.
> >
> > thanks
> > -- PMM
> >
> > Peter Maydell (4):
> >   target/i386: Detect flush-to-zero after rounding
> >   target/i386: Use correct type for get_float_exception_flags() values
> >   target/i386: Wire up MXCSR.DE and FPUS.DE correctly
> >   tests/tcg/x86_64/fma: add test for exact-denormal output
> >
> >  target/i386/ops_sse.h        |  16 +++---
> >  target/i386/tcg/fpu_helper.c | 101 +++++++++++++++++------------------
> >  tests/tcg/x86_64/fma.c       |  17 ++++--
> >  3 files changed, 68 insertions(+), 66 deletions(-)
> >
> > --
> > 2.43.0
Peter Maydell March 12, 2025, 1:22 p.m. UTC | #3
Ping^3 ? Anybody home?

thanks
-- PMM

On Fri, 7 Mar 2025 at 10:38, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> Ping^2 for pickup of reviewed patches.
>
> thanks
> -- PMM
>
> On Mon, 24 Feb 2025 at 14:47, Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > Ping? Would an i386 maintainer like to pick these up?
> >
> > thanks
> > -- PMM
> >
> > On Thu, 13 Feb 2025 at 14:26, Peter Maydell <peter.maydell@linaro.org> wrote:
> > >
> > > This is a set of four patches to target/i386 which use the core
> > > fpu functionality we just landed for Arm FEAT_AFP to correct
> > > the emulation of some corner cases of x86 floating point:
> > >  * when we are flushing denormal outputs to zero, this should
> > >    be done after rounding, not before
> > >  * the MXCSR.DE and FPUS.DE bits indicate when a denormal input
> > >    was not flushed and was used in an fp operation; we previously
> > >    weren't implementing these semantics
> > >
> > > All four patches have been reviewed by RTH. Testing is a bit
> > > light (make check-tcg and make check-functional), because AFAIK
> > > there is no freely available comprehensive FP testsuite for x86,
> > > and risu doesn't support x86 currently so I can't do the same kind
> > > of random-instruction-testing I could for Arm.
> > >
> > > thanks
> > > -- PMM
> > >
> > > Peter Maydell (4):
> > >   target/i386: Detect flush-to-zero after rounding
> > >   target/i386: Use correct type for get_float_exception_flags() values
> > >   target/i386: Wire up MXCSR.DE and FPUS.DE correctly
> > >   tests/tcg/x86_64/fma: add test for exact-denormal output
> > >
> > >  target/i386/ops_sse.h        |  16 +++---
> > >  target/i386/tcg/fpu_helper.c | 101 +++++++++++++++++------------------
> > >  tests/tcg/x86_64/fma.c       |  17 ++++--
> > >  3 files changed, 68 insertions(+), 66 deletions(-)
> > >
> > > --
> > > 2.43.0