| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The dbl-64 implementation of atan2, passed arguments (sNaN, qNaN),
fails to raise the "invalid" exception. This patch fixes it to add
both arguments, rather than just adding the second argument to itself,
in the case where the second argument is a NaN (which is checked for
before checking for the first argument being a NaN). sNaN tests for
atan2 are added, along with some qNaN tests I noticed were missing but
should have been there by analogy with other tests present.
Tested for x86_64 and x86.
[BZ #20252]
* sysdeps/ieee754/dbl-64/e_atan2.c (__ieee754_atan2): Add both
arguments when second argument is a NaN.
* math/libm-test.inc (atan2_test_data): Add sNaN tests and more
qNaN tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds tests of sNaN inputs to further libm functions.
Tested for x86_64 and x86.
* math/libm-test.inc (cimag_test_data): Add sNaN tests.
(conj_test_data): Likewise.
(copysign_test_data): Likewise.
(creal_test_data): Likewise.
(fma_test_data): Likewise.
(fmod_test_data): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Various implementations of frexp functions return sNaN for sNaN
input. This patch fixes them to add such arguments to themselves so
that qNaN is returned.
Tested for x86_64, x86, mips64 and powerpc.
[BZ #20250]
* sysdeps/i386/fpu/s_frexpl.S (__frexpl): Add non-finite input to
itself.
* sysdeps/ieee754/dbl-64/s_frexp.c (__frexp): Add non-finite or
zero input to itself.
* sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c (__frexp):
Likewise.
* sysdeps/ieee754/flt-32/s_frexpf.c (__frexpf): Likewise.
* sysdeps/ieee754/ldbl-128/s_frexpl.c (__frexpl): Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_frexpl.c (__frexpl): Likewise.
* sysdeps/ieee754/ldbl-96/s_frexpl.c (__frexpl): Likewise.
* math/libm-test.inc (frexp_test_data): Add sNaN tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Various modf implementations return sNaN (both outputs) for sNaN
input. In fact they contain code to convert sNaN to qNaN for both
outputs, but the way this is done is multiplying by 1.0 (for a wider
range of inputs that includes NaNs as well as numbers with exponent
large enough to ensure that they are integers), and that
multiplication by 1.0 is optimized away by GCC in the absence of
-fsignaling-nans, unlike other operations on NaNs used for this
purpose that are not no-ops for non-sNaN input. This patch arranges
for those files to be built with -fsignaling-nans so that this
existing code is effective as intended.
Tested for x86_64 and x86.
[BZ #20240]
* math/Makefile (CFLAGS-s_modf.c): New variable.
(CFLAGS-s_modff.c): Likewise.
(CFLAGS-s_modfl.c): Likewise.
* math/libm-test.inc (modf_test_data): Add sNaN tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The i386/x86_64 versions of log2l return sNaN for sNaN input. This
patch fixes them to add NaN inputs to themselves so that qNaN is
returned in this case.
Tested for x86_64 and x86.
[BZ #20235]
* sysdeps/i386/fpu/e_log2l.S (__ieee754_log2l): Add NaN input to
itself.
* sysdeps/x86_64/fpu/e_log2l.S (__ieee754_log2l): Likewise.
* math/libm-test.inc (log2_test_data): Add sNaN tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The i386/x86_64 versions of log1pl return sNaN for sNaN input. This
patch fixes them to add a NaN input to itself so that qNaN is returned
in this case.
Tested for x86_64 and x86.
[BZ #20229]
* sysdeps/i386/fpu/s_log1pl.S (__log1pl): Add NaN input to itself.
* sysdeps/x86_64/fpu/s_log1pl.S (__log1pl): Likewise.
* math/libm-test.inc (log1p_test_data): Add sNaN tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The i386/x86_64 versions of log10l return sNaN for sNaN input. This
patch fixes them to add a NaN input to itself so that qNaN is returned
in this case.
Tested for x86_64 and x86.
[BZ #20228]
* sysdeps/i386/fpu/e_log10l.S (__ieee754_log10l): Add NaN input to
itself.
* sysdeps/x86_64/fpu/e_log10l.S (__ieee754_log10l): Likewise.
* math/libm-test.inc (log10_test_data): Add sNaN tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The i386/x86_64 versions of logl return sNaN for sNaN input. This
patch fixes them to add a NaN input to itself so that qNaN is returned
in this case.
Tested for x86_64 and x86 (including a build for i586 to cover the
non-i686 logl version).
[BZ #20227]
* sysdeps/i386/fpu/e_logl.S (__ieee754_logl): Add NaN input to
itself.
* sysdeps/i386/i686/fpu/e_logl.S (__ieee754_logl): Likewise.
* sysdeps/x86_64/fpu/e_logl.S (__ieee754_logl): Likewise.
* math/libm-test.inc (log_test_data): Add sNaN tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The i386 and x86_64 implementations of expl, exp10l and expm1l (code
shared between the functions) return sNaN for sNaN input. This patch
fixes them to add NaN inputs to themselves so that qNaN is returned in
this case.
Tested for x86_64 and x86.
[BZ #20226]
* sysdeps/i386/fpu/e_expl.S (IEEE754_EXPL): Add NaN argument to
itself.
* sysdeps/x86_64/fpu/e_expl.S (IEEE754_EXPL): Likewise.
* math/libm-test.inc (exp_test_data): Add sNaN tests.
(exp10_test_data): Likewise.
(expm1_test_data): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The wrapper implementations of ldexp / scalbn / scalbln
(architecture-independent), and their float / long double variants,
return sNaN for sNaN input. This patch fixes them to add relevant
arguments to themselves so that qNaN is returned in this case.
Tested for x86_64 and x86.
[BZ #20225]
* math/s_ldexp.c (__ldexp): Add non-finite or zero argument to
itself.
* math/s_ldexpf.c (__ldexpf): Likewise.
* math/s_ldexpl.c (__ldexpl): Likewise.
* math/w_scalbln.c (__w_scalbln): Likewise.
* math/w_scalblnf.c (__w_scalblnf): Likewise.
* math/w_scalblnl.c (__w_scalblnl): Likewise.
* math/libm-test.inc (scalbn_test_data): Add sNaN tests.
(scalbln_test_data): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The i386 version of cbrtl returns sNaN (without raising any
exceptions) for sNaN input. This patch fixes it to add non-finite
arguments to themselves (the code path in question is also reached for
zero arguments, for which adding them to themselves is also harmless),
so that "invalid" is raised and qNaN returned.
Tested for x86_64 and x86.
[BZ #20224]
* sysdeps/i386/fpu/s_cbrtl.S (__cbrtl): Add non-finite or zero
argument to itself.
* math/libm-test.inc (cbrt_test_data): Add sNaN tests.
|
|
|
|
|
|
|
|
| |
This converts the inclusion macro for each test to use
the format specific macro. In addition, the format
specifier is removed as it is applied via the LIT() macro
which is itself applied when converting the auto inputs and
libm-test.inc into libm-test.c.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apply the following sed regexes to auto-libm-test-in in order:
s/flt-32/binary32/
s/dbl-64/binary64/
s/ldbl-96-intel/intel96/
s/ldbl-96-m68k/m68k96/
s/ldbl-128ibm/ibm128/
s/ldbl-128/binary128/
and fixup ldbl-96 comment manually.
|
|
|
|
|
|
|
|
|
|
| |
Use gen-libm-test.pl to generate a list of macros
mapping to libm-test-ulps.h as this simplifies adding new
types without having to modify a growing number of
static headers each time a type is added.
This also removes the final usage of the TEST_(DOUBLE|FLOAT|LDOUBLE)
macros. Thus, they too are removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the exception of the second argument of nexttoward,
any suffixes should be stripped from the test input, and
the macro LIT(x) should be applied to use the correct
suffix for the type being tested.
This adds a new argument type "j" to gen-test-libm.pl
to signify an argument to a test input which does not
require fixup. The test cases of nexttoward have
been updated to use this new feature.
This applies post-processing to all of the test inputs
through gen-libm-test.pl to strip literal suffixes and
apply the LIT(x) macro, with one exception stated above.
This seems a bit cleaner than tossing the macro onto
everything, albeit slightly more obfuscated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The i386 version of atanhl returns sNaN for sNaN input. This patch
fixes it to add NaN arguments to themselves so it returns qNaN in this
case.
Tested for x86_64 and x86.
[BZ #20219]
* sysdeps/i386/fpu/e_atanhl.S (__ieee754_atanhl): Add NaN argument
to itself.
* math/libm-test.inc (atanh_test_data): Add sNaN tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The i386 version of asinhl returns sNaN (without raising any
exceptions) for sNaN input. This patch fixes it to add non-finite
arguments to themselves, so that "invalid" is raised and qNaN
returned.
Tested for x86_64 and x86.
[BZ #20218]
* sysdeps/i386/fpu/s_asinhl.S (__asinhl): Add non-finite argument
to itself.
* math/libm-test.inc (asinh_test_data): Add sNaN tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The dbl-64 version of asin returns sNaN for sNaN arguments. This
patch fixes it to add NaN arguments to themselves so that qNaN is
returned in this case.
Tested for x86_64 and x86.
[BZ #20213]
* sysdeps/ieee754/dbl-64/e_asin.c (__ieee754_asin): Add NaN
argument to itself.
* math/libm-test.inc (asin_test_data): Add sNaN tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The dbl-64 version of acos returns sNaN for sNaN arguments. This
patch fixes it to add NaN arguments to themselves so that qNaN is
returned in this case.
Tested for x86_64 and x86.
[BZ #20212]
* sysdeps/ieee754/dbl-64/e_asin.c (__ieee754_acos): Add NaN
argument to itself.
* math/libm-test.inc (acos_test_data): Add sNaN tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The x86 / x86_64 implementation of nextafterl (also used for
nexttowardl) produces incorrect results (NaNs) when negative
subnormals, the low 32 bits of whose mantissa are zero, are
incremented towards zero. This patch fixes this by disabling the
logic to decrement the exponent in that case.
Tested for x86_64 and x86.
[BZ #20205]
* sysdeps/i386/fpu/s_nextafterl.c (__nextafterl): Do not adjust
exponent when incrementing negative subnormal with low mantissa
word zero.
* math/libm-test.inc (nextafter_test_data) [TEST_COND_intel96]:
Add another test.
|
|
|
|
|
| |
This is useful in situations where the long double type is
less precise than the type under test.
|
|
|
|
|
| |
This is useful in situations where the long double type is
less precise than the type under test.
|
|
|
|
|
| |
This is useful in situations where the long double type is
less precise than the type under test.
|
|
|
|
|
|
|
| |
This is useful in situations where the long double type is
less precise than the type under test. This adds a new
wrapper macro LITM(x) to each type to append the proper
suffix onto macro constants found in math.h.
|
|
|
|
|
|
|
|
|
| |
These are local to the test suite. Rename them as a macro starting
with lit_pi and a series of postfix operations to give us a constant
starting with lit_pi.
The lit prefix is intended to enable easy substitutions via
gen-test-libm.pl if needed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch removes various no-longer-used macros from libm-test.inc.
NO_TEST_INLINE_FLOAT, NO_TEST_INLINE_DOUBLE and M_PI_6l would have
been used before relevant tests were moved to auto-libm-test-in.
TEST_COND_x86_64 and TEST_COND_x86 were for tests in auto-libm-test-in
XFAILed for x86, and are no longer relevant now the bugs in question
have been fixed and the XFAILing removed (if future x86-specific
XFAILs become needed, they can always be added back).
Tested for x86_64 and x86.
* math/libm-test.inc (NO_TEST_INLINE_FLOAT): Remove macro.
(NO_TEST_INLINE_DOUBLE): Likewise.
(TEST_COND_x86_64): Likewise.
(TEST_COND_x86): Likewise.
(M_PI_6l): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace most of the type specific macros with the equivalent
type-generic macro using the following sed replacement command below:
sed -ri -e 's/defined TEST_FLOAT/TEST_COND_binary32/' \
-e 's/ndef TEST_FLOAT/ !TEST_COND_binary32/' \
-e 's/def TEST_FLOAT/ TEST_COND_binary32/' \
-e 's/defined TEST_DOUBLE/TEST_COND_binary64/'\
-e 's/ndef TEST_DOUBLE/ !TEST_COND_binary64/' \
-e 's/def TEST_DOUBLE/ TEST_COND_binary64/' \
-e 's/defined TEST_LDOUBLE && //' \
-e 's/ifdef TEST_LDOUBLE/if MANT_DIG >= 64/' \
-e 's/defined TEST_LDOUBLE/MANT_DIG >= 64/' \
-e '/nexttoward_test_data\[\]/,/ };/!s/LDBL_(MIN_EXP|MAX_EXP|MANT_DIG)/\1/g' \
libm-test.inc
With a little extra manual cleanup to simplify the following case:
#if MANT_DIG >= 64
# if MANT_DIG >= 64
...
# endif
...
Note, TEST_LDOUBLE checks are replaced by MANT_DIG >= 64 excepting
where another property of the type is being tested. And, the final
regex is intended to avoid replacing LDBL_ macro usage within the
nexttoward tests which explicitly take argument 2 as long double.
|
|
|
|
|
|
|
|
|
|
|
| |
Attempt to creatively redefine the macros
to choose tests based on the format being
tested, not the type.
Note, TS 18661 does not define any printf
modifiers, so we need to be a little more
verbose about constructing strings to
output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds more tests of signaling NaN inputs to libm-test.inc.
These tests are for a subset of functions with a single floating-point
input where no failures appeared in x86_64 or x86 testing. I intend
to investigate any failures of these new tests on some other
architectures before dealing with other functions.
Tested for x86_64 and x86.
* math/libm-test.inc (acosh_test_data): Add sNaN tests.
(atan_test_data): Likewise.
(ceil_test_data): Likewise.
(cos_test_data): Likewise.
(cosh_test_data): Likewise.
(erf_test_data): Likewise.
(exp2_test_data): Likewise.
(fabs_test_data): Likewise.
(floor_test_data): Likewise.
(ilogb_test_data): Likewise.
(j0_test_data): Likewise.
(j1_test_data): Likewise.
(jn_test_data): Likewise.
(lgamma_test_data): Likewise.
(lrint_test_data): Likewise.
(llrint_test_data): Likewise.
(logb_test_data): Likewise.
(lround_test_data): Likewise.
(llround_test_data): Likewise.
(nearbyint_test_data): Likewise.
(rint_test_data): Likewise.
(round_test_data): Likewise.
(sin_test_data): Likewise.
(sincos_test_data): Likewise.
(sinh_test_data): Likewise.
(sqrt_test_data): Likewise.
(tan_test_data): Likewise.
(tanh_test_data): Likewise.
(tgamma_test_data): Likewise.
(trunc_test_data): Likewise.
(y0_test_data): Likewise.
(y1_test_data): Likewise.
(yn_test_data): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds support in libm-test.inc for tests with signaling NaN
arguments. gen-libm-test.pl is made to set a flag TEST_SNAN for such
tests, so that they can be disabled automatically when sNaN testing
isn't supported for a given type (at present, for float and double on
32-bit x86 because it's unpredictable when a value might be loaded
into a floating-point register and so automatically converted to long
double with sNaNs converted to quiet NaNs). -fsignaling-nans is used
where needed.
Tests are added for classification macros, as a starting point; this
is deliberately more conservative than Thomas's patch
<https://sourceware.org/ml/libc-ports/2013-04/msg00008.html>, to allow
more tests to be added, and issues exposed fixed, bit by bit.
Tested for x86_64 and x86.
* math/libm-test.inc: Update comment about NaN testing.
(TEST_SNAN): New macro.
(snan_value): Likewise.
(enable_test): Disable tests of sNaNs when SNAN_TESTS fails.
(fpclassify_test_data): Add sNaN tests.
(isfinite_test_data): Likewise.
(isinf_test_data): Likewise.
(isnan_test_data): Likewise.
(isnormal_test_data): Likewise.
(issignaling_test_data): Likewise.
(signbit_test_data): Likewise.
* math/gen-libm-test.pl (%beautify): Add snan_value.
(show_exceptions): Add argument $test_snan.
(parse_args): Handle snan_value as non-finite. Update call to
show_exceptions.
* math/Makefile (libm-test-no-inline-cflags): Add
-fsignaling-nans.
|
|
|
|
|
| |
Make MANT_DIG shadow the types *_MIN_EXP macro. Replace
calls sites with (MIN_EXP - 1), and simplify.
|
|
|
|
|
| |
Make MANT_DIG shadow the types *_MANT_DIG macro. Replace
calls sites with (MANT_DIG - 1), and simplify.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
C99 and C11 allow but do not require ceil, floor, round and trunc to
raise the "inexact" exception for noninteger arguments. TS 18661-1
requires that this exception not be raised by these functions. This
aligns them with general IEEE semantics, where "inexact" is only
raised if the final step of rounding the infinite-precision result to
the result type is inexact; for these functions, the
infinite-precision integer result is always representable in the
result type, so "inexact" should never be raised.
The generic implementations of ceil, floor and round functions contain
code to force "inexact" to be raised. This patch removes it for round
functions to align them with TS 18661-1 in this regard. The tests
*are* updated by this patch; there are fewer architecture-specific
versions than for ceil and floor, and I fixed the powerpc ones some
time ago. If any others still have the issue, as shown by tests for
round failing with spurious exceptions, they can be fixed separately
by architecture maintainers or others.
Tested for x86_64, x86 and mips64.
[BZ #15479]
* sysdeps/ieee754/dbl-64/s_round.c (huge): Remove variable.
(__round): Do not force "inexact" exception.
* sysdeps/ieee754/dbl-64/wordsize-64/s_round.c (huge): Remove
variable.
(__round): Do not force "inexact" exception.
* sysdeps/ieee754/flt-32/s_roundf.c (huge): Remove variable.
(__roundf): Do not force "inexact" exception.
* sysdeps/ieee754/ldbl-128/s_roundl.c (huge): Remove variable.
(__roundl): Do not force "inexact" exception.
* sysdeps/ieee754/ldbl-96/s_roundl.c (huge): Remove variable.
(__roundl): Do not force "inexact" exception.
* math/libm-test.inc (round_test_data): Do not allow spurious
"inexact" exceptions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ldbl-128ibm had an implementation of fmal that just did (x * y) + z in
most cases, with no attempt at actually being a fused operation.
This patch replaces it with a genuine fused operation. It is not
necessarily correctly rounding, but should produce a result at least
as accurate as the long double arithmetic operations in libgcc, which
I think is all that can reasonably be expected for such a non-IEEE
format where arithmetic is approximate rather than rounded according
to any particular rule for determining the exact result. Like the
libgcc arithmetic, it may produce spurious overflow and underflow
results, and it falls back to the libgcc multiplication in the case of
(finite, finite, zero).
This concludes the fixes for bug 13304; any subsequently found fma
issues should go in separate Bugzilla bugs. Various other pieces of
bug 13304 were fixed in past releases over the past several years.
Tested for powerpc.
[BZ #13304]
* sysdeps/ieee754/ldbl-128ibm/s_fmal.c: Include <fenv.h>,
<float.h>, <math_private.h> and <stdlib.h>.
(add_split): New function.
(mul_split): Likewise.
(ext_val): New typedef.
(store_ext_val): New function.
(mul_ext_val): New function.
(compare): New function.
(add_split_ext): New function.
(__fmal): After checking for Inf, NaN and zero, compute result as
an exact sum of scaled double values in round-to-nearest before
adding those up and adjusting for other rounding modes.
* math/auto-libm-test-in: Remove xfail-rounding:ldbl-128ibm from
tests of fma.
* math/auto-libm-test-out: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libm-test.inc has a comment about signs of NaNs not being tested.
This is out of date since:
commit ce66581742e7ae1d6ce59e5d2d4859b2ae41218c
Author: Joseph Myers <joseph@codesourcery.com>
Date: Sat Nov 16 12:48:35 2013 +0000
Test signs of NaNs in libm-test.inc where appropriate.
This patch removes the inaccurate statement.
* math/libm-test.inc: Update comment not to refer to signs of NaNs
not being tested.
|
|
|
|
|
| |
This makes sure that the extra test objects are compiled with the correct
MODULE_NAME and dependencies are tracked.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bug 19848 reports cases where powl on x86 / x86_64 has error
accumulation, for small integer exponents, larger than permitted by
glibc's accuracy goals, at least in some rounding modes. This patch
further restricts the exponent range for which the
small-integer-exponent logic is used to limit the possible error
accumulation.
Tested for x86_64 and x86 and ulps updated accordingly.
[BZ #19848]
* sysdeps/i386/fpu/e_powl.S (p3): Rename to p2 and change value
from 8 to 4.
(__ieee754_powl): Compare integer exponent against 4 not 8.
* sysdeps/x86_64/fpu/e_powl.S (p3): Rename to p2 and change value
from 8 to 4.
(__ieee754_powl): Compare integer exponent against 4 not 8.
* math/auto-libm-test-in: Add more tests of pow.
* math/auto-libm-test-out: Regenerated.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
| |
When installing glibc (w/mathvec enabled) in-place on a system with
a glibc w/out mathvec enabled, the install will clobber the existing
libm.so (e.g., /lib64/libm-2.21.so) with a linker script. This is
because libm.so is a symlink to libm.so.6 which is a symlink to the
final libm-2.21.so file. When the makefile writes the linker script
directly to libm.so, it gets clobbered.
The simple patch below to math/Makefile fixes this. It is based on
the nptl Makefile, which does exactly the same thing in a safer way.
|
|
|
|
|
|
|
|
|
|
| |
When building on i686, x86_64, and arm, and with NDEBUG, or --with-cpu
there are various variables and functions which are unused based on
these settings.
This patch marks all such variables with __attribute__((unused)) to
avoid the compiler warnings when building with the aformentioned
options.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A large number of the test-ldouble failures seen for ldbl-128ibm are
spurious "underflow" and "inexact" exceptions. These arise from such
exceptions in the underlying arithmetic; unlike other spurious
exceptions from that arithmetic, they do not in general relate to
cases where the returned result is also substantially inaccurate, are
not so readily avoidable by appropriately conditional libgcc patches,
and are widespread enough to be hard to handle through individual
XFAILing of the affected tests.
Thus, this patch documents relaxed accuracy goals for libm functions
for IBM long double and makes libm-test.inc reflect these spurious
exceptions in ldbl-128ibm arithmetic and always allow them in
ldbl-128ibm testing (while still not allowing these exceptions to be
missing where required to be present). Tested for powerpc.
* manual/math.texi (Errors in Math Functions): Document relaxed
accuracy goals for IBM long double.
* math/libm-test.inc (test_exceptions): Always allow spurious
"underflow" and "inexact" exceptions for IBM long double.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ldbl-128ibm implementations of remainderl and remquol have logic
resulting in incorrect tests for equality of the absolute values of
the arguments. Equality is tested based on the integer
representations of the high and low parts, with the sign bit masked
off the high part - but when this changes the sign of the high part,
the sign of the low part needs to be changed as well, and failure to
do this means arguments are wrongly treated as equal when they are
not.
This patch fixes the logic to adjust signs of low parts as needed.
Tested for powerpc.
[BZ #19603]
* sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
(__ieee754_remainderl): Adjust sign of integer version of low part
when taking absolute value of high part.
* sysdeps/ieee754/ldbl-128ibm/s_remquol.c (__remquol): Likewise.
* math/libm-test.inc (remainder_test_data): Add another test.
(remquo_test_data): Likewise.
|
|
|
|
|
|
|
| |
In ICO C++11 mode ensure that isinff, isinfl, isnanf, and isnanl
are defined. These functions were accidentally removed from the
header as part of commit d9b965fa56350d6eea9f7f438a0714c7ffbb183f,
but being GNU extensions, they should have been left in place.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On running tests after from-scratch ulps regeneration, I found that
some libm tests failed with ulps in excess of those recorded in the
from-scratch regeneration, which should never happen unless those ulps
exceed the limit on ulps that can go in libm-test-ulps files.
Failure: Test: atan2_upward (inf, -inf)
Result:
is: 2.35619498e+00 0x1.2d97ccp+1
should be: 2.35619450e+00 0x1.2d97c8p+1
difference: 4.76837159e-07 0x1.000000p-21
ulp : 2.0000
max.ulp : 1.0000
Maximal error of `atan2_upward'
is : 2 ulp
accepted: 1 ulp
Failure: Test: carg_upward (-inf + inf i)
Result:
is: 2.35619498e+00 0x1.2d97ccp+1
should be: 2.35619450e+00 0x1.2d97c8p+1
difference: 4.76837159e-07 0x1.000000p-21
ulp : 2.0000
max.ulp : 1.0000
Maximal error of `carg_upward'
is : 2 ulp
accepted: 1 ulp
The problem comes from the addition of tests for the finite-math-only
versions of libm functions. Those tests share ulps with the default
function variants. make regen-ulps runs the default tests before the
finite-math-only tests, concatenating the resulting ulps before
feeding them to gen-libm-test.pl to generate a new libm-test-ulps
file. But gen-libm-test.pl always takes the last ulps value given for
any (function, type) pair. So, if the largest ulps for a function
come from non-finite inputs, a from-scratch regeneration loses those
ulps.
This patch fixes gen-libm-test.pl, in the case where there are
multiple ulps values for a (function, type) pair - which can only
happen as part of a regeneration - to take the largest ulps value
rather than the last one.
Tested for ARM / MIPS / powerpc-nofpu.
* math/gen-libm-test.pl (parse_ulps): Do not reduce
already-recorded ulps.
* sysdeps/arm/libm-test-ulps: Regenerated.
* sysdeps/mips/mips32/libm-test-ulps: Likewise.
* sysdeps/mips/mips64/libm-test-ulps: Likewise.
* sysdeps/powerpc/nofpu/libm-test-ulps: Likewise.
|
|
|
|
|
| |
* math/Makefile (libm-vec-tests): Move libraries after wrappers.o to fix
"make check" link failure on Ubuntu.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GLIBC declares isinf and isnan as expected by Unix98 and for C99 programs
these functions are hidden by the generics inf and isnan macros.
However C++11 defines isinf and isnan with the same semantics as C99
but requires that they are functions not macros (C++11 26.8 [c.math]
paragraph 10).
This then results in a conflict for perfectly valid C++11 programs:
--
using std::isinf;
using std::isnan;
double d1 = isinf(1.0);
double d2 = isnan(1.0);
d.cc:3:12: error: ‘constexpr bool std::isinf(double)’ conflicts with a previous declaration
using std::isinf;
[...]
/usr/include/bits/mathcalls.h:201:1: note: previous declaration ‘int isinf(double)’
__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
[...]
--
This patch fixes the prototypes by leaving the obsolete functions
defined for C++98 code (since they do not conflict with any standard
function in C++98), however preventing them on C++11.
No issues found in libstdc++ tests and check on x86_64 and i686 with
glibc testsuite.
Patch from Jonathan Wakely <jwakely.gcc@gmail.com>.
[BZ #19439]
* math/bits/mathcalls.h
[!__cplusplus || __cplusplus < 201103L] (isinf): Do not declare
prototype.
[!__cplusplus || __cplusplus < 201103L] (isnan): Likewise.
|
| |
|
| |
|