Re: FloatingPointMath and transformations

2014-06-03 Thread Jonathan Wakely
On 3 June 2014 01:47, Vincent Lefevre wrote: > On 2014-06-02 10:33:37 -0400, Geert Bosch wrote: >> It should, or it would be a bug. Please feel free to add/correct >> anything on this page. > > I am not a member of EditorGroup. That's easy to fix, email me your username.

Re: FloatingPointMath and transformations

2014-06-02 Thread Vincent Lefevre
On 2014-06-02 10:33:37 -0400, Geert Bosch wrote: > It should, or it would be a bug. Please feel free to add/correct > anything on this page. I am not a member of EditorGroup. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog:

Re: FloatingPointMath and transformations

2014-06-02 Thread Vincent Lefevre
On 2014-06-02 17:34:31 +0200, Andreas Schwab wrote: > Jakub Jelinek writes: > > > If C is a power of two, then 1.0 / C should IMHO never overflow, > > It does if C is subnormal. More precisely, in case of double precision, if C = DBL_MIN / 2, 1.0 / C doesn't overflow, but if C = DBL_MIN / 4 (or

Re: FloatingPointMath and transformations

2014-06-02 Thread Andreas Schwab
Jakub Jelinek writes: > If C is a power of two, then 1.0 / C should IMHO never overflow, It does if C is subnormal. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: FloatingPointMath and transformations

2014-06-02 Thread Jakub Jelinek
On Mon, Jun 02, 2014 at 10:33:37AM -0400, Geert Bosch wrote: > > First, it is said that x / C is replaced by x * (1.0 / C) when C is > > a power of two. But this condition is not sufficient: if 1.0 / C > > overflows, the transformation is incorrect. From some testing, > > it seems that GCC detects

Re: FloatingPointMath and transformations

2014-06-02 Thread Geert Bosch
On Jun 2, 2014, at 10:06 AM, Vincent Lefevre wrote: > I've looked at > > https://gcc.gnu.org/wiki/FloatingPointMath > > and there may be some mistakes or missing info. That’s quite possible. I created the page many years ago, based on my understanding of GCC at that time. > > First, it is

FloatingPointMath and transformations

2014-06-02 Thread Vincent Lefevre
I've looked at https://gcc.gnu.org/wiki/FloatingPointMath and there may be some mistakes or missing info. First, it is said that x / C is replaced by x * (1.0 / C) when C is a power of two. But this condition is not sufficient: if 1.0 / C overflows, the transformation is incorrect. From some t