From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7977 invoked by alias); 5 Nov 2002 17:42:37 -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 7970 invoked from network); 5 Nov 2002 17:42:35 -0000 Received: from unknown (HELO nikam.ms.mff.cuni.cz) (195.113.18.106) by sources.redhat.com with SMTP; 5 Nov 2002 17:42:35 -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 7AF504E29B; Tue, 5 Nov 2002 18:42:34 +0100 (CET) Received: by camelot.ms.mff.cuni.cz (sSMTP sendmail emulation); Tue, 5 Nov 2002 18:42:31 +0100 Date: Tue, 05 Nov 2002 09:42:00 -0000 From: Jan Hubicka To: Richard Henderson , Jan Hubicka , gcc-patches@gcc.gnu.org, aj@suse.de Subject: Re: Simplify floating point conversions Message-ID: <20021105174231.GZ14655@kam.mff.cuni.cz> References: <20021105171400.GX14655@kam.mff.cuni.cz> <20021105173800.GD20534@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021105173800.GD20534@redhat.com> User-Agent: Mutt/1.3.28i X-SW-Source: 2002-11/txt/msg00220.txt.bz2 > On Tue, Nov 05, 2002 at 06:14:00PM +0100, Jan Hubicka wrote: > > 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. > > You should have commented this. It should not take someone 5 Oops... > minutes to even figure out what's going on here. To be sure, it's > > (float)sqrtl(x) -> sqrtf((float)x) It does just (float)sqrt((float)x)->sqrtf(x) This is common in C code when you call sqrt on float value. Honza > > correct? Well, clearly this fails for X = 2**(127 * 2), since > X is not representable as a float, but its square root is. It > would not be hard to identify similar problems with every other > operation on your list except for ABS/NEG. > > > r~