This is the mail archive of the
mailing list for the GCC project.
Re: FloatingPointMath and transformations
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Geert Bosch <boschg at mac dot com>
- Cc: Vincent Lefevre <vincent+gcc at vinc17 dot org>, gcc at gcc dot gnu dot org
- Date: Mon, 2 Jun 2014 16:39:32 +0200
- Subject: Re: FloatingPointMath and transformations
- Authentication-results: sourceware.org; auth=none
- References: <20140602140635 dot GA5214 at ypig dot lip dot ens-lyon dot fr> <0B0543CB-A674-423D-AA5B-4252D75C3C11 at mac dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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 the overflow case, so that it behaves
> > correctly. In this case I think that the wiki should say:
> > "When C is a power of two and 1.0 / C doesn't overflow.â
> Yes, that was implied, but should indeed be made explicit.
If C is a power of two, then 1.0 / C should IMHO never overflow, do you mean
underflow to zero?