From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8212 invoked by alias); 6 Nov 2002 22:53:56 -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 8205 invoked from network); 6 Nov 2002 22:53:54 -0000 Received: from unknown (HELO atrey.karlin.mff.cuni.cz) (195.113.31.123) by sources.redhat.com with SMTP; 6 Nov 2002 22:53:54 -0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 4018) id 402104F9B2; Wed, 6 Nov 2002 23:53:53 +0100 (CET) Date: Wed, 06 Nov 2002 14:53:00 -0000 From: Jan Hubicka To: Richard Henderson , Jan Hubicka , Gabriel Dos Reis , gcc-patches@gcc.gnu.org, aj@suse.de Subject: Re: Converting floor to rint Message-ID: <20021106225353.GI1316@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> <20021106222922.GH1316@atrey.karlin.mff.cuni.cz> <20021106224721.GK22215@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021106224721.GK22215@redhat.com> User-Agent: Mutt/1.3.28i X-SW-Source: 2002-11/txt/msg00364.txt.bz2 > On Wed, Nov 06, 2002 at 11:29:22PM +0100, Jan Hubicka wrote: > > On the related note. How bad would you consider converting > > floor(x) into rint(x-0.5) in the fast-math mode? > > Well, let's see... > > If the current rounding mode is FE_UPWARD, then > > rint(1.7 - 0.5) = rint(1.2) = 2.0 > > I.e. we'd be computing CEIL instead of FLOOR. > > If the current rounding mode is FE_TONEAREST, which is the case > I assume you were thinking about, we round ties to even, so > > rint(5.0 - 0.5) = rint(4.5) = 4.0 > > instead of the expected value 5.0. > > So, I think this would be a very bad idea, even for -ffast-math. Hmmm... OK then :( Honza > > > > r~