From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19555 invoked by alias); 6 Nov 2002 09:09:07 -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 19548 invoked from network); 6 Nov 2002 09:09:05 -0000 Received: from unknown (HELO nikam.ms.mff.cuni.cz) (195.113.18.106) by sources.redhat.com with SMTP; 6 Nov 2002 09:09:05 -0000 Received: from camelot.ms.mff.cuni.cz (kampanus.ms.mff.cuni.cz [195.113.18.107]) by nikam.ms.mff.cuni.cz (Postfix) with SMTP id 3AFE74E29B; Wed, 6 Nov 2002 10:09:05 +0100 (CET) Received: by camelot.ms.mff.cuni.cz (sSMTP sendmail emulation); Wed, 6 Nov 2002 10:09:04 +0100 Date: Wed, 06 Nov 2002 01:09:00 -0000 From: Jan Hubicka To: Geoff Keating Cc: Jan Hubicka , gcc-patches@gcc.gnu.org Subject: Re: Simplify floating point conversions Message-ID: <20021106090904.GB22059@kam.mff.cuni.cz> References: <20021105171400.GX14655@kam.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-SW-Source: 2002-11/txt/msg00265.txt.bz2 > Jan Hubicka writes: > > > Hi, > > this patch makes us to simplify some of the floating point operations to > > narrower mode when conversions are present. This include > > +,-,/,*,abs,neg,sqrt/sin/cos/exp. > > I believe it is IEEE safe, but some expert would be welcome. > > It's not safe, except for 'abs' and 'neg'. For example, > (float)sqrt(2.0 * FLT_MAX) != sqrtf(2.0 * FLT_MAX). > I think it would be OK for -ffast-math, though. I am doing only (float)sqrt((double)float) that commonly results from C code that uses floats but calls math functions. I can add fast-math code for weaker checks later, but first I would like to know whether this transformation is valid. I will add the comments :) I usually write the automatically and ididn't noticed there are none.. Honza > > -- > - Geoffrey Keating