This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: question about -ffast-math implementation
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- Cc: mike dot izbicki at gmail dot com, gcc mailing list <gcc at gcc dot gnu dot org>
- Date: Mon, 2 Jun 2014 00:00:43 -0700
- Subject: Re: question about -ffast-math implementation
- Authentication-results: sourceware.org; auth=none
- References: <CAKKZoUUtBdU_ZR61hsztymquqDrRkqEUoxeiEE0kzmrpUq+Emg at mail dot gmail dot com> <CAO9iq9ENWmnEwf1HbcK4c3y8VYZP7w0W_0vL5ypDECTP5e4a=g at mail dot gmail dot com>
On Sun, Jun 1, 2014 at 11:09 PM, Janne Blomqvist
<blomqvist.janne@gmail.com> wrote:
> On Sun, Jun 1, 2014 at 9:52 AM, Mike Izbicki <mike.izbicki@gmail.com> wrote:
>> I'm trying to copy gcc's behavior with the -ffast-math compiler flag
>> into haskell's ghc compiler. The only documentation I can find about
>> it is at:
>>
>> https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
>>
>> I understand how floating point operations work and have come up with
>> a reasonable list of optimizations to perform. But I doubt it is
>> exhaustive.
>>
>> My question is: where can I find all the gory details about what gcc
>> will do with this flag? I'm perfectly willing to look at source code
>> if that's what it takes.
>
> In addition to the official documentation, a nice overview is at
>
> https://gcc.gnu.org/wiki/FloatingPointMath
>
> Though for the gory details and authoritative answers I suppose you'd
> have to look into the source code.
>
>> Also, are there any optimizations that you wish -ffast-math could
>> perform, but for various architectural reasons they don't fit into
>> gcc?
>
> There are of course a (nearly endless?) list of optimizations that
> could be done but aren't (lack of manpower, impractical, whatnot). I'm
> not sure there are any interesting optimizations that would be
> dependent on loosening -ffast-math further?
>
> (One thing I wish wouldn't be included in -ffast-math is
> -fcx-limited-range; the naive complex division algorithm can easily
> lead to comically poor results.)
Which is kinda interesting because the Google folks have been trying
to turn on -fcx-limited-range for C++ a few times now.
Thanks,
Andrew Pinski
>
> --
> Janne Blomqvist