Re: [LAD] Is -ffast-math safe for audio?

2018-11-22 Thread Hermann Meyer
Am 23.11.18 um 03:56 schrieb Hermann Meyer: Am 22.11.18 um 23:44 schrieb Robin Gareus: On 11/22/2018 09:27 PM, Hermann Meyer wrote: However, problems with NAN's and INF's when use -ffinite-math-only occurs only when we save preset values to file, and only sometimes then. A shot in the

Re: [LAD] Is -ffast-math safe for audio?

2018-11-22 Thread Hermann Meyer
Am 22.11.18 um 23:44 schrieb Robin Gareus: On 11/22/2018 09:27 PM, Hermann Meyer wrote: However, problems with NAN's and INF's when use -ffinite-math-only occurs only when we save preset values to file, and only sometimes then. A shot in the dark.. Serializing a float in most parts of the

Re: [LAD] Is -ffast-math safe for audio?

2018-11-22 Thread Robin Gareus
On 11/22/2018 09:27 PM, Hermann Meyer wrote: > > > However, problems with NAN's and INF's when use -ffinite-math-only > occurs only when we save preset values to file, and only sometimes then. A shot in the dark.. Serializing a float in most parts of the world uses comma as decimal separator.

Re: [LAD] Is -ffast-math safe for audio?

2018-11-22 Thread Robin Gareus
Hi Will, I just ran your code and -ffast-math does not make any difference. With or without --ffast-math I get "int: 5 rem: 0.049994" However optimizing the code with `-O2 --ffast-math` does make a difference because SSE is used. Do you also use -O2, or -O3 along with --fast-math? On

Re: [LAD] Is -ffast-math safe for audio?

2018-11-22 Thread Fons Adriaensen
On Thu, Nov 22, 2018 at 09:27:58PM +0100, Hermann Meyer wrote: > In guitarix nearly all DSP is generated by FAUST. That doesn't make any difference for numerical stability. This is a property of an algorithm, not of the language. Ciao, -- FA ___

Re: [LAD] Is -ffast-math safe for audio?

2018-11-22 Thread Hermann Meyer
Am 22.11.18 um 21:07 schrieb Fons Adriaensen: On Thu, Nov 22, 2018 at 06:57:15PM +0100, Hermann Meyer wrote: Am 22.11.18 um 18:30 schrieb Will Godfrey: While testing some mixed floating point and integer calculations I found a quite surprising difference when this compiler option was set

Re: [LAD] Is -ffast-math safe for audio?

2018-11-22 Thread Robin Gareus
On 11/22/2018 07:28 PM, David Runge wrote: > Rabbit hole stuff! SuperCollider came to a similar conclusion: > https://github.com/supercollider/supercollider/issues/4116 This is a different issue. In SuperCollider's case they do want NaN and not finite-math, that is not usually the case for

Re: [LAD] Is -ffast-math safe for audio?

2018-11-22 Thread Fons Adriaensen
On Thu, Nov 22, 2018 at 06:57:15PM +0100, Hermann Meyer wrote: > Am 22.11.18 um 18:30 schrieb Will Godfrey: > > While testing some mixed floating point and integer calculations I found a > > quite surprising difference when this compiler option was set (gcc 6.x). It > > was > > clearly

Re: [LAD] Is -ffast-math safe for audio?

2018-11-22 Thread Will J Godfrey
On Thu, 22 Nov 2018 19:28:58 +0100 David Runge wrote: >On 2018-11-22 18:57:15 (+0100), Hermann Meyer wrote: >> In the guitarix project we've disabled  -ffast-math several years ago, >> when I remember right it was at gcc3, as it could lead to different >> un-reproduciable calculations. Last

Re: [LAD] Is -ffast-math safe for audio?

2018-11-22 Thread David Runge
On 2018-11-22 18:57:15 (+0100), Hermann Meyer wrote: > In the guitarix project we've disabled  -ffast-math several years ago, > when I remember right it was at gcc3, as it could lead to different > un-reproduciable calculations. Last option I've disabled on gcc8 now, > is -ffinite-math-only, this

Re: [LAD] Is -ffast-math safe for audio?

2018-11-22 Thread Hermann Meyer
Am 22.11.18 um 18:30 schrieb Will Godfrey: While testing some mixed floating point and integer calculations I found a quite surprising difference when this compiler option was set (gcc 6.x). It was clearly different at only 100 iterations and got dramatically worse with larger counts. My test

[LAD] Is -ffast-math safe for audio?

2018-11-22 Thread Will Godfrey
While testing some mixed floating point and integer calculations I found a quite surprising difference when this compiler option was set (gcc 6.x). It was clearly different at only 100 iterations and got dramatically worse with larger counts. My test routine was this: int a = 0; float b = 0;