Commit Graph

434 Commits

Author SHA1 Message Date
Andreas Jaeger 556a200797 Add parameter annotation to modf 2011-10-15 10:08:07 -04:00
Ulrich Drepper 0ac5ae2335 Optimize libm
libm is now somewhat integrated with gcc's -ffinite-math-only option
and lots of the wrapper functions have been optimized.
2011-10-12 11:27:51 -04:00
Ulrich Drepper 7edb55ce06 Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
Ulrich Drepper 9277c06437 Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
Andreas Jaeger bf5824458c Fix remainder (NaN, 0) 2011-10-07 15:14:06 -04:00
Petr Baudis 1248c1c415 Fix jn precision 2011-09-09 22:16:10 -04:00
Paul Pluzhnikov 7f5517aa52 Fix lround() loses precision 2011-09-08 23:37:32 -04:00
Ulrich Drepper f5f312ebe0 Fix whitespace 2011-05-18 19:52:42 -04:00
H.J. Lu 8db736347c Fix typo in x86-64 powl 2011-05-18 19:50:48 -04:00
Erich Ritz 0e012e8734 Fix typo in comment. 2010-11-01 14:50:24 -04:00
Jakub Jelinek 7c08a05c5f IEEE quad fmal fixes 2010-10-18 07:29:50 -04:00
Jakub Jelinek 3e692e0518 Implement fmal, some fma bugfixes 2010-10-15 15:26:06 -04:00
Jakub Jelinek f3f7372de1 Fix some more dbl-64/s_fma.c issue 2010-10-15 15:25:14 -04:00
Jakub Jelinek 5e908464b9 Implement accurate fma. 2010-10-13 22:27:03 -04:00
Jakub Jelinek 9ff8d36f27 Correct implementation of fmaf. 2010-10-11 09:27:05 -04:00
Ulrich Drepper a7b420eadc Fix whitespaces. 2010-04-08 16:09:15 -07:00
Ulrich Drepper 88e236a627 Fix cproj implmentation. 2010-04-08 15:32:51 -07:00
David S. Miller 2e9337f58a (INSERT_WORDS64): Fix argument order. 2010-03-03 05:58:09 -08:00
Andreas Schwab 7eb22e757e Avoid PLT call to fegetenv on s390 2010-02-09 22:34:17 -08:00
Jakub Jelinek 98363ded87 Fix range checks in coshl. 2009-10-27 13:46:08 -07:00
Joseph Myers e9f145cba8 Fix generic fdiml. 2009-08-25 15:48:06 -07:00
Ulrich Drepper cf00cc00bc Add ceil implementation for 64-bit machines.
On 64-bit machines we should not split doubles into two 32 bit
integer and handle the words separately.  We have wide registers.
This patch implements a 64-bit ceil version.  Ideally all other
functions will be converted over time.
2009-08-24 18:05:48 -07:00
Ulrich Drepper f0c281e072 Fix overflow handling in fdim. 2009-08-24 12:06:55 -07:00
Ulrich Drepper 7b943af6cf Define math_errhandling is possible. 2009-08-24 10:33:57 -07:00
Ulrich Drepper 78c4ef475d Add support for x86-64 fma instruction.
Use it to implement fma and fmaf, if possible.
2009-07-29 15:26:06 -07:00
Andreas Schwab ff6ff38db2 Remove redundant .gitignore files. 2009-05-16 10:18:34 +02:00
Ulrich Drepper bbc5d74dd0 Add test for range error in expm1. 2009-05-15 19:53:09 -07:00
Jim Meyering 2e180a2622 rename each .cvsignore file to .gitignore 2009-05-15 18:13:37 +02:00
Ulrich Drepper 337c270829 * sysdeps/i386/fpu/s_tan.S: Set errno for ±Inf.
* sysdeps/i386/fpu/s_tanf.S: Likewise.
	* sysdeps/i386/fpu/s_tanl.S: Likewise.
	* sysdeps/ieee754/dbl-64/s_tan.c: Likewise.
	* sysdeps/ieee754/flt-32/s_tanf.c: Likewise.
	* sysdeps/x86_64/fpu/s_tanl.S: Likewise.
	* math/libm-test.inc: Add tests for errno after tan calls with
	±Inf.
2009-04-26 05:42:49 +00:00
Ulrich Drepper 002a604fd6 * sysdeps/ieee754/k_standard.c (__kernel_standard): Use correct
errno value vor pow(+-0,neg).
	* math/libm-test.inc (pow_test): Add tests for errno value for
	pole errors.
2009-04-26 04:46:54 +00:00
Ulrich Drepper 7095366d1e * math/w_fmod.c: Also handle x=±Inf as error.
* math/w_fmodf.c: Likewise.
	* math/w_fmodl.c: Likewise.
	* math/libm-test.inc (fmod_test): Add tests for errno after calls for
	x=±Inf or y=0.
2009-04-26 03:43:02 +00:00
Ulrich Drepper 0c59a1963e * sysdeps/i386/fpu/s_cos.S: Set errno for ±Inf.
* sysdeps/i386/fpu/s_cosf.S: Likewise.
	* sysdeps/i386/fpu/s_cosl.S: Likewise.
	* sysdeps/i386/fpu/s_sin.S: Likewise.
	* sysdeps/i386/fpu/s_sinf.S: Likewise.
	* sysdeps/i386/fpu/s_sinl.S: Likewise.
	* sysdeps/ieee754/dbl-64/s_sin.c: Likewise.
	* sysdeps/ieee754/flt-32/s_cosf.c: Likewise.
	* sysdeps/ieee754/flt-32/s_sinf.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_cosl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_sinl.c: Likewise.
	* sysdeps/x86_64/fpu/s_cosl.S: Likewise.
	* sysdeps/x86_64/fpu/s_sinl.S: Likewise.
	* math/libm-test.inc: Add tests for errno after sin/cos calls with
	±Inf.
2009-04-26 01:04:54 +00:00
Ulrich Drepper e971e76d8d * sysdeps/ieee754/k_standard.c (__kernel_standard): Pole errors
for lgamma should se errno to ERANGE, not EDOM.
	* math/libm-test.inc (lgamma_test): Check errno for pole errors.
2009-04-25 08:12:24 +00:00
Ulrich Drepper acd44dbc7a 2008-10-24 Joseph Myers <joseph@codesourcery.com>
Ulrich Drepper  <drepper@redhat.com>

	* math/tgmath.h (__floating_type): Use __builtin_classify_type in
	definition for GCC 3.1 and later.
2008-11-01 02:28:57 +00:00
Ulrich Drepper 8fb0af98d8 Work around braindead IBM128 long double format. 2008-05-22 19:59:10 +00:00
Ulrich Drepper a7eb802f11 [BZ #3406]
2008-02-11  Joseph Myers  <joseph@codesourcery.com>
	[BZ #3406]
	* sysdeps/ieee754/flt-32/w_expf.c (o_threshold): Correct value.
	* math/libm-test.inc (exp_test): Test 88.72269439697265625.
2008-05-11 17:49:25 +00:00
Ulrich Drepper 246ec41199 * sysdeps/powerpc/fpu/fenv_libc.h: Add libm_hidden_proto for
__fe_nomask_env.
	* sysdeps/powerpc/fpu/fe_nomask.c: Add libm_hidden_def.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c: Likewise.

	* sysdeps/powerpc/bits/fenv.h: Make safe for C++.

	* sysdeps/unix/sysv/linux/powerpc/bits/mathinline.h: New file.
	* sysdeps/powerpc/fpu/fegetexcept.c (__fegetexcept): Rename
	function from fegetexcept and make old name weak alias.
	* include/fenv.h: Declare __fegetexcept.
	* sysdeps/powerpc/fpu/fedisblxcpt.c: Use __fegetexcept instead of
	fegetexcept.
	* sysdeps/powerpc/fpu/feenablxcpt.c: Likewise.
	* sysdeps/powerpc/fpu/fraiseexcpt.c (__feraiseexcept): Avoid call
	to fetestexcept.
	* sysdeps/ieee754/ldbl-128ibm/s_log1pl.c (__log1pl): Use __frexpl
	instead of frexpl to avoid local PLT.
	* math/s_significandl.c (__significandl): Use __ilogbl instead of
	ilogbl to avoid local PLT.
	* sysdeps/ieee754/ldbl-128ibm/s_expm1l.c (__expm1l): Use __ldexpl
	instead of ldexpl to avoid local PLT.
	* sysdeps/ieee754/ldbl-128ibm/e_expl.c (__ieee754_expl): Use
	__roundl not roundl to avoid local PLT.
	* sysdeps/ieee754/ldbl-128/e_j0l.c: Use function names which avoid
	local PLTs.  Use __sincosl instead of separate sinl and cosl
	calls.
	* sysdeps/ieee754/ldbl-128/e_j1l.c: Likewise.
2008-04-12 00:51:34 +00:00
Ulrich Drepper c1e6b459c8 [BZ4997]
* sysdeps/powerpc/powerpc32/fpu/s_lround.S (__lround): Fixed erroneous
	result when x is +/-nextafter(+/-0.5,-/+1) i.e. all 1's in the
	mantissa.
	* sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S (__llround):
	Likewise.  Also account for when x is an odd number between 2^52
	and 2^53-1.
	* sysdeps/powerpc/powerpc64/fpu/s_llround.S (__llround): Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_llroundf.S (__llroundf): Likewise.
	* math/libm-test.inc (lround_test, llround_test): Added test cases to
	detect aforementioned erroneous conditions.
2008-04-11 19:32:37 +00:00
Ulrich Drepper af0498dc95 [BZ #5857]
2008-03-09  Andreas Jaeger  <aj@suse.de>
	[BZ #5857]
	* sysdeps/ieee754/dbl-64/s_rint.c (__rint): Handle j0==18.
	* sysdeps/ieee754/dbl-64/s_nearbyint.c (__nearbyint): Likewise.
  	Patch by Mark Elliott <mark.h.elliott@lmco.com>.

	* math/libm-test.inc (nearbyint_test): Add new test cases from #5857.
	(rint_test): Likewise.
2008-03-24 19:57:55 +00:00
Ulrich Drepper e6b29af8a3 [BZ #2549]
2006-04-14  H.J. Lu  <hongjiu.lu@intel.com>
	[BZ #2549]
	* math/libm-test.inc (check_float_internal): Support
	denormalized return.
2007-10-28 01:14:40 +00:00
Ulrich Drepper c039eedd66 [BZ #4407]
* sysdeps/ieee754/dbl-64/e_lgamma_r.c: Fix *signgamp for -0.0.
	* sysdeps/ieee754/flt-32/e_lgammaf_r.c: Likewise.
	* sysdeps/ieee754/ldbl-96/e_lgammal_r.c: Likewise.
	* math/libm-test.inc: Add test for this case.

	Half the patch by Christian Iseli <christian.iseli@licr.org>.
2007-10-06 18:37:30 +00:00
Ulrich Drepper de1c3ebb59 * misc/sys/cdefs.h (__va_arg_pack): Define for GCC 4.3+.
* misc/bits/syslog.h (syslog): When __va_arg_pack is defined,
	implement as __extern_always_inline function.
	(vsyslog): Define as __extern_always_inline function unconditionally.
	* libio/bits/stdio2.h (sprintf, snprintf, printf, fprintf):
	When __va_arg_pack is defined, implement as __extern_always_inline
	functions.
	(vsprintf, vsnprintf, vprintf, vfprintf): Define as
	__extern_always_inline functions unconditionally.
	* libio/bits/stdio.h (vprintf): Ifdef out the inline when
	bits/stdio2.h will be included.
	* wcsmbs/bits/wchar2.h (__swprintf_alias): New redirect.
	(swprintf, wprintf, fwprintf): When __va_arg_pack is defined,
	implement as __extern_always_inline functions.
	(vswprintf, vwprintf, vfwprintf): Define as
	__extern_always_inline functions unconditionally.
	* debug/tst-chk1.c (do_test): Enable remaining tests for C++.

2007-09-03  Jakub Jelinek  <jakub@redhat.com>

	* misc/sys/cdefs.h (__extern_inline, __extern_always_inline): Only
	define in C++ for GCC 4.3+, in C++ always use __gnu_inline__
	attribute.
	* include/features.h (__USE_EXTERN_INLINES): Define only when
	__extern_inline is defined.
	* stdlib/stdlib.h: Include bits/stdlib.h when __extern_always_inline
	is defined instead of when not __cplusplus.
	* misc/sys/syslog.h: Include bits/syslog.h when __extern_always_inline
	is defined instead of when not __cplusplus.
	* socket/sys/socket.h: Include bits/socket2.h when
	__extern_always_inline is defined instead of when not __cplusplus.
	* libio/stdio.h: Include bits/stdio2.h when __extern_always_inline
	is defined instead of when not __cplusplus.
	* posix/unistd.h: Include bits/unistd.h when __extern_always_inline
	is defined instead of when not __cplusplus.
	* string/string.h: Include bits/string3.h when __extern_always_inline
	is defined instead of when not __cplusplus.
	* wcsmbs/wchar.h: Include bits/wchar2.h when __extern_always_inline
	is defined instead of when not __cplusplus.
	(btowc, wctob): Don't guard the inlines with ifndef __cplusplus.
	* io/fcntl.h: Don't include bits/fcntl2.h if __extern_always_inline
	is not defined.
	* misc/bits/syslog-ldbl.h: Guard *_chk stuff with
	defined __extern_always_inline instead of !defined __cplusplus.
	* libio/bits/stdio-ldbl.h: Likewise.
	* wcsmbs/bits/wchar-ldbl.h: Likewise.
	* misc/bits/syslog.h (syslog): Don't define for C++.
	(vsyslog): Use __extern_always_inline function for C++ instead of
	a macro.
	* libio/bits/stdio.h (__STDIO_INLINE): Define to __extern_inline
	whenever that macro is defined.
	(vprintf): Don't provide the inline for C++.
	(fread_unlocked, fwrite_unlocked): Don't define the macros for C++.
	* libio/bits/stdio2.h (sprintf, snprintf, printf, fprintf): Don't
	define the macros for C++.
	(vsprintf, vsnprintf, vprintf, vfprintf): Define as
	__extern_always_inline functions for C++.
	* io/sys/stat.h (stat, lstat, fstat, fstatat, mknod, mknodat,
	stat64, lstat64, fstat64, fstatat64): Don't define if not
	__USE_EXTERN_INLINES.
	* wcsmbs/bits/wchar2.h: Fix #error message.
	(swprintf, wprintf, fwprintf): Don't define the macros for C++.
	(vswprintf, vwprintf, vfwprintf): Define using
	__extern_always_inline functions for C++.
	* string/bits/string3.h: Don't #undef macros if __cplusplus.
	(memcpy, memmove, mempcpy, memset, bcopy, bzero, strcpy, stpcpy,
	strncpy, strcat, strncat): Define as __extern_always_inline
	functions instead of macros for C++.
	* math/bits/cmathcalls.h: Guard __extern_inline routines with
	defined __extern_inline.
	* sysdeps/alpha/fpu/bits/mathinline.h (__MATH_INLINE): Define
	to __extern_inline whenever that macro is defined.
	* sysdeps/ia64/fpu/bits/mathinline.h (__MATH_INLINE): Likewise.
	* sysdeps/i386/fpu/bits/mathinline.h (__MATH_INLINE): Likewise.
	* sysdeps/i386/i486/bits/string.h (__STRING_INLINE): Likewise.
	* sysdeps/s390/bits/string.h (__STRING_INLINE): Likewise.
	* sysdeps/s390/fpu/bits/mathinline.h (__MATH_INLINE): Likewise.
	* sysdeps/powerpc/fpu/bits/mathinline.h (__MATH_INLINE): Likewise.
	* sysdeps/x86_64/fpu/bits/mathinline.h (__MATH_INLINE): Likewise.
	* sysdeps/sparc/fpu/bits/mathinline.h (__MATH_INLINE): Likewise.
	* sysdeps/unix/sysv/linux/sys/sysmacros.h (gnu_dev_major,
	gnu_dev_minor, gnu_dev_makedev): Remove __extern_inline from
	prototypes.  Only provide __extern_inline routines if
	__USE_EXTERN_INLINES.
	* debug/Makefile: Add rules to build and run tst-{,lfs}chk{4,5,6}
	tests.
	* debug/tst-chk1.c (do_prepare, do_test): Allow compilation as C++.
	For now avoid some *printf tests in C++.  Skip all testing
	if __USE_FORTIFY_LEVEL is defined, but __extern_always_inline macro
	is not.
	* debug/tst-chk4.cc: New file.
	* debug/tst-chk5.cc: New file.
	* debug/tst-chk6.cc: New file.
	* debug/tst-lfschk4.cc: New file.
	* debug/tst-lfschk5.cc: New file.
	* debug/tst-lfschk6.cc: New file.
	* include/wchar.h (__vfwprintf_chk, __vswprintf_chk): Avoid
	prototypes in C++.
	* include/stdio.h (__sprintf_chk, __snprintf_chk, __vsprintf_chk,
	__vsnprintf_chk, __printf_chk, __fprintf_chk, __vprintf_chk,
	__vfprintf_chk, __fgets_unlocked_chk, __fgets_chk): Likewise.
2007-09-15 02:38:04 +00:00
Ulrich Drepper 1c298d0887 [BZ #4775, BZ #4776]
2007-07-12  Jakub Jelinek  <jakub@redhat.com>
	[BZ #4775]
	* math/tgmath.h (__tgmath_real_type_sub): Formatting.
	(__tgmath_real_type): Fix if expr is const int or other const
	qualified integral type.
	(__TGMATH_UNARY_REAL_ONLY): Rewritten to avoid using statement
	expressions and handle const qualified arguments.
	(__TGMATH_BINARY_FIRST_REAL_ONLY, __TGMATH_UNARY_REAL_IMAG,
	__TGMATH_UNARY_REAL_IMAG_RET_REAL): Likewise.
	(__TGMATH_UNARY_REAL_RET_ONLY): Rewritten to avoid using
	statement expressions.
	(__TGMATH_BINARY_REAL_ONLY, __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY,
	__TGMATH_TERNARY_REAL_ONLY, __TGMATH_BINARY_REAL_IMAG): Likewise.
	(__TGMATH_UNARY_IMAG): Define.
	(conj, cproj): Use __TGMATH_UNARY_IMAG macro.
	* math/Makefile (tests): Add test-tgmath2.
	(CFLAGS-test-tgmath2.c): Add.
	* math/test-tgmath.c (fy, dy, ly, fz, dz, lz, count_cdouble,
	count_cfloat, count_cldouble): New variables.
	(NCCALLS): Define.
	(main): Check number of complex calls as well.
	(F(compile_test)): Add complex tests and tests with const qualified
	arguments.
	(y, z, ccount): Define.
	(F(cacos), F(casin), F(catan), F(ccos), F(csin), F(ctan), F(cacosh),
	F(casinh), F(catanh), F(ccosh), F(csinh), F(ctanh), F(cexp), F(clog),
	F(csqrt), F(cpow), F(cabs), F(carg), F(creal), F(cimag), F(conj),
	F(cproj)): New functions.
	* math/test-tgmath2.c: New test.

2007-07-11  Jakub Jelinek  <jakub@redhat.com>

	[BZ #4776]
	* elf/dl-load.c (_dl_rtld_di_serinfo): Output / in LD_LIBRARY_PATH,
	RPATH etc. as "/" rather than "", don't segfault on empty paths,
	instead output ".".
	* dlfcn/Makefile (distribute): Add glreflib3.c.
	(module-names): Add glreflib3.
	($(objpfx)tst-dlinfo.out): Depend on glreflib3.so rather than
	glreflib1.so.
	(LDFLAGS_glreflib3.so): New.
	* dlfcn/tst-dlinfo.c (do_test): Load glreflib3.so instead of
	glreflib1.so.
	* dlfcn/glreflib3.c: New file.

	* intl/finddomain.c (_nl_find_domain): If _nl_explode_name
	returned -1, return NULL.
	* intl/explodename.c (_nl_explode_name): Return -1 if
	_nl_normalize_codeset failed.
2007-07-12 18:17:11 +00:00
Ulrich Drepper 43b7682843 * sysdeps/ieee754/ldbl-128ibm/printf_fphex.c
(PRINT_FPHEX_LONG_DOUBLE): Fix printing numbers where lower double
	is non-zero, but smaller than 2 * __DBL_MIN__.
	* stdio-common/tst-sprintf2.c: New test.
	* stdio-common/Makefile (tests): Add tst-sprintf2.

	* math/test-misc.c (main): Don't run last batch of tests with
	IBM long double format.
2007-06-04 14:38:22 +00:00
Jakub Jelinek 37002cbcd2 * soft-fp/op-common.h (FP_TRUNC): Replace raising of FP_EX_INEXACT
with setting the sticky bit. 
* math/test-misc.c (main): Add more truncation tests.
	* soft-fp/floatunsidf.c (__floatunsidf): Use DFtype instead of
	double in the function declaration.
	* soft-fp/floatundidf.c (__floatundidf): Use DFtype instead of
	double in the function declaration.
	* soft-fp/floatunsisf.c (__floatunsisf): Use SFtype instead of
	float in the function declaration.
	* soft-fp/floatunsisf.c (__floatunsisf): Use SFtype instead of
	float in the function declaration.

	* soft-fp/extended.h (FP_UNPACK_RAW_E): Do not increase X##_e for
	denormal operands.  Do not generate FP_EX_DENORM exception.
	(FP_UNPACK_RAW_EP): Ditto.
	(FP_UNPACK_SEMIRAW_E): Use FP_UNPACK_RAW_E instead of
	undefined _FP_UNPACK_RAW_E.
	(FP_UNPACK_SEMIRAW_EP): Use FP_UNPACK_RAW_EP instead of
	undefined _FP_UNPACK_RAW_EP.
	(FP_PACK_SEMIRAW_E): Use FP_PACK_RAW_E instead of
	undefined _FP_PACK_RAW_E.
	(FP_PACK_SEMIRAW_EP): Use FP_PACK_RAW_EP instead of
	undefined _FP_PACK_RAW_EP.

	* op-2.h (_FP_FRAC_COPY_2_2): Define as alias to _FP_FRAC_COPY_2.
	* op-4.h (_FP_FRAC_COPY_2_2): Define as alias to _FP_FRAC_COPY_4.

	* soft-fp/op-common.h (FP_EXTEND): Do not abort when
	_FP_EXPBIAS_##dfs == _FP_EXPBIAS_##sfs.  Handle denormals for
	this case.
	* soft-fp/op-common.h (FP_TRUNC): Ditto.
	* soft-fp/op-common.h (FP_TRUNC): Replace raising of FP_EX_INEXACT
	with setting the sticky bit.
	* math/test-misc.c (main): Add more truncation tests.

2007-04-14  Uros Bizjak  <ubizjak@gmail.com>

	* soft-fp/floatunsidf.c (__floatunsidf): Use DFtype instead of
	double in the function declaration.
	* soft-fp/floatundidf.c (__floatundidf): Use DFtype instead of
	double in the function declaration.
	* soft-fp/floatunsisf.c (__floatunsisf): Use SFtype instead of
	float in the function declaration.
	* soft-fp/floatunsisf.c (__floatunsisf): Use SFtype instead of
	float in the function declaration.

	* soft-fp/extended.h (FP_UNPACK_RAW_E): Do not increase X##_e for
	denormal operands.  Do not generate FP_EX_DENORM exception.
	(FP_UNPACK_RAW_EP): Ditto.
	(FP_UNPACK_SEMIRAW_E): Use FP_UNPACK_RAW_E instead of
	undefined _FP_UNPACK_RAW_E.
	(FP_UNPACK_SEMIRAW_EP): Use FP_UNPACK_RAW_EP instead of
	undefined _FP_UNPACK_RAW_EP.
	(FP_PACK_SEMIRAW_E): Use FP_PACK_RAW_E instead of
	undefined _FP_PACK_RAW_E.
	(FP_PACK_SEMIRAW_EP): Use FP_PACK_RAW_EP instead of
	undefined _FP_PACK_RAW_EP.

	* op-2.h (_FP_FRAC_COPY_2_2): Define as alias to _FP_FRAC_COPY_2.
	* op-4.h (_FP_FRAC_COPY_2_2): Define as alias to _FP_FRAC_COPY_4.

2007-04-16  Uros Bizjak  <ubizjak@gmail.com>
	    Jakub Jelinek  <jakub@redhat.com>

	* soft-fp/op-common.h (FP_EXTEND): Do not abort when
	_FP_EXPBIAS_##dfs == _FP_EXPBIAS_##sfs.  Handle denormals for
	this case.
	* soft-fp/op-common.h (FP_TRUNC): Ditto.

2007-05-03  Jakub Jelinek  <jakub@redhat.com>
2007-05-03 16:36:49 +00:00
Jakub Jelinek 002f0b0b5d * math/test-misc.c (main): Add tests for rounding long double
values close to smallest double denormalized value to double.
	* soft-fp/op-common.h (FP_TRUNC): Correct off-by-one error in
	condition for truncating to 0.  Set sticky bit for such
	truncation.
2007-05-03  Jakub Jelinek  <jakub@redhat.com>

	* math/test-misc.c (main): Add tests for rounding long double
	values close to smallest double denormalized value to double.

2007-04-30  Joseph Myers  <joseph@codesourcery.com>

	* soft-fp/op-common.h (FP_TRUNC): Correct off-by-one error in
	condition for truncating to 0.  Set sticky bit for such
	truncation.
2007-05-03 12:15:04 +00:00
Ulrich Drepper 3e336a8754 [BZ #3306]
2007-03-27  Jakub Jelinek  <jakub@redhat.com>
	[BZ #3306]
	* math/math_private.h (math_opt_barrier, math_force_eval): Define.
	* sysdeps/i386/fpu/math_private.h: New file.
	* sysdeps/x86_64/fpu/math_private.h: New file.
	* math/s_nexttowardf.c (__nexttowardf): Use math_opt_barrier and
	math_force_eval macros.  Use "+m" constraint on asm rather than
	"=m" and "m".
	* math/s_nextafter.c (__nextafter): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c (__nexttoward):
	Likewise.
	* sysdeps/ieee754/flt-32/s_nextafterf.c (__nextafterf): Likewise.
	* sysdeps/ieee754/ldbl-128/s_nexttoward.c (__nexttoward): Likewise.
	* sysdeps/ieee754/ldbl-96/s_nexttoward.c (__nexttoward): Likewise.
	* sysdeps/i386/fpu/s_nextafterl.c (__nextafterl): Use
	math_opt_barrier and math_force_eval macros.
	* sysdeps/ieee754/ldbl-128/s_nextafterl.c (__nextafterl): Likewise.
	* sysdeps/ieee754/ldbl-96/s_nextafterl.c (__nextafterl): Likewise.
	* sysdeps/i386/fpu/s_nexttoward.c: Include float.h.
	(__nexttoward): Use math_opt_barrier and
	math_force_eval macros.  Use "+m" constraint on asm rather than
	"=m" and "m".  Only use asm to force double result if
	FLT_EVAL_METHOD is 2.
	* sysdeps/i386/fpu/s_nexttowardf.c: Include float.h.
	(__nexttowardf): Use math_opt_barrier and
	math_force_eval macros.  Use "+m" constraint on asm rather than
	"=m" and "m".  Only use asm to force double result if
	FLT_EVAL_METHOD is not 0.
	* sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c: Include float.h.
	(__nexttowardf): Use math_opt_barrier and
	math_force_eval macros.  If FLT_EVAL_METHOD is not 0, force
	x to float using asm.
	* sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c: Include float.h.
	(__nldbl_nexttowardf): Use math_opt_barrier and
	math_force_eval macros.  If FLT_EVAL_METHOD is not 0, force
	x to float using asm.
	* sysdeps/ieee754/ldbl-96/s_nexttowardf.c: Include float.h.
	(__nexttowardf): Use math_opt_barrier and math_force_eval
	macros.  If FLT_EVAL_METHOD is not 0, force x to float using asm.
	* math/bug-nextafter.c (zero, inf): New variables.
	(main): Add new tests.
	* math/bug-nexttoward.c (zero, inf): New variables.
	(main): Add new tests.
2007-04-16 20:41:42 +00:00
Ulrich Drepper a8c79c4088 [BZ #3427]
2007-03-22  Jakub Jelinek  <jakub@redhat.com>
	[BZ #3427]
	* sysdeps/x86_64/fpu/feholdexcpt.c (feholdexcept): Clear all
	exceptions both in SW and MXCSR.
	* sysdeps/x86_64/fpu/feupdateenv.c: New file.
	* sysdeps/x86_64/fpu/feenablxcpt.c (feenableexcept): Remove dead code.
	* sysdeps/x86_64/fpu/fedisblxcpt.c (fedisableexcept): Likewise.
	* sysdeps/i386/fpu/feholdexcpt.c (feholdexcept): Clear all exceptions
	in MXCSR if SSE is available.
	* sysdeps/i386/fpu/feupdateenv.c: Include unistd.h, dl-procinfo.h
	and ldsodefs.h.
	(__feupdateenv): Query exceptions also from MXCSR if SSE is available.
	Fix comment typo.
	* sysdeps/ia64/fpu/feholdexcpt.c (feholdexcept): Clear all exceptions.
	Return 0 rather than 1.
	* sysdeps/ia64/fpu/feupdateenv.c (feupdateenv): Fix comment typo.
	Remove incorrect part of a comment.  Fix argument to feraiseexcept.
	* math/test-fenv.c (feholdexcept_tests): New function.
	(main): Call it.

2007-01-05  Richard B. Kreckel  <kreckel@ginac.de>

	[BZ #3427]
	* sysdeps/i386/fpu/feholdexcpt.c (feholdexcept): Clear all exceptions
	in SW.
2007-04-16 20:15:57 +00:00
Ulrich Drepper b037a293a4 * configure.in (libc_cv_gnu89_inline): Test for -fgnu89-inline.
* config.make.in (gnu89-inline-CFLAGS): New variable.
	* Makeconfig (CFLAGS): Use $(gnu89-inline-CFLAGS) together with
	-std=gnu99.
	* misc/sys/cdefs.h (__extern_inline, __extern_always_inline): Define.
	* argp/argp.h: Use it.
	* bits/mathinline.h: Likewise.
	* bits/sigset.h: Likewise.
	* bits/string.h: Likewise.
	* ctype/ctype.h: Likewise.
	* hurd/hurd.h: Likewise.
	* hurd/hurd/fd.h: Likewise.
	* hurd/hurd/port.h: Likewise.
	* hurd/hurd/signal.h: Likewise.
	* hurd/hurd/threadvar.h: Likewise.
	* hurd/hurd/userlink.h: Likewise.
	* io/sys/stat.h: Likewise.
	* libio/bits/stdio.h: Likewise.
	* libio/bits/stdio2.h: Likewise.
	* mach/lock-intern.h: Likewise.
	* mach/mach/mig_support.h: Likewise.
	* math/bits/cmathcalls.h: Likewise.
	* posix/bits/unistd.h: Likewise.
	* socket/bits/socket2.h: Likewise.
	* stdlib/bits/stdlib.h: Likewise.
	* stdlib/stdlib.h: Likewise.
	* string/argz.h: Likewise.
	* string/bits/string2.h: Likewise.
	* string/bits/string3.h: Likewise.
	* sysdeps/alpha/fpu/bits/mathinline.h: Likewise.
	* sysdeps/generic/inttypes.h: Likewise.
	* sysdeps/generic/machine-lock.h: Likewise.
	* sysdeps/generic/machine-sp.h: Likewise.
	* sysdeps/i386/fpu/bits/mathinline.h: Likewise.
	* sysdeps/i386/i486/bits/string.h: Likewise.
	* sysdeps/ia64/fpu/bits/mathinline.h: Likewise.
	* sysdeps/mach/alpha/machine-lock.h: Likewise.
	* sysdeps/mach/alpha/machine-sp.h: Likewise.
	* sysdeps/mach/i386/machine-lock.h: Likewise.
	* sysdeps/mach/powerpc/machine-lock.h: Likewise.
	* sysdeps/mach/powerpc/machine-sp.h: Likewise.
	* sysdeps/powerpc/fpu/bits/mathinline.h: Likewise.
	* sysdeps/s390/bits/string.h: Likewise.
	* sysdeps/s390/fpu/bits/mathinline.h: Likewise.
	* sysdeps/sparc/fpu/bits/mathinline.h: Likewise.
	* sysdeps/unix/bsd/bsd4.4/bits/socket.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/sigset.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/socket.h: Likewise.
	* sysdeps/unix/sysv/linux/sys/sysmacros.h: Likewise.
	* sysdeps/x86_64/fpu/bits/mathinline.h: Likewise.
	* wcsmbs/bits/wchar2.h: Likewise.
	* wcsmbs/wchar.h: Likewise.
	* stdlib/gmp.h: Likewise.  Include <features.h> to get
	__extern_inline definition.

	* locale/programs/ld-ctype.c (find_translit): Return NULL if ctype is
	NULL.
2007-03-17 17:04:28 +00:00
Ulrich Drepper 6b2665f534 [BZ #3919]
* math/libm-test.inc (log_test): Test -Inf and NaN.
	(log10_test, log1p_test, log2_test): Test -Inf.
	* sysdeps/i386/fpu/e_log.S (__ieee754_log): Don't raise
	FE_INVALID when argument is qNaN.
	* sysdeps/i386/fpu/e_logl.S (__ieee754_logl): Likewise.
	* sysdeps/i386/fpu/e_logf.S (__ieee754_logf): Likewise.
	* sysdeps/x86_64/fpu/e_logl.S (__ieee754_logl): Likewise.
	* sysdeps/x86_64/fpu/e_log10l.S (__ieee754_log10l): Replace
	andb $1, %ah with testb $1, %ah, don't test for parity, instead
	testb $4, %ah and jump if non-zero.
	* sysdeps/x86_64/fpu/e_log2l.S (__ieee754_log2l): Likewise.
	* sysdeps/x86_64/fpu/s_log1pl.S (__log1pl): Likewise.

2007-03-15  Jakub Jelinek  <jakub@redhat.com>
2007-03-15 20:10:51 +00:00