From 8bca7cd830e3563e214a6e3cf93da839f937f1a2 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 28 Nov 2013 20:50:03 +0000 Subject: Remove unused ldbl-96 functions (bug 15004). --- sysdeps/ieee754/ldbl-96/e_atan2l.c | 125 -------------------------------- sysdeps/ieee754/ldbl-96/e_ilogbl.c | 59 --------------- sysdeps/ieee754/ldbl-96/e_remainderl.c | 72 ------------------ sysdeps/ieee754/ldbl-96/s_ceill.c | 85 ---------------------- sysdeps/ieee754/ldbl-96/s_fabsl.c | 35 --------- sysdeps/ieee754/ldbl-96/s_finitel.c | 36 --------- sysdeps/ieee754/ldbl-96/s_floorl.c | 86 ---------------------- sysdeps/ieee754/ldbl-96/s_fpclassifyl.c | 44 ----------- sysdeps/ieee754/ldbl-96/s_isinfl.c | 30 -------- sysdeps/ieee754/ldbl-96/s_isnanl.c | 40 ---------- sysdeps/ieee754/ldbl-96/s_logbl.c | 51 ------------- sysdeps/ieee754/ldbl-96/s_nearbyintl.c | 88 ---------------------- sysdeps/ieee754/ldbl-96/s_nextafterl.c | 96 ------------------------ sysdeps/ieee754/ldbl-96/s_rintl.c | 82 --------------------- sysdeps/ieee754/ldbl-96/s_scalbnl.c | 61 ---------------- sysdeps/ieee754/ldbl-96/s_truncl.c | 56 -------------- 16 files changed, 1046 deletions(-) delete mode 100644 sysdeps/ieee754/ldbl-96/e_atan2l.c delete mode 100644 sysdeps/ieee754/ldbl-96/e_ilogbl.c delete mode 100644 sysdeps/ieee754/ldbl-96/e_remainderl.c delete mode 100644 sysdeps/ieee754/ldbl-96/s_ceill.c delete mode 100644 sysdeps/ieee754/ldbl-96/s_fabsl.c delete mode 100644 sysdeps/ieee754/ldbl-96/s_finitel.c delete mode 100644 sysdeps/ieee754/ldbl-96/s_floorl.c delete mode 100644 sysdeps/ieee754/ldbl-96/s_fpclassifyl.c delete mode 100644 sysdeps/ieee754/ldbl-96/s_isinfl.c delete mode 100644 sysdeps/ieee754/ldbl-96/s_isnanl.c delete mode 100644 sysdeps/ieee754/ldbl-96/s_logbl.c delete mode 100644 sysdeps/ieee754/ldbl-96/s_nearbyintl.c delete mode 100644 sysdeps/ieee754/ldbl-96/s_nextafterl.c delete mode 100644 sysdeps/ieee754/ldbl-96/s_rintl.c delete mode 100644 sysdeps/ieee754/ldbl-96/s_scalbnl.c delete mode 100644 sysdeps/ieee754/ldbl-96/s_truncl.c (limited to 'sysdeps/ieee754/ldbl-96') diff --git a/sysdeps/ieee754/ldbl-96/e_atan2l.c b/sysdeps/ieee754/ldbl-96/e_atan2l.c deleted file mode 100644 index 209f29bbd2..0000000000 --- a/sysdeps/ieee754/ldbl-96/e_atan2l.c +++ /dev/null @@ -1,125 +0,0 @@ -/* e_atan2l.c -- long double version of e_atan2.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* __ieee754_atan2l(y,x) - * Method : - * 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x). - * 2. Reduce x to positive by (if x and y are unexceptional): - * ARG (x+iy) = arctan(y/x) ... if x > 0, - * ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0, - * - * Special cases: - * - * ATAN2((anything), NaN ) is NaN; - * ATAN2(NAN , (anything) ) is NaN; - * ATAN2(+-0, +(anything but NaN)) is +-0 ; - * ATAN2(+-0, -(anything but NaN)) is +-pi ; - * ATAN2(+-(anything but 0 and NaN), 0) is +-pi/2; - * ATAN2(+-(anything but INF and NaN), +INF) is +-0 ; - * ATAN2(+-(anything but INF and NaN), -INF) is +-pi; - * ATAN2(+-INF,+INF ) is +-pi/4 ; - * ATAN2(+-INF,-INF ) is +-3pi/4; - * ATAN2(+-INF, (anything but,0,NaN, and INF)) is +-pi/2; - * - * Constants: - * The hexadecimal values are the intended ones for the following - * constants. The decimal values may be used, provided that the - * compiler will convert from decimal to binary accurately enough - * to produce the hexadecimal values shown. - */ - -#include -#include - -static const long double -tiny = 1.0e-4900L, -zero = 0.0, -pi_o_4 = 7.85398163397448309628202E-01L, /* 0x3FFE, 0xC90FDAA2, 0x2168C235 */ -pi_o_2 = 1.5707963267948966192564E+00L, /* 0x3FFF, 0xC90FDAA2, 0x2168C235 */ -pi = 3.14159265358979323851281E+00L, /* 0x4000, 0xC90FDAA2, 0x2168C235 */ -pi_lo = -5.01655761266833202345176e-20L;/* 0xBFBE, 0xECE675D1, 0xFC8F8CBB */ - -long double -__ieee754_atan2l (long double y, long double x) -{ - long double z; - int32_t k,m,hx,hy,ix,iy; - u_int32_t sx,sy,lx,ly; - - GET_LDOUBLE_WORDS(sx,hx,lx,x); - ix = sx&0x7fff; - lx |= hx & 0x7fffffff; - GET_LDOUBLE_WORDS(sy,hy,ly,y); - iy = sy&0x7fff; - ly |= hy & 0x7fffffff; - if(((2*ix|((lx|-lx)>>31))>0xfffe)|| - ((2*iy|((ly|-ly)>>31))>0xfffe)) /* x or y is NaN */ - return x+y; - if(((sx-0x3fff)|lx)==0) return __atanl(y); /* x=1.0 */ - m = ((sy>>15)&1)|((sx>>14)&2); /* 2*sign(x)+sign(y) */ - - /* when y = 0 */ - if((iy|ly)==0) { - switch(m) { - case 0: - case 1: return y; /* atan(+-0,+anything)=+-0 */ - case 2: return pi+tiny;/* atan(+0,-anything) = pi */ - case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */ - } - } - /* when x = 0 */ - if((ix|lx)==0) return (sy>=0x8000)? -pi_o_2-tiny: pi_o_2+tiny; - - /* when x is INF */ - if(ix==0x7fff) { - if(iy==0x7fff) { - switch(m) { - case 0: return pi_o_4+tiny;/* atan(+INF,+INF) */ - case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */ - case 2: return 3.0*pi_o_4+tiny;/*atan(+INF,-INF)*/ - case 3: return -3.0*pi_o_4-tiny;/*atan(-INF,-INF)*/ - } - } else { - switch(m) { - case 0: return zero ; /* atan(+...,+INF) */ - case 1: return -zero ; /* atan(-...,+INF) */ - case 2: return pi+tiny ; /* atan(+...,-INF) */ - case 3: return -pi-tiny ; /* atan(-...,-INF) */ - } - } - } - /* when y is INF */ - if(iy==0x7fff) return (sy>=0x8000)? -pi_o_2-tiny: pi_o_2+tiny; - - /* compute y/x */ - k = sy-sx; - if(k > 70) z=pi_o_2+0.5*pi_lo; /* |y/x| > 2**70 */ - else if(sx>=0x8000&&k<-70) z=0.0; /* |y|/x < -2**70 */ - else z=__atanl(fabsl(y/x)); /* safe to do y/x */ - switch (m) { - case 0: return z ; /* atan(+,+) */ - case 1: { - u_int32_t sz; - GET_LDOUBLE_EXP(sz,z); - SET_LDOUBLE_EXP(z,sz ^ 0x8000); - } - return z ; /* atan(-,+) */ - case 2: return pi-(z-pi_lo);/* atan(+,-) */ - default: /* case 3 */ - return (z-pi_lo)-pi;/* atan(-,-) */ - } -} -strong_alias (__ieee754_atan2l, __atan2l_finite) diff --git a/sysdeps/ieee754/ldbl-96/e_ilogbl.c b/sysdeps/ieee754/ldbl-96/e_ilogbl.c deleted file mode 100644 index 0c7d9d5440..0000000000 --- a/sysdeps/ieee754/ldbl-96/e_ilogbl.c +++ /dev/null @@ -1,59 +0,0 @@ -/* s_ilogbl.c -- long double version of s_ilogb.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: $"; -#endif - -/* ilogbl(long double x) - * return the binary exponent of non-zero x - * ilogbl(0) = FP_ILOGB0 - * ilogbl(NaN) = FP_ILOGBNAN (no signal is raised) - * ilogbl(+-Inf) = INT_MAX (no signal is raised) - */ - -#include -#include -#include - -int __ieee754_ilogbl (long double x) -{ - int32_t es,hx,lx,ix; - - GET_LDOUBLE_EXP(es,x); - es &= 0x7fff; - if(es==0) { - GET_LDOUBLE_WORDS(es,hx,lx,x); - if((hx|lx)==0) - return FP_ILOGB0; /* ilogbl(0) = FP_ILOGB0 */ - else /* subnormal x */ - if(hx==0) { - for (ix = -16415; lx>0; lx<<=1) ix -=1; - } else { - for (ix = -16383; hx>0; hx<<=1) ix -=1; - } - return ix; - } - else if (es<0x7fff) return es-0x3fff; - else if (FP_ILOGBNAN != INT_MAX) - { - GET_LDOUBLE_WORDS(es,hx,lx,x); - if (((hx & 0x7fffffff)|lx) == 0) - /* ISO C99 requires ilogbl(+-Inf) == INT_MAX. */ - return INT_MAX; - } - return FP_ILOGBNAN; -} diff --git a/sysdeps/ieee754/ldbl-96/e_remainderl.c b/sysdeps/ieee754/ldbl-96/e_remainderl.c deleted file mode 100644 index 290e483ae5..0000000000 --- a/sysdeps/ieee754/ldbl-96/e_remainderl.c +++ /dev/null @@ -1,72 +0,0 @@ -/* e_remainderl.c -- long double version of e_remainder.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* __ieee754_remainderl(x,p) - * Return : - * returns x REM p = x - [x/p]*p as if in infinite - * precise arithmetic, where [x/p] is the (infinite bit) - * integer nearest x/p (in half way case choose the even one). - * Method : - * Based on fmod() return x-[x/p]chopped*p exactlp. - */ - -#include -#include - -static const long double zero = 0.0; - - -long double -__ieee754_remainderl(long double x, long double p) -{ - u_int32_t sx,sex,sep,x0,x1,p0,p1; - long double p_half; - - GET_LDOUBLE_WORDS(sex,x0,x1,x); - GET_LDOUBLE_WORDS(sep,p0,p1,p); - sx = sex&0x8000; - sep &= 0x7fff; - sex &= 0x7fff; - - /* purge off exception values */ - if((sep|p0|p1)==0) return (x*p)/(x*p); /* p = 0 */ - if((sex==0x7fff)|| /* x not finite */ - ((sep==0x7fff)&& /* p is NaN */ - ((p0|p1)!=0))) - return (x*p)/(x*p); - - - if (sep<0x7ffe) x = __ieee754_fmodl(x,p+p); /* now x < 2p */ - if (((sex-sep)|(x0-p0)|(x1-p1))==0) return zero*x; - x = fabsl(x); - p = fabsl(p); - if (sep<0x0002) { - if(x+x>p) { - x-=p; - if(x+x>=p) x -= p; - } - } else { - p_half = 0.5*p; - if(x>p_half) { - x-=p; - if(x>=p_half) x -= p; - } - } - GET_LDOUBLE_EXP(sex,x); - SET_LDOUBLE_EXP(x,sex^sx); - return x; -} -strong_alias (__ieee754_remainderl, __remainderl_finite) diff --git a/sysdeps/ieee754/ldbl-96/s_ceill.c b/sysdeps/ieee754/ldbl-96/s_ceill.c deleted file mode 100644 index aef8a32f63..0000000000 --- a/sysdeps/ieee754/ldbl-96/s_ceill.c +++ /dev/null @@ -1,85 +0,0 @@ -/* s_ceill.c -- long double version of s_ceil.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: $"; -#endif - -/* - * ceill(x) - * Return x rounded toward -inf to integral value - * Method: - * Bit twiddling. - * Exception: - * Inexact flag raised if x not equal to ceil(x). - */ - -#include -#include - -static const long double huge = 1.0e4930; - -long double __ceill(long double x) -{ - int32_t i1,j0; - u_int32_t i,j,se,i0,sx; - GET_LDOUBLE_WORDS(se,i0,i1,x); - sx = (se>>15)&1; - j0 = (se&0x7fff)-0x3fff; - if(j0<31) { - if(j0<0) { /* raise inexact if x != 0 */ - if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */ - if(sx) {se=0x8000;i0=0;i1=0;} - else if((i0|i1)!=0) { se=0x3fff;i0=0;i1=0;} - } - } else { - i = (0x7fffffff)>>j0; - if(((i0&i)|i1)==0) return x; /* x is integral */ - if(huge+x>0.0) { /* raise inexact flag */ - if(sx==0) { - if (j0>0 && (i0+(0x80000000>>j0))>i0) - i0+=0x80000000>>j0; - else - { - i = 0x7fffffff; - ++se; - } - } - i0 &= (~i); i1=0; - } - } - } else if (j0>62) { - if(j0==0x4000) return x+x; /* inf or NaN */ - else return x; /* x is integral */ - } else { - i = ((u_int32_t)(0xffffffff))>>(j0-31); - if((i1&i)==0) return x; /* x is integral */ - if(huge+x>0.0) { /* raise inexact flag */ - if(sx==0) { - if(j0==31) i0+=1; - else { - j = i1 + (1<<(63-j0)); - if(j -#include - -long double __fabsl(long double x) -{ - u_int32_t exp; - GET_LDOUBLE_EXP(exp,x); - SET_LDOUBLE_EXP(x,exp&0x7fff); - return x; -} -weak_alias (__fabsl, fabsl) diff --git a/sysdeps/ieee754/ldbl-96/s_finitel.c b/sysdeps/ieee754/ldbl-96/s_finitel.c deleted file mode 100644 index fbf4cc691c..0000000000 --- a/sysdeps/ieee754/ldbl-96/s_finitel.c +++ /dev/null @@ -1,36 +0,0 @@ -/* s_finitel.c -- long double version of s_finite.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: $"; -#endif - -/* - * finitel(x) returns 1 is x is finite, else 0; - * no branching! - */ - -#include -#include - -int __finitel(long double x) -{ - int32_t exp; - GET_LDOUBLE_EXP(exp,x); - return (int)((u_int32_t)((exp&0x7fff)-0x7fff)>>31); -} -hidden_def (__finitel) -weak_alias (__finitel, finitel) diff --git a/sysdeps/ieee754/ldbl-96/s_floorl.c b/sysdeps/ieee754/ldbl-96/s_floorl.c deleted file mode 100644 index cad7935b33..0000000000 --- a/sysdeps/ieee754/ldbl-96/s_floorl.c +++ /dev/null @@ -1,86 +0,0 @@ -/* s_floorl.c -- long double version of s_floor.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: $"; -#endif - -/* - * floorl(x) - * Return x rounded toward -inf to integral value - * Method: - * Bit twiddling. - * Exception: - * Inexact flag raised if x not equal to floor(x). - */ - -#include -#include - -static const long double huge = 1.0e4930; - -long double __floorl(long double x) -{ - int32_t i1,j0; - u_int32_t i,j,se,i0,sx; - GET_LDOUBLE_WORDS(se,i0,i1,x); - sx = (se>>15)&1; - j0 = (se&0x7fff)-0x3fff; - if(j0<31) { - if(j0<0) { /* raise inexact if x != 0 */ - if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */ - if(sx==0) {se=0;i0=i1=0;} - else if(((se&0x7fff)|i0|i1)!=0) - { se=0xbfff;i0=i1=0;} - } - } else { - i = (0x7fffffff)>>j0; - if(((i0&i)|i1)==0) return x; /* x is integral */ - if(huge+x>0.0) { /* raise inexact flag */ - if(sx) { - if (j0>0 && (i0+(0x80000000>>j0))>i0) - i0 += (0x80000000)>>j0; - else - { - i = 0x7fffffff; - ++se; - } - } - i0 &= (~i); i1=0; - } - } - } else if (j0>62) { - if(j0==0x4000) return x+x; /* inf or NaN */ - else return x; /* x is integral */ - } else { - i = ((u_int32_t)(0xffffffff))>>(j0-31); - if((i1&i)==0) return x; /* x is integral */ - if(huge+x>0.0) { /* raise inexact flag */ - if(sx) { - if(j0==31) i0+=1; - else { - j = i1+(1<<(63-j0)); - if(j, 1997. - Fixed by Andreas Schwab . - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include - -#include - - -int -__fpclassifyl (long double x) -{ - u_int32_t ex, hx, lx, m; - int retval = FP_NORMAL; - - GET_LDOUBLE_WORDS (ex, hx, lx, x); - m = (hx & 0x7fffffff) | lx; - ex &= 0x7fff; - if ((ex | m) == 0) - retval = FP_ZERO; - else if (ex == 0 && (hx & 0x80000000) == 0) - retval = FP_SUBNORMAL; - else if (ex == 0x7fff) - retval = m != 0 ? FP_NAN : FP_INFINITE; - - return retval; -} -libm_hidden_def (__fpclassifyl) diff --git a/sysdeps/ieee754/ldbl-96/s_isinfl.c b/sysdeps/ieee754/ldbl-96/s_isinfl.c deleted file mode 100644 index 94639f00f8..0000000000 --- a/sysdeps/ieee754/ldbl-96/s_isinfl.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Written by J.T. Conklin . - * Change for long double by Ulrich Drepper . - * Public domain. - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: $"; -#endif - -/* - * isinfl(x) returns 1 if x is inf, -1 if x is -inf, else 0; - * no branching! - */ - -#include -#include - -int -__isinfl (long double x) -{ - int32_t se,hx,lx; - GET_LDOUBLE_WORDS(se,hx,lx,x); - lx |= (hx & 0x7fffffff) | ((se & 0x7fff) ^ 0x7fff); - lx |= -lx; - se &= 0x8000; - return ~(lx >> 31) & (1 - (se >> 14)); -} -hidden_def (__isinfl) -weak_alias (__isinfl, isinfl) diff --git a/sysdeps/ieee754/ldbl-96/s_isnanl.c b/sysdeps/ieee754/ldbl-96/s_isnanl.c deleted file mode 100644 index fd270fd849..0000000000 --- a/sysdeps/ieee754/ldbl-96/s_isnanl.c +++ /dev/null @@ -1,40 +0,0 @@ -/* s_isnanl.c -- long double version of s_isnan.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: $"; -#endif - -/* - * isnanl(x) returns 1 is x is nan, else 0; - * no branching! - */ - -#include -#include - -int __isnanl(long double x) -{ - int32_t se,hx,lx; - GET_LDOUBLE_WORDS(se,hx,lx,x); - se = (se & 0x7fff) << 1; - lx |= hx & 0x7fffffff; - se |= (u_int32_t)(lx|(-lx))>>31; - se = 0xfffe - se; - return (int)(((u_int32_t)(se))>>31); -} -hidden_def (__isnanl) -weak_alias (__isnanl, isnanl) diff --git a/sysdeps/ieee754/ldbl-96/s_logbl.c b/sysdeps/ieee754/ldbl-96/s_logbl.c deleted file mode 100644 index 4289be1933..0000000000 --- a/sysdeps/ieee754/ldbl-96/s_logbl.c +++ /dev/null @@ -1,51 +0,0 @@ -/* s_logbl.c -- long double version of s_logb.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * long double logbl(x) - * IEEE 754 logb. Included to pass IEEE test suite. Not recommend. - * Use ilogb instead. - */ - -#include -#include - -long double -__logbl (long double x) -{ - int32_t es, lx, ix; - - GET_LDOUBLE_WORDS (es, ix, lx, x); - es &= 0x7fff; /* exponent */ - if ((es | ix | lx) == 0) - return -1.0 / fabs (x); - if (es == 0x7fff) - return x * x; - if (es == 0) /* IEEE 754 logb */ - { - /* POSIX specifies that denormal number is treated as - though it were normalized. */ - int ma; - if (ix == 0) - ma = __builtin_clz (lx) + 32; - else - ma = __builtin_clz (ix); - es -= ma - 1; - } - return (long double) (es - 16383); -} - -weak_alias (__logbl, logbl) diff --git a/sysdeps/ieee754/ldbl-96/s_nearbyintl.c b/sysdeps/ieee754/ldbl-96/s_nearbyintl.c deleted file mode 100644 index c1d77f0c02..0000000000 --- a/sysdeps/ieee754/ldbl-96/s_nearbyintl.c +++ /dev/null @@ -1,88 +0,0 @@ -/* s_rintl.c -- long double version of s_rint.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ -/* Adapted for use as nearbyint by Ulrich Drepper . */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * rintl(x) - * Return x rounded to integral value according to the prevailing - * rounding mode. - * Method: - * Using floating addition. - * Exception: - * Inexact flag raised if x not equal to rintl(x). - */ - -#include -#include -#include - -static const long double -TWO63[2]={ - 9.223372036854775808000000e+18, /* 0x403E, 0x00000000, 0x00000000 */ - -9.223372036854775808000000e+18 /* 0xC03E, 0x00000000, 0x00000000 */ -}; - -long double __nearbyintl(long double x) -{ - fenv_t env; - int32_t se,j0,sx; - u_int32_t i,i0,i1; - long double w,t; - GET_LDOUBLE_WORDS(se,i0,i1,x); - sx = (se>>15)&1; - j0 = (se&0x7fff)-0x3fff; - if(j0<31) { - if(j0<0) { - if(((se&0x7fff)|i0|i1)==0) return x; - i1 |= i0; - i0 &= 0xe0000000; - i0 |= (i1|-i1)&0x80000000; - SET_LDOUBLE_MSW(x,i0); - feholdexcept (&env); - w = TWO63[sx]+x; - t = w-TWO63[sx]; - math_force_eval (t); - fesetenv (&env); - GET_LDOUBLE_EXP(i0,t); - SET_LDOUBLE_EXP(t,(i0&0x7fff)|(sx<<15)); - return t; - } else { - i = (0x7fffffff)>>j0; - if(((i0&i)|i1)==0) return x; /* x is integral */ - i>>=1; - if(((i0&i)|i1)!=0) { - if (j0==30) i1 = 0x40000000; else - i0 = (i0&(~i))|((0x20000000)>>j0); - } - } - } else if (j0>62) { - if(j0==0x4000) return x+x; /* inf or NaN */ - else return x; /* x is integral */ - } else { - i = ((u_int32_t)(0xffffffff))>>(j0-31); - if((i1&i)==0) return x; /* x is integral */ - i>>=1; - if((i1&i)!=0) i1 = (i1&(~i))|((0x40000000)>>(j0-31)); - } - SET_LDOUBLE_WORDS(x,se,i0,i1); - feholdexcept (&env); - w = TWO63[sx]+x; - t = w-TWO63[sx]; - math_force_eval (t); - fesetenv (&env); - return t; -} -weak_alias (__nearbyintl, nearbyintl) diff --git a/sysdeps/ieee754/ldbl-96/s_nextafterl.c b/sysdeps/ieee754/ldbl-96/s_nextafterl.c deleted file mode 100644 index 6859349b7c..0000000000 --- a/sysdeps/ieee754/ldbl-96/s_nextafterl.c +++ /dev/null @@ -1,96 +0,0 @@ -/* s_nextafterl.c -- long double version of s_nextafter.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: $"; -#endif - -/* IEEE functions - * nextafterl(x,y) - * return the next machine floating-point number of x in the - * direction toward y. - * Special cases: - */ - -#include -#include - -long double __nextafterl(long double x, long double y) -{ - int32_t hx,hy,ix,iy; - u_int32_t lx,ly,esx,esy; - - GET_LDOUBLE_WORDS(esx,hx,lx,x); - GET_LDOUBLE_WORDS(esy,hy,ly,y); - ix = esx&0x7fff; /* |x| */ - iy = esy&0x7fff; /* |y| */ - - if (((ix==0x7fff)&&((hx|lx)!=0)) || /* x is nan */ - ((iy==0x7fff)&&((hy|ly)!=0))) /* y is nan */ - return x+y; - if(x==y) return y; /* x=y, return y */ - if((ix|hx|lx)==0) { /* x == 0 */ - long double u; - SET_LDOUBLE_WORDS(x,esy&0x8000,0,1);/* return +-minsubnormal */ - u = math_opt_barrier (x); - u = u * u; - math_force_eval (u); /* raise underflow flag */ - return x; - } - if(esx<0x8000) { /* x > 0 */ - if(ix>iy||((ix==iy) && (hx>hy||((hx==hy)&&(lx>ly))))) { - /* x > y, x -= ulp */ - if(lx==0) { - if (hx==0) esx -= 1; - hx -= 1; - } - lx -= 1; - } else { /* x < y, x += ulp */ - lx += 1; - if(lx==0) { - hx += 1; - if (hx==0) - esx += 1; - } - } - } else { /* x < 0 */ - if(esy>=0||(ix>iy||((ix==iy)&&(hx>hy||((hx==hy)&&(lx>ly)))))){ - /* x < y, x -= ulp */ - if(lx==0) { - if (hx==0) esx -= 1; - hx -= 1; - } - lx -= 1; - } else { /* x > y, x += ulp */ - lx += 1; - if(lx==0) { - hx += 1; - if (hx==0) esx += 1; - } - } - } - esy = esx&0x7fff; - if(esy==0x7fff) return x+x; /* overflow */ - if(esy==0) { - long double u = x*x; /* underflow */ - math_force_eval (u); /* raise underflow flag */ - } - SET_LDOUBLE_WORDS(x,esx,hx,lx); - return x; -} -weak_alias (__nextafterl, nextafterl) -strong_alias (__nextafterl, __nexttowardl) -weak_alias (__nextafterl, nexttowardl) diff --git a/sysdeps/ieee754/ldbl-96/s_rintl.c b/sysdeps/ieee754/ldbl-96/s_rintl.c deleted file mode 100644 index b6f899d4ef..0000000000 --- a/sysdeps/ieee754/ldbl-96/s_rintl.c +++ /dev/null @@ -1,82 +0,0 @@ -/* s_rintl.c -- long double version of s_rint.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: $"; -#endif - -/* - * rintl(x) - * Return x rounded to integral value according to the prevailing - * rounding mode. - * Method: - * Using floating addition. - * Exception: - * Inexact flag raised if x not equal to rintl(x). - */ - -#include -#include - -static const long double -TWO63[2]={ - 9.223372036854775808000000e+18, /* 0x403E, 0x00000000, 0x00000000 */ - -9.223372036854775808000000e+18 /* 0xC03E, 0x00000000, 0x00000000 */ -}; - -long double __rintl(long double x) -{ - int32_t se,j0,sx; - u_int32_t i,i0,i1; - long double w,t; - GET_LDOUBLE_WORDS(se,i0,i1,x); - sx = (se>>15)&1; - j0 = (se&0x7fff)-0x3fff; - if(j0<31) { - if(j0<0) { - if(((se&0x7fff)|i0|i1)==0) return x; - i1 |= i0; - i0 &= 0xe0000000; - i0 |= (i1|-i1)&0x80000000; - SET_LDOUBLE_MSW(x,i0); - w = TWO63[sx]+x; - t = w-TWO63[sx]; - GET_LDOUBLE_EXP(i0,t); - SET_LDOUBLE_EXP(t,(i0&0x7fff)|(sx<<15)); - return t; - } else { - i = (0x7fffffff)>>j0; - if(((i0&i)|i1)==0) return x; /* x is integral */ - i>>=1; - if(((i0&i)|i1)!=0) { - if(j0==30) i1 = 0x40000000; else - i0 = (i0&(~i))|((0x20000000)>>j0); - } - } - } else if (j0>62) { - if(j0==0x4000) return x+x; /* inf or NaN */ - else return x; /* x is integral */ - } else { - i = ((u_int32_t)(0xffffffff))>>(j0-31); - if((i1&i)==0) return x; /* x is integral */ - i>>=1; - if((i1&i)!=0) i1 = (i1&(~i))|((0x40000000)>>(j0-31)); - } - SET_LDOUBLE_WORDS(x,se,i0,i1); - w = TWO63[sx]+x; - return w-TWO63[sx]; -} -weak_alias (__rintl, rintl) diff --git a/sysdeps/ieee754/ldbl-96/s_scalbnl.c b/sysdeps/ieee754/ldbl-96/s_scalbnl.c deleted file mode 100644 index 266a37b9c0..0000000000 --- a/sysdeps/ieee754/ldbl-96/s_scalbnl.c +++ /dev/null @@ -1,61 +0,0 @@ -/* s_scalbnl.c -- long double version of s_scalbn.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * scalbnl (long double x, int n) - * scalbnl(x,n) returns x* 2**n computed by exponent - * manipulation rather than by actually performing an - * exponentiation or a multiplication. - */ - -#include -#include - -static const long double -two64 = 1.8446744073709551616e19L, -twom64 = 5.421010862427522170037e-20L, -huge = 1.0e+4900L, -tiny = 1.0e-4900L; - -long double -__scalbnl (long double x, int n) -{ - int32_t k,es,hx,lx; - GET_LDOUBLE_WORDS(es,hx,lx,x); - k = es&0x7fff; /* extract exponent */ - if (__builtin_expect(k==0, 0)) { /* 0 or subnormal x */ - if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */ - x *= two64; - GET_LDOUBLE_EXP(hx,x); - k = (hx&0x7fff) - 64; - } - if (__builtin_expect(k==0x7fff, 0)) return x+x; /* NaN or Inf */ - if (__builtin_expect(n< -50000, 0)) - return tiny*__copysignl(tiny,x); - if (__builtin_expect(n> 50000 || k+n > 0x7ffe, 0)) - return huge*__copysignl(huge,x); /* overflow */ - /* Now k and n are bounded we know that k = k+n does not - overflow. */ - k = k+n; - if (__builtin_expect(k > 0, 1)) /* normal result */ - {SET_LDOUBLE_EXP(x,(es&0x8000)|k); return x;} - if (k <= -64) - return tiny*__copysignl(tiny,x); /*underflow*/ - k += 64; /* subnormal result */ - SET_LDOUBLE_EXP(x,(es&0x8000)|k); - return x*twom64; -} -weak_alias (__scalbnl, scalbnl) diff --git a/sysdeps/ieee754/ldbl-96/s_truncl.c b/sysdeps/ieee754/ldbl-96/s_truncl.c deleted file mode 100644 index cc58fb0b77..0000000000 --- a/sysdeps/ieee754/ldbl-96/s_truncl.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Truncate argument to nearest integral value not larger than the argument. - Copyright (C) 1997-2013 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include - -#include - - -long double -__truncl (long double x) -{ - int32_t i0, j0; - u_int32_t se, i1; - int sx; - - GET_LDOUBLE_WORDS (se, i0, i1, x); - sx = se & 0x8000; - j0 = (se & 0x7fff) - 0x3fff; - if (j0 < 31) - { - if (j0 < 0) - /* The magnitude of the number is < 1 so the result is +-0. */ - SET_LDOUBLE_WORDS (x, sx, 0, 0); - else - SET_LDOUBLE_WORDS (x, se, i0 & ~(0x7fffffff >> j0), 0); - } - else if (j0 > 63) - { - if (j0 == 0x4000) - /* x is inf or NaN. */ - return x + x; - } - else - { - SET_LDOUBLE_WORDS (x, se, i0, i1 & ~(0xffffffffu >> (j0 - 31))); - } - - return x; -} -weak_alias (__truncl, truncl) -- cgit 1.4.1