mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-26 23:10:06 +00:00
86f9568af6
This patch makes ldbl-96 functions use libm_alias_ldouble to define function aliases. Tested for x86_64, and tested with build-many-glibcs.py that installed stripped shared libraries are unchanged by the patch. * sysdeps/ieee754/ldbl-96/s_asinhl.c: Include <libm-alias-ldouble.h>. (asinhl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_cbrtl.c: Include <libm-alias-ldouble.h>. (cbrtl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_copysignl.c: Include <libm-alias-ldouble.h>. (copysignl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_cosl.c: Include <libm-alias-ldouble.h>. (cosl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_erfl.c: Include <libm-alias-ldouble.h>. (erfl): Define using libm_alias_ldouble. (erfcl): Likewise. * sysdeps/ieee754/ldbl-96/s_fmal.c: Include <libm-alias-ldouble.h>. (fmal): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_frexpl.c: Include <libm-alias-ldouble.h>. (frexpl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_fromfpl.c (fromfpl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_fromfpl_main.c: Include <libm-alias-ldouble.h>. * sysdeps/ieee754/ldbl-96/s_fromfpxl.c (fromfpxl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_getpayloadl.c: Include <libm-alias-ldouble.h>. (getpayloadl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_llrintl.c: Include <libm-alias-ldouble.h>. (llrintl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_llroundl.c: Include <libm-alias-ldouble.h>. (llroundl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_lrintl.c: Include <libm-alias-ldouble.h>. (lrintl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_lroundl.c: Include <libm-alias-ldouble.h>. (lroundl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_modfl.c: Include <libm-alias-ldouble.h>. (modfl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_nextupl.c: Include <libm-alias-ldouble.h>. (nextupl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_remquol.c: Include <libm-alias-ldouble.h>. (remquol): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_roundevenl.c: Include <libm-alias-ldouble.h>. (roundevenl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_roundl.c: Include <libm-alias-ldouble.h>. (roundl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_setpayloadl.c (setpayloadl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_setpayloadl_main.c: Include <libm-alias-ldouble.h>. * sysdeps/ieee754/ldbl-96/s_setpayloadsigl.c: Include <libm-alias-ldouble.h>. (setpayloadsigl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_sincosl.c: Include <libm-alias-ldouble.h>. (sincosl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_sinl.c: Include <libm-alias-ldouble.h>. (sinl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_tanhl.c: Include <libm-alias-ldouble.h>. (tanhl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_tanl.c: Include <libm-alias-ldouble.h>. (tanl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_totalorderl.c: Include <libm-alias-ldouble.h>. (totalorderl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_totalordermagl.c: Include <libm-alias-ldouble.h>. (totalordermagl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_ufromfpl.c (ufromfpl): Define using libm_alias_ldouble. * sysdeps/ieee754/ldbl-96/s_ufromfpxl.c (ufromfpxl): Define using libm_alias_ldouble.
75 lines
2.0 KiB
C
75 lines
2.0 KiB
C
/* s_modfl.c -- long double version of s_modf.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.
|
|
* ====================================================
|
|
*/
|
|
|
|
/*
|
|
* modfl(long double x, long double *iptr)
|
|
* return fraction part of x, and return x's integral part in *iptr.
|
|
* Method:
|
|
* Bit twiddling.
|
|
*
|
|
* Exception:
|
|
* No exception.
|
|
*/
|
|
|
|
#include <math.h>
|
|
#include <math_private.h>
|
|
#include <libm-alias-ldouble.h>
|
|
|
|
static const long double one = 1.0;
|
|
|
|
long double
|
|
__modfl(long double x, long double *iptr)
|
|
{
|
|
int32_t i0,i1,j0;
|
|
uint32_t i,se;
|
|
GET_LDOUBLE_WORDS(se,i0,i1,x);
|
|
j0 = (se&0x7fff)-0x3fff; /* exponent of x */
|
|
if(j0<32) { /* integer part in high x */
|
|
if(j0<0) { /* |x|<1 */
|
|
SET_LDOUBLE_WORDS(*iptr,se&0x8000,0,0); /* *iptr = +-0 */
|
|
return x;
|
|
} else {
|
|
i = (0x7fffffff)>>j0;
|
|
if(((i0&i)|i1)==0) { /* x is integral */
|
|
*iptr = x;
|
|
SET_LDOUBLE_WORDS(x,se&0x8000,0,0); /* return +-0 */
|
|
return x;
|
|
} else {
|
|
SET_LDOUBLE_WORDS(*iptr,se,i0&(~i),0);
|
|
return x - *iptr;
|
|
}
|
|
}
|
|
} else if (__builtin_expect(j0>63, 0)) { /* no fraction part */
|
|
*iptr = x*one;
|
|
/* We must handle NaNs separately. */
|
|
if (j0 == 0x4000 && ((i0 & 0x7fffffff) | i1))
|
|
return x*one;
|
|
SET_LDOUBLE_WORDS(x,se&0x8000,0,0); /* return +-0 */
|
|
return x;
|
|
} else { /* fraction part in low x */
|
|
i = ((uint32_t)(0x7fffffff))>>(j0-32);
|
|
if((i1&i)==0) { /* x is integral */
|
|
*iptr = x;
|
|
SET_LDOUBLE_WORDS(x,se&0x8000,0,0); /* return +-0 */
|
|
return x;
|
|
} else {
|
|
SET_LDOUBLE_WORDS(*iptr,se,i0,i1&(~i));
|
|
return x - *iptr;
|
|
}
|
|
}
|
|
}
|
|
libm_alias_ldouble (__modf, modf)
|