glibc/math/Versions
Joseph Myers ec94343f59 Add femode_t functions.
TS 18661-1 defines a type femode_t to represent the set of dynamic
floating-point control modes (such as the rounding mode and trap
enablement modes), and functions fegetmode and fesetmode to manipulate
those modes (without affecting other state such as the raised
exception flags) and a corresponding macro FE_DFL_MODE.

This patch series implements those interfaces for glibc.  This first
patch adds the architecture-independent pieces, the x86 and x86_64
implementations, and the <bits/fenv.h> and ABI baseline updates for
all architectures so glibc keeps building and passing the ABI tests on
all architectures.  Subsequent patches add the fegetmode and fesetmode
implementations for other architectures.

femode_t is generally an integer type - the same type as fenv_t, or as
the single element of fenv_t where fenv_t is a structure containing a
single integer (or the single relevant element, where it has elements
for both status and control registers) - except where architecture
properties or consistency with the fenv_t implementation indicate
otherwise.  FE_DFL_MODE follows FE_DFL_ENV in whether it's a magic
pointer value (-1 cast to const femode_t *), a value that can be
distinguished from valid pointers by its high bits but otherwise
contains a representation of the desired register contents, or a
pointer to a constant variable (the powerpc case; __fe_dfl_mode is
added as an exported constant object, an alias to __fe_dfl_env).

Note that where architectures (that share a register between control
and status bits) gain definitions of new floating-point control or
status bits in future, the implementations of fesetmode for those
architectures may need updating (depending on whether the new bits are
control or status bits and what the implementation does with
previously unknown bits), just like existing implementations of
<fenv.h> functions that take care not to touch reserved bits may need
updating when the set of reserved bits changes.  (As any new bits are
outside the scope of ISO C, that's just a quality-of-implementation
issue for supporting them, not a conformance issue.)

As with fenv_t, femode_t should properly include any software DFP
rounding mode (and for both fenv_t and femode_t I'd consider that
fragment of DFP support appropriate for inclusion in glibc even in the
absence of the rest of libdfp; hardware DFP rounding modes should
already be included if the definitions of which bits are status /
control bits are correct).

Tested for x86_64, x86, mips64 (hard float, and soft float to test the
fallback version), arm (hard float) and powerpc (hard float, soft
float and e500).  Other architecture versions are untested.

	* math/fegetmode.c: New file.
	* math/fesetmode.c: Likewise.
	* sysdeps/i386/fpu/fegetmode.c: Likewise.
	* sysdeps/i386/fpu/fesetmode.c: Likewise.
	* sysdeps/x86_64/fpu/fegetmode.c: Likewise.
	* sysdeps/x86_64/fpu/fesetmode.c: Likewise.
	* math/fenv.h: Update comment on inclusion of <bits/fenv.h>.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (fegetmode): New function
	declaration.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (fesetmode): Likewise.
	* bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (femode_t): New
	typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/aarch64/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/alpha/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/arm/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/hppa/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/ia64/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/m68k/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/microblaze/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/mips/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/nios2/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/powerpc/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (__fe_dfl_mode): New variable
	declaration.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/s390/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/sh/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/sparc/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/tile/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* sysdeps/x86/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(femode_t): New typedef.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
	* manual/arith.texi (FE_DFL_MODE): Document macro.
	(fegetmode): Document function.
	(fesetmode): Likewise.
	* math/Versions (fegetmode): New libm symbol at version
	GLIBC_2.25.
	(fesetmode): Likewise.
	* math/Makefile (libm-support): Add fegetmode and fesetmode.
	(tests): Add test-femode and test-femode-traps.
	* math/test-femode-traps.c: New file.
	* math/test-femode.c: Likewise.
	* sysdeps/powerpc/fpu/fenv_const.c (__fe_dfl_mode): Declare as
	alias for __fe_dfl_env.
	* sysdeps/powerpc/nofpu/fenv_const.c (__fe_dfl_mode): Likewise.
	* sysdeps/powerpc/powerpc32/e500/nofpu/fenv_const.c
	(__fe_dfl_mode): Likewise.
	* sysdeps/powerpc/Versions (__fe_dfl_mode): New libm symbol at
	version GLIBC_2.25.
	* sysdeps/nacl/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2016-09-07 16:40:09 +00:00

221 lines
6.2 KiB
Plaintext

libc {
GLIBC_2.0 {
# functions used in inline functions or macros
__isnan; __isnanf; __isnanl; __finite; __finitef; __finitel;
__isinf; __isinff; __isinfl;
# global variables
__fpu_control;
# c*
copysign; copysignf; copysignl;
# f*
finite; finitef; finitel; frexp; frexpf; frexpl;
# i*
isinf; isinff; isinfl; isnan; isnanf; isnanl; ldexp; ldexpf; ldexpl;
# m*
modf; modff; modfl;
# s*
scalbn; scalbnf; scalbnl;
}
GLIBC_2.1 {
# functions used in inline functions or macros
__signbit; __signbitf; __signbitl;
# s*
scalbln; scalblnf; scalblnl;
}
GLIBC_2.20 {
}
}
libm {
GLIBC_2.0 {
# mathematical functions
acos; acosf; acosl;
acosh; acoshf; acoshl;
asin; asinf; asinl;
asinh; asinhf; asinhl;
atan2; atan2f; atan2l;
atan; atanf; atanl;
atanh; atanhf; atanhl;
cbrt; cbrtf; cbrtl;
ceil; ceilf; ceill;
copysign; copysignf; copysignl;
cos; cosf; cosl;
coshf; cosh; coshl;
drem; dremf; dreml;
erf; erff; erfl;
erfc; erfcf; erfcl;
exp; expf; expl;
expm1; expm1f; expm1l;
fabs; fabsf; fabsl;
finite; finitef; finitel;
floor; floorf; floorl;
fmod; fmodf; fmodl;
frexp; frexpf; frexpl;
gamma; gammaf; gammal;
gamma_r; gammaf_r; gammal_r;
hypot; hypotf; hypotl;
ilogb; ilogbf; ilogbl;
j0; j0f; j0l;
j1; j1f; j1l;
jn; jnf; jnl;
ldexp; ldexpf; ldexpl;
lgamma; lgammaf; lgammal;
lgamma_r; lgammaf_r; lgammal_r;
log10; log10f; log10l;
log1p; log1pf; log1pl;
log; logf; logl;
logb; logbf; logbl;
matherr;
modf; modff; modfl;
nextafter; nextafterf; nextafterl;
pow; powf; powl;
remainder; remainderf; remainderl;
rint; rintf; rintl;
scalb; scalbf; scalbl;
scalbn; scalbnf; scalbnl;
significand; significandf; significandl;
sin; sinf; sinl;
sinh; sinhf; sinhl;
sqrt; sqrtf; sqrtl;
tan; tanf; tanl;
tanh; tanhf; tanhl;
y0; y0f; y0l;
y1; y1f; y1l;
yn; ynf; ynl;
# global variables
_LIB_VERSION; signgam;
}
GLIBC_2.1 {
# mathematical functions
exp2; exp2f; # exp2l; -- bug omitted this until GLIBC_2.4 (below)
exp10; exp10f; exp10l;
fdim; fdimf; fdiml;
fma; fmaf; fmal;
fmax; fmaxf; fmaxl;
fmin; fminf; fminl;
log2; log2f; log2l;
nan; nanf; nanl;
nearbyint; nearbyintf; nearbyintl;
nexttoward; nexttowardf; nexttowardl;
pow10; pow10f; pow10l;
remquo; remquof; remquol;
lrint; lrintf; lrintl;
llrint; llrintf; llrintl;
round; roundf; roundl;
lround; lroundf; lroundl;
llround; llroundf; llroundl;
scalbln; scalblnf; scalblnl;
sincos; sincosf; sincosl;
trunc; truncf; truncl;
tgamma; tgammaf; tgammal;
# complex functions
cabs; cabsf; cabsl;
cacos; cacosf; cacosl;
cacosh; cacoshf; cacoshl;
carg; cargf; cargl;
casin; casinf; casinl;
casinh; casinhf; casinhl;
catan; catanf; catanl;
catanh; catanhf; catanhl;
ccos; ccosf; ccosl;
ccosh; ccoshf; ccoshl;
cexp; cexpf; cexpl;
cimag; cimagf; cimagl;
clog; clogf; clogl;
clog10; clog10f; clog10l;
__clog10; __clog10f; __clog10l;
conj; conjf; conjl;
cpow; cpowf; cpowl;
cproj; cprojf; cprojl;
creal; crealf; creall;
csin; csinf; csinl;
csinh; csinhf; csinhl;
csqrt; csqrtf; csqrtl;
ctan; ctanf; ctanl;
ctanh; ctanhf; ctanhl;
# fp environment functions
feclearexcept; fegetenv; fegetexceptflag;
fegetround; feholdexcept; feraiseexcept;
fesetenv; fesetexceptflag; fesetround;
fetestexcept; feupdateenv;
# functions used in inline functions or macros
__finite; __finitef; __finitel;
__fpclassify; __fpclassifyf; __fpclassifyl;
__signbit; __signbitf; __signbitl;
}
GLIBC_2.2 {
# fp environment functions changes from ISO C99 TR1
feclearexcept; fegetenv; fegetexceptflag; feraiseexcept;
fesetenv; fesetexceptflag; feupdateenv;
# fp environment function
feenableexcept; fedisableexcept; fegetexcept;
}
GLIBC_2.4 {
# A bug in sysdeps/generic/w_exp2.c kept this from appearing
# in GLIBC_2.1 as it should have on platforms using that
# implementation file. On others, sysdeps/CPU/Versions now
# puts exp2l in GLIBC_2.1, which will override this entry.
exp2l;
}
GLIBC_2.15 {
# Optimized -ffinite-math-only entry points
__acos_finite; __acosf_finite; __acosl_finite;
__acosh_finite; __acoshf_finite; __acoshl_finite;
__asin_finite; __asinf_finite; __asinl_finite;
__atan2_finite; __atan2f_finite; __atan2l_finite;
__atanh_finite; __atanhf_finite; __atanhl_finite;
__cosh_finite; __coshf_finite; __coshl_finite;
__exp10_finite; __exp10f_finite; __exp10l_finite;
__exp2_finite; __exp2f_finite; __exp2l_finite;
__fmod_finite; __fmodf_finite; __fmodl_finite;
__hypot_finite; __hypotf_finite; __hypotl_finite;
__j0_finite; __j0f_finite; __j0l_finite;
__y0_finite; __y0f_finite; __y0l_finite;
__j1_finite; __j1f_finite; __j1l_finite;
__y1_finite; __y1f_finite; __y1l_finite;
__jn_finite; __jnf_finite; __jnl_finite;
__yn_finite; __ynf_finite; __ynl_finite;
__lgamma_r_finite; __lgammaf_r_finite; __lgammal_r_finite;
__log_finite; __logf_finite; __logl_finite;
__log10_finite; __log10f_finite; __log10l_finite;
__log2_finite; __log2f_finite; __log2l_finite;
__pow_finite; __powf_finite; __powl_finite;
__remainder_finite; __remainderf_finite; __remainderl_finite;
__scalb_finite; __scalbf_finite; __scalbl_finite;
__sinh_finite; __sinhf_finite; __sinhl_finite;
__sqrt_finite; __sqrtf_finite; __sqrtl_finite;
__gamma_r_finite; __gammaf_r_finite; __gammal_r_finite;
__exp_finite; __expf_finite; __expl_finite;
}
GLIBC_2.18 {
__issignaling; __issignalingf; __issignalingl;
}
GLIBC_2.23 {
# The __signgam name must be exported for the signgam weak alias
# to work. New symbol versions of lgamma* that set __signgam are
# needed to preserve compatibility with old binaries that have a
# dynamic symbol for signgam but not __signgam.
lgamma; lgammaf; lgammal; __signgam;
}
GLIBC_2.24 {
nextup; nextupf; nextupl;
nextdown; nextdownf; nextdownl;
}
GLIBC_2.25 {
fesetexcept; fetestexceptflag; fegetmode; fesetmode;
}
}