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 -funsaf
On Sun, 5 Aug 2018, MCC CS wrote:
Besides, if you think optimizing
/* logN(a) + logN(b) -> logN(a * b) */
would be enough, without the coefficients,
here's a simpler patch:
Index: gcc/match.pd
===
--- gcc/match.pd(revision 2633
> Sent: Sunday, August 05, 2018 at 8:17 PM
> From: "Marc Glisse"
> To: "MCC CS"
> Cc: gcc-patches@gcc.gnu.org
> Subject: Re: [PATCH] Optimize logarithm addition and subtraction
>
> On Sun, 5 Aug 2018, MCC CS wrote:
>
> > this patch reduces calls
On 08/05/18 20:35, 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-ma
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
um
On Aug 05 2018, Marc Glisse wrote:
> On Sun, 5 Aug 2018, MCC CS wrote:
>
>> this patch reduces calls to logarithm functions by
>> merging log a + log b => log a*b and
>
> this makes sense.
Even when a*b may overflow?
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578
> merging log a + log b => log a*b and
Maybe a*b could overflow, while adding the logarithms would not?
Bernd.
On Sun, 5 Aug 2018, MCC CS wrote:
this patch reduces calls to logarithm functions by
merging log a + log b => log a*b and
this makes sense.
+ /* x * logN(a) + y * logN(b) -> x * y * logN(a * b). */
this on the other hand... Can you explain the math?
--
Marc Glisse