This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Optimize logarithm addition and subtraction

On 08/05/2018 12:35 PM, Marc Glisse wrote:
> On Sun, 5 Aug 2018, Bernd Edlinger wrote:
>>> merging log a + log b => log a*b and
>> Maybe a*b could overflow, while adding the logarithms would not?
> Well, that's a discussion that happens every time a new transformation
> is added to -funsafe-math-optimizations (I assume this one is under that
> umbrella?). We already may get extra overflow with -fassociative-math
> for instance. Sure, the overflow (or underflow!) is more likely for log
> than for addition, but this still seems like the kind of transformation
> that -ffast-math should enable, in my opinion. Now we can see if I am in
> the minority...
One of the requirements for adding something to -ffast-math is that it
doesn't break spec (we've never been specific about the version, though
I think spec2017 and spec2006 are the only ones that matter anymore and
the latter's importance diminishes daily).

I don't know if the original submitter has access to the spec suite, so
we'll likely need to do that testing.  I can't commit to any timeframe
for that right now, but I think that's the biggest hurdle we need to jump.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]