From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10287 invoked by alias); 6 Nov 2002 21:19:39 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 10280 invoked from network); 6 Nov 2002 21:19:38 -0000 Received: from unknown (HELO atrey.karlin.mff.cuni.cz) (195.113.31.123) by sources.redhat.com with SMTP; 6 Nov 2002 21:19:38 -0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 4018) id 7EFF64F9B0; Wed, 6 Nov 2002 22:19:37 +0100 (CET) Date: Wed, 06 Nov 2002 13:19:00 -0000 From: Jan Hubicka To: Jan Hubicka Cc: Richard Henderson , gcc-patches@gcc.gnu.org, aj@suse.de Subject: Re: Simplify floating point conversions II Message-ID: <20021106211937.GC1316@atrey.karlin.mff.cuni.cz> References: <20021105171400.GX14655@kam.mff.cuni.cz> <20021105173800.GD20534@redhat.com> <20021106092310.GE22059@kam.mff.cuni.cz> <20021106175441.GZ22059@kam.mff.cuni.cz> <20021106180930.GA22066@redhat.com> <20021106211059.GB1316@atrey.karlin.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021106211059.GB1316@atrey.karlin.mff.cuni.cz> User-Agent: Mutt/1.3.28i X-SW-Source: 2002-11/txt/msg00335.txt.bz2 > > On Wed, Nov 06, 2002 at 06:54:41PM +0100, Jan Hubicka wrote: > > > + For fast math it would be safe probably to convert (float)sqrt(x) > > (double)((float)a + (float)b) > > > > where A = B = 2**127. The result should be +Inf, not 2**128. > > I am doing that only when the mode of + is wider. > > > > Finally, I think it is alarmingly incorrect that > > > > (float)((double)a + (double)b)) > > > > does not result in a quantity of type float, as requested. > > Here I do that. When a and b are floats, I will produce > (a+b) > is that wrong? I see, you were shooting for something like (float)((long double)a + (long double)b) for a and b being double. That will result in (a+b) not casted to float that is wrong. I am adding recursive call to convert_to_real when this ahppends. Honza > > Honza > > > > > > r~