From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22912 invoked by alias); 1 Apr 2007 17:07:51 -0000 Received: (qmail 22843 invoked by uid 22791); 1 Apr 2007 17:07:47 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 01 Apr 2007 18:07:44 +0100 Received: from sunsite.mff.cuni.cz (localhost.localdomain [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.8/8.13.8) with ESMTP id l31HCxXM020504; Sun, 1 Apr 2007 19:12:59 +0200 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.13.8/8.13.8/Submit) id l31HCx3i020499; Sun, 1 Apr 2007 19:12:59 +0200 Date: Sun, 01 Apr 2007 17:07:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] Fix next{after,toward}l on ppc* Message-ID: <20070401171259.GF1826@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek References: <20070327131242.GD1826@sunsite.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070327131242.GD1826@sunsite.mff.cuni.cz> User-Agent: Mutt/1.4.2.2i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00000.txt.bz2 On Tue, Mar 27, 2007 at 03:12:42PM +0200, Jakub Jelinek wrote: > 2007-03-27 Jakub Jelinek > > [BZ #3306] > * math/math_private.h (math_opt_barrier, math_force_eval): Define. ... Testing on ppc/ppc64 revealed one forgotten file in this patch, here it is incrementally on top of the previously posted BZ#3306 patch. 2007-04-01 Jakub Jelinek * sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl): Use math_opt_barrier and math_force_eval macros. --- libc/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c.jj 2006-01-28 01:07:25.000000000 +0100 +++ libc/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c 2007-04-01 18:40:19.000000000 +0200 @@ -24,8 +24,8 @@ static char rcsid[] = "$NetBSD: $"; * Special cases: */ -#include "math.h" -#include "math_private.h" +#include +#include #include #ifdef __STDC__ @@ -53,9 +53,12 @@ static char rcsid[] = "$NetBSD: $"; if(x==y) return y; /* x=y, return y */ if(ihx == 0 && ilx == 0) { /* x == 0 */ + long double u; SET_LDOUBLE_WORDS64(x,hy&0x8000000000000000ULL,1);/* return +-minsubnormal */ - y = x*x; - if(y==x) return y; else return x; /* raise underflow flag */ + u = math_opt_barrier (u); + u = u * u; + math_force_eval (u); /* raise underflow flag */ + return x; } if(ihx>=0) { /* x > 0 */ if(ihx>ihy||((ihx==ihy)&&(ilx>ily))) { /* x > y, x -= ulp */ @@ -93,12 +96,9 @@ static char rcsid[] = "$NetBSD: $"; } hy = hx&0x7ff0000000000000LL; if(hy==0x7ff0000000000000LL) return x+x;/* overflow */ - if(hy==0) { /* underflow */ - y = x*x; - if(y!=x) { /* raise underflow flag */ - SET_LDOUBLE_WORDS64(y,hx,lx); - return y; - } + if(hy==0) { + long double u = x * x; /* underflow */ + math_force_eval (u); /* raise underflow flag */ } SET_LDOUBLE_WORDS64(x,hx,lx); return x; Jakub