[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] ffast-math
From: |
CEL |
Subject: |
Re: [Discuss-gnuradio] ffast-math |
Date: |
Mon, 2 Sep 2019 15:27:14 +0000 |
-ffast-math is allowed to reorder calculations, e.g. it can do
a*f + b*f + c*f as (a+b+c)*f (or vice versa)
which of course isn't necessarily the same result, and can lead to
numerical instability.
The problem is really that for some kernels, things like zero-signage
and NaN / Inf handling / rounding / saturation are negligible, for
others not. We've had plenty of fun with kernels where the SIMD
implementation actually did the right thing, but the plain C
implementation misbehaved, for example, because it didn't use the same
FPU flags; I'd be kind of hesitant to add more "might or might not act
as expected" code...
Best regards,
Marcus
On Mon, 2019-09-02 at 16:52 +0200, Albin Stigö wrote:
> ffast-math disables signed zero by design I think...
>
> I'm particularly interested in problems of numeric stability and loss of
> dynamic range.
>
>
> --Albin
>
> On Mon, Sep 2, 2019, 15:27 Johannes Demel <address@hidden> wrote:
> > Hi Albin,
> >
> > one of my students reported a little oddity about `-ffast-math`. Assume
> > you want to set a float to -0, i.e. set the sign bit only. In this case
> > `-ffast-math` seems to remove the sign bit.
> >
> > In VOLK this might be an issue with `_mm256_conjugate_ps` in
> > `include/volk/volk_avx_intrinsics.h`. I didn't check for other potential
> > error sources.
> >
> > Cheers
> > Johannes
> >
> > Am 01.09.19 um 16:10 schrieb Albin Stigö:
> > > Anyone has experience with the real world impact of using gcc
> > > -ffast-math with SDR in general, and GNURadio/Volk in particular?
> > >
> > >
> > > --Albin SM6WJM
> > >
> > > _______________________________________________
> > > Discuss-gnuradio mailing list
> > > address@hidden
> > > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> > >
> > _______________________________________________
> > Discuss-gnuradio mailing list
> > address@hidden
> > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
smime.p7s
Description: S/MIME cryptographic signature