From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7630 invoked by alias); 29 May 2009 17:11:53 -0000 Received: (qmail 7605 invoked by uid 22791); 29 May 2009 17:11:50 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_22,J_CHICKENPOX_33,J_CHICKENPOX_43 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.43rc1) with ESMTP; Fri, 29 May 2009 17:11:46 +0000 Received: from sunsite.mff.cuni.cz (localhost [127.0.0.1]) by sunsite.mff.cuni.cz (8.14.3/8.14.3) with ESMTP id n4THBUhE003437; Fri, 29 May 2009 19:11:30 +0200 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.14.3/8.14.3/Submit) id n4THBUga003436; Fri, 29 May 2009 19:11:30 +0200 Date: Fri, 29 May 2009 17:11:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] Fix math/test-{ldouble,ildoubl} failures on s390{,x}, sparc{,64} and alpha Message-ID: <20090529171130.GB3101@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.19 (2009-01-05) 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: 2009-05/txt/msg00015.txt.bz2 Hi! Similar patch to what Andreas posted for ppc long double, this time for IEEE quad. Tested on s390{,x}-linux. 2009-05-29 Jakub Jelinek * sysdeps/ieee754/ldbl-128/s_expm1l.c: Include . (__expm1l): Set errno to ERANGE on overflow. * sysdeps/ieee754/ldbl-128/s_tanl.c: Include . (__tanl): Set errno to EDOM for ±Inf. * sysdeps/ieee754/ldbl-128/s_cosl.c: Include . (__cosl): Set errno to EDOM for ±Inf. * sysdeps/ieee754/ldbl-128/s_sinl.c: Include . (__sinl): Set errno to EDOM for ±Inf. --- libc/sysdeps/ieee754/ldbl-128/s_expm1l.c.jj 2009-05-16 13:23:38.000000000 -0400 +++ libc/sysdeps/ieee754/ldbl-128/s_expm1l.c 2009-05-29 12:09:10.000000000 -0400 @@ -53,6 +53,7 @@ +#include #include "math.h" #include "math_private.h" @@ -121,7 +122,10 @@ __expm1l (long double x) /* Overflow. */ if (x > maxlog) - return (big * big); + { + __set_errno (ERANGE); + return (big * big); + } /* Minimum value. */ if (x < minarg) --- libc/sysdeps/ieee754/ldbl-128/s_tanl.c.jj 2009-05-16 13:23:38.000000000 -0400 +++ libc/sysdeps/ieee754/ldbl-128/s_tanl.c 2009-05-29 12:28:12.000000000 -0400 @@ -44,6 +44,7 @@ * TRIG(x) returns trig(x) nearly rounded */ +#include #include "math.h" #include "math_private.h" @@ -65,7 +66,14 @@ if(ix <= 0x3ffe921fb54442d1LL) return __kernel_tanl(x,z,1); /* tanl(Inf or NaN) is NaN */ - else if (ix>=0x7fff000000000000LL) return x-x; /* NaN */ + else if (ix>=0x7fff000000000000LL) { + if (ix == 0x7fff000000000000LL) { + GET_LDOUBLE_LSW64(n,x); + if (n == 0) + __set_errno (EDOM); + } + return x-x; /* NaN */ + } /* argument reduction needed */ else { --- libc/sysdeps/ieee754/ldbl-128/s_cosl.c.jj 2009-05-16 13:23:38.000000000 -0400 +++ libc/sysdeps/ieee754/ldbl-128/s_cosl.c 2009-05-29 12:27:45.000000000 -0400 @@ -44,6 +44,7 @@ * TRIG(x) returns trig(x) nearly rounded */ +#include #include "math.h" #include "math_private.h" @@ -66,7 +67,14 @@ return __kernel_cosl(x,z); /* cos(Inf or NaN) is NaN */ - else if (ix>=0x7fff000000000000LL) return x-x; + else if (ix>=0x7fff000000000000LL) { + if (ix == 0x7fff000000000000LL) { + GET_LDOUBLE_LSW64(n,x); + if (n == 0) + __set_errno (EDOM); + } + return x-x; + } /* argument reduction needed */ else { --- libc/sysdeps/ieee754/ldbl-128/s_sinl.c.jj 2009-05-16 13:23:38.000000000 -0400 +++ libc/sysdeps/ieee754/ldbl-128/s_sinl.c 2009-05-29 12:27:27.000000000 -0400 @@ -44,6 +44,7 @@ * TRIG(x) returns trig(x) nearly rounded */ +#include #include "math.h" #include "math_private.h" @@ -66,7 +67,14 @@ return __kernel_sinl(x,z,0); /* sin(Inf or NaN) is NaN */ - else if (ix>=0x7fff000000000000LL) return x-x; + else if (ix>=0x7fff000000000000LL) { + if (ix == 0x7fff000000000000LL) { + GET_LDOUBLE_LSW64(n,x); + if (n == 0) + __set_errno (EDOM); + } + return x-x; + } /* argument reduction needed */ else { Jakub