On Sun, 24 Oct 2021 02:43:43 +0200
Ichthyostega <p...@ichthyostega.de> wrote:

>Hi Will,
>Hi Kristian,
>
>yesterday I missed the forest for the trees...
>What is actually going on here is that recent Compilers/Optimisers
>are clever enough to perform that transformation: replace a powf()
>with constant base by a expf() with precomputed logarithm.
>
>Just depending on the compiler and seemingly the way how SSE is used,
>this leads to various degrees of slightly different numerical results.
>The generated assembly really looks quite different on GCC-7 vs. GCC-8.
>And the O0-case still uses the powf() variant and thus gets significant
>different results.
>
>Today, for this experiment, I have now replaced that code explicitly
>to always use the expf() with a precomputed logarithm. For this test case,
>I also needed to do the same on the global volume (and I see various further
>instances of the same pattern, e.g. in LFO or with punch, which we just do not
>touch with that simple sine test).
>
>After those adjustments I now get precisely the same numbers with the
>Release builds both on my PC and my laptop. With that first simple
>test with just a single sine note of course (I expect more such hickups
>down the road)
>
>
>However, I still get different results with Debug builds vs Release
>builds. And this is due to the AnalogFilter. Since we're using
>--fast-math, the optimiser is allowed to reorder statements, which
>seemingly leads to some build-up of differences in the feedback
>loop of that filter. But, as said, the results on the Release
>builds as such do match now on my Desktop and Laptop.
>
>-- Hermann

That's a good bit of sleuthing. Well done!
I've found in the past that AnalogFilter was 'interesting' and it gets used in
a *lot* of places.
Is this ready to go now?

-- 
Will J Godfrey
https://willgodfrey.bandcamp.com/
http://yoshimi.github.io
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.


_______________________________________________
Yoshimi-devel mailing list
Yoshimi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel

Reply via email to