[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GUB and mpfr/mpc
From: |
Dan Eble |
Subject: |
Re: GUB and mpfr/mpc |
Date: |
Sat, 6 Dec 2014 11:43:31 -0500 |
On Dec 6, 2014, at 09:12 , David Kastrup <address@hidden> wrote:
>
> Dan Eble <address@hidden> writes:
>
>> I’ve only skimmed some web pages on this subject, but if the following
>> can be tolerated, it seems like the simplest way to reduce pain in
>> short order:
>>
>> On more modern x86 processors that support SSE2, specifying
>> the compiler options -mfpmath=sse -msse2 ensures all float
>> and double operations are performed in SSE registers and
>> correctly rounded.
>> [https://gcc.gnu.org/wiki/FloatingPointMath]
>>
>> It worked for my example program.
>
> "It will tend to fix known test cases and create a new set of previously
> working failures”.
[…]
> I think there is a less architecture-dependent option that keeps gcc
> from using any extra precision for intermediate results but it may be
> somewhat expensive. On the other hand, numerics are not where LilyPond
> spends most of its time.
>
> Probably
>
> '-ffloat-store’
[…]
> would do the trick. But we really rather should try to become
> independent from exact equalities as algorithm terminators.
I agree that changing the algorithms is preferred; I didn’t mean to suggest
otherwise. But if that’s not going to happen overnight, and there is a way to
mitigate the problem in the meantime without touching the code, the people
affected would value it.
I saw -ffloat-store too, but I didn’t recommend it because "-ffloat-store will
not suffice” for specific versions of GCC [1]; and "this option does not force
unnamed temporaries to be flushed to memory, as shown by experiments” [2]. So,
maybe it would help, to some extent, with the right compiler; or maybe there
are no unnamed temporaries that really matter and everything will work. If you
don’t want to require SSE2, it's worth a try.
[1] http://christian-seiler.de/projekte/fpmath/
[2] https://hal.archives-ouvertes.fr/hal-00128124/en/
—
Dan
- Re: GUB and mpfr/mpc, (continued)
- Re: GUB and mpfr/mpc, Masamichi HOSODA, 2014/12/04
- Re: GUB and mpfr/mpc, Dan Eble, 2014/12/04
- Re: GUB and mpfr/mpc, Masamichi HOSODA, 2014/12/05
- Re: GUB and mpfr/mpc, David Kastrup, 2014/12/05
- Re: GUB and mpfr/mpc, Dan Eble, 2014/12/05
- Re: GUB and mpfr/mpc, David Kastrup, 2014/12/06
- Re: GUB and mpfr/mpc,
Dan Eble <=
- Re: GUB and mpfr/mpc, Masamichi HOSODA, 2014/12/08
- Re: GUB and mpfr/mpc, David Kastrup, 2014/12/08
- Re: GUB and mpfr/mpc, Dan Eble, 2014/12/08
- Re: GUB and mpfr/mpc, Keith OHara, 2014/12/21
Re: GUB and mpfr/mpc, Masamichi Hosoda, 2014/12/28