On Tue, Jul 30, 2024 at 3:00 PM Richard Biener <rguent...@suse.de> wrote:
>
> On Tue, 30 Jul 2024, Alexander Monakov wrote:
>
> >
> > On Tue, 30 Jul 2024, Richard Biener wrote:
> >
> > > > Oh, and please add a small comment why we don't use XFmode here.
> > >
> > > Will do.
> > >
> > >         /* Do not enable XFmode, there is padding in it and it suffers
> > >            from normalization upon load like SFmode and DFmode when
> > >            not using SSE.  */
> >
> > Is it really true? I have no evidence of FLDT performing normalization
> > (as mentioned in PR 114659, if it did, there would be no way to spill/reload
> > x87 registers).
>
> What mangling fld performs depends on the contents of the FP control
> word which is awkward.  IIRC there's at least a bugreport that it
> turns sNaN into a qNaN, it seems I was wrong about denormals
> (when DM is not masked).  And yes, IIRC x87 instability is also
> related to spills (IIRC we spill in the actual mode of the reg, not in
> XFmode), but -fexcess-precision=standard should hopefully avoid that.
> It's also not clear whether all implementations conformed to the
> specs wrt extended-precision format loads.

FYI, FLDT does not mangle long-double values and does not generate
exceptions. Please see [1], but ignore shadowed text and instead read
the "Floating-Point Exceptions" section. So, as far as hardware is
concerned, it *can* be used to transfer 10-byte values, but I don't
want to judge from the compiler PoV if this is the way to go. We can
enable it, perhaps temporarily to experiment a bit - it is easy to
disable if it causes problems.

Let's CC Intel folks for their opinion, if it is worth using an aging
x87 to transfer 80-bit data.

[1] https://www.felixcloutier.com/x86/fld

Uros.

Reply via email to