]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add iseqsig.
authorJoseph Myers <joseph@codesourcery.com>
Thu, 6 Oct 2016 22:19:38 +0000 (22:19 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 6 Oct 2016 22:19:38 +0000 (22:19 +0000)
TS 18661-1 adds an iseqsig type-generic comparison macro to <math.h>.
This macro is like the == operator except that unordered operands
result in the "invalid" exception and errno being set to EDOM.

This patch implements this macro for glibc.  Given the need to set
errno, this is implemented with out-of-line functions __iseqsigf,
__iseqsig and __iseqsigl (of which the last only exists at all if long
double is ABI-distinct from double, so no function aliases or compat
support are needed).  The present patch ignores excess precision
issues; I intend to deal with those in a followup patch.  (Like
comparison operators, type-generic comparison macros should *not*
convert operands to their semantic types but should preserve excess
range and precision, meaning that for some argument types and values
of FLT_EVAL_METHOD, an underlying function should be called for a
wider type than that of the arguments.)

The underlying functions are implemented with the type-generic
template machinery.  Comparing x <= y && x >= y is sufficient in ISO C
to achieve an equality comparison with "invalid" raised for unordered
operands (and the results of those two comparisons can also be used to
tell whether errno needs to be set).  However, some architectures have
GCC bugs meaning that unordered comparison instructions are used
instead of ordered ones.  Thus, a mechanism is provided for
architectures to use an explicit call to feraiseexcept to raise
exceptions if required.  If your architecture has such a bug you
should add a fix-fp-int-compare-invalid.h header for it, with a
comment pointing to the relevant GCC bug report; if such a GCC bug is
fixed, that header's contents should have a __GNUC_PREREQ conditional
added so that the workaround can eventually be removed for that
architecture.

Tested for x86_64, x86, mips64, arm and powerpc.

* math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (iseqsig): New
macro.
* math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(__iseqsig): New declaration.
* math/s_iseqsig_template.c: New file.
* math/Versions (__iseqsigf): New libm symbol at version
GLIBC_2.25.
(__iseqsig): Likewise.
(__iseqsigl): Likewise.
* math/libm-test.inc (iseqsig_test_data): New array.
(iseqsig_test): New function.
(main): Call iseqsig_test.
* math/Makefile (gen-libm-calls): Add s_iseqsigF.
* manual/arith.texi (FP Comparison Functions): Document iseqsig.
* manual/libm-err-tab.pl: Update comment on interfaces without
ulps tabulated.
* sysdeps/generic/fix-fp-int-compare-invalid.h: New file.
* sysdeps/powerpc/fpu/fix-fp-int-compare-invalid.h: Likewise.
* sysdeps/x86/fpu/fix-fp-int-compare-invalid.h: Likewise.
* 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.

40 files changed:
ChangeLog
NEWS
manual/arith.texi
manual/libm-err-tab.pl
math/Makefile
math/Versions
math/bits/mathcalls.h
math/libm-test.inc
math/math.h
math/s_iseqsig_template.c [new file with mode: 0644]
sysdeps/generic/fix-fp-int-compare-invalid.h [new file with mode: 0644]
sysdeps/nacl/libm.abilist
sysdeps/powerpc/fpu/fix-fp-int-compare-invalid.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/aarch64/libm.abilist
sysdeps/unix/sysv/linux/alpha/libm.abilist
sysdeps/unix/sysv/linux/arm/libm.abilist
sysdeps/unix/sysv/linux/hppa/libm.abilist
sysdeps/unix/sysv/linux/i386/libm.abilist
sysdeps/unix/sysv/linux/ia64/libm.abilist
sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
sysdeps/unix/sysv/linux/microblaze/libm.abilist
sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
sysdeps/unix/sysv/linux/nios2/libm.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist
sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
sysdeps/unix/sysv/linux/sh/libm.abilist
sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist
sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist
sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist
sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
sysdeps/x86/fpu/fix-fp-int-compare-invalid.h [new file with mode: 0644]

index d221a037ceb023b6b3b9beb91bdb1cc80a04e905..437667385afd83387affc638c8af2b989a6f8912 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,58 @@
+2016-10-06  Joseph Myers  <joseph@codesourcery.com>
+
+       * math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (iseqsig): New
+       macro.
+       * math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+       (__iseqsig): New declaration.
+       * math/s_iseqsig_template.c: New file.
+       * math/Versions (__iseqsigf): New libm symbol at version
+       GLIBC_2.25.
+       (__iseqsig): Likewise.
+       (__iseqsigl): Likewise.
+       * math/libm-test.inc (iseqsig_test_data): New array.
+       (iseqsig_test): New function.
+       (main): Call iseqsig_test.
+       * math/Makefile (gen-libm-calls): Add s_iseqsigF.
+       * manual/arith.texi (FP Comparison Functions): Document iseqsig.
+       * manual/libm-err-tab.pl: Update comment on interfaces without
+       ulps tabulated.
+       * sysdeps/generic/fix-fp-int-compare-invalid.h: New file.
+       * sysdeps/powerpc/fpu/fix-fp-int-compare-invalid.h: Likewise.
+       * sysdeps/x86/fpu/fix-fp-int-compare-invalid.h: Likewise.
+       * 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-10-06  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
        * sysdeps/ieee754/dbl-64/s_sin.c (reduce_and_compute, do_sincos_1,
diff --git a/NEWS b/NEWS
index 0b2ca04d8ff6fb2a6a65a5f546b326d366ad5815..b5894afce3490aeec8f3be83d7b65693cccb8e23 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -51,6 +51,8 @@ Version 2.25
 
 * New <math.h> features are added from TS 18661-1:2014:
 
+  - Comparison macros: iseqsig.
+
   - Classification macros: iscanonical, issubnormal, iszero.
 
 * The <sys/quota.h> header now includes the <linux/quota.h> header.  Support
index 6ecde21b7c90e7fd2a382033299511fec5dffade..5fb18f35613f097497375b96e6dec6ae220117fd 100644 (file)
@@ -1873,7 +1873,8 @@ undesirable.  @w{ISO C99} therefore defines comparison functions that
 do not raise exceptions when NaN is examined.  All of the functions are
 implemented as macros which allow their arguments to be of any
 floating-point type.  The macros are guaranteed to evaluate their
-arguments only once.
+arguments only once.  TS 18661-1:2014 adds such a macro for an
+equality comparison that @emph{does} raise an exception for a NaN argument.
 
 @comment math.h
 @comment ISO
@@ -1932,6 +1933,16 @@ This macro determines whether its arguments are unordered.  In other
 words, it is true if @var{x} or @var{y} are NaN, and false otherwise.
 @end deftypefn
 
+@comment math.h
+@comment ISO
+@deftypefn Macro int iseqsig (@emph{real-floating} @var{x}, @emph{real-floating} @var{y})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+This macro determines whether its arguments are equal.  It is
+equivalent to @code{(@var{x}) == (@var{y})}, but it raises the invalid
+exception and sets @code{errno} to @code{EDOM} is either argument is a
+NaN.
+@end deftypefn
+
 Not all machines provide hardware support for these operations.  On
 machines that don't, the macros can be very slow.  Therefore, you should
 not use these functions when NaN is not a concern.
index b36ef94325e28dadee9bc608adbaa2cd1b87378a..451547871b9ab3bcf10c0616e2cd65a6a15578e5 100755 (executable)
@@ -78,7 +78,7 @@ use vars qw (%results @all_floats %suffices @all_functions);
     "scalbn", "sin", "sincos", "sinh", "sqrt", "tan", "tanh", "tgamma",
     "trunc", "y0", "y1", "yn" );
 # fpclassify, iscanonical, isnormal, isfinite, isinf, isnan, issignaling,
-# issubnormal, iszero, signbit, isgreater, isgreaterequal, isless,
+# issubnormal, iszero, signbit, iseqsig, isgreater, isgreaterequal, isless,
 # islessequal, islessgreater, isunordered are not tabulated.
 
 if ($#ARGV == 0) {
index d2b4fd1153d8c7e82a522de105072d2e2e9ab925..a9f06080f48bd29e5fbd369de3ebfaa4b725bc77 100644 (file)
@@ -51,7 +51,7 @@ gen-libm-calls = cargF conjF cimagF crealF cabsF s_cacosF               \
                 k_casinhF s_csinhF k_casinhF s_csinhF s_catanhF s_catanF \
                 s_ctanF s_ctanhF s_cexpF s_clogF s_cprojF s_csqrtF       \
                 s_cpowF s_clog10F s_fdimF s_nextdownF s_fmaxF s_fminF    \
-                s_nanF
+                s_nanF s_iseqsigF
 
 libm-calls =                                                             \
        e_acosF e_acoshF e_asinF e_atan2F e_atanhF e_coshF e_expF e_fmodF \
index f702051451c7b895f09917ebe9891e1fed71cc58..e658a1037caaa4eb3609dc35fb984577b9d0b961 100644 (file)
@@ -216,6 +216,6 @@ libm {
   }
   GLIBC_2.25 {
     fesetexcept; fetestexceptflag; fegetmode; fesetmode;
-    __iscanonicall;
+    __iscanonicall; __iseqsigf; __iseqsig; __iseqsigl;
   }
 }
index 951a3d00904ac921928d2105956d65dbbdd93f3c..4fc18659f8c670fe20277e5641c56074b4a6d210 100644 (file)
@@ -380,6 +380,9 @@ __END_NAMESPACE_C99
 #endif
 
 #if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Test equality.  */
+__MATHDECL_1 (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y));
+
 /* Test for signaling NaN.  */
 __MATHDECL_1 (int, __issignaling,, (_Mdouble_ __value))
      __attribute__ ((__const__));
index cbc7226aea3449ef1c3c2cf40173541ae5471894..4573482f653b17c8f6987abfba0f7b9bf716807a 100644 (file)
@@ -47,7 +47,7 @@
    fabs, fdim, finite, floor, fma, fmax, fmin, fmod, fpclassify,
    frexp, gamma, hypot,
    ilogb, iscanonical, isfinite, isinf, isnan, isnormal, issignaling,
-   issubnormal, iszero, isless, islessequal, isgreater,
+   issubnormal, iszero, iseqsig, isless, islessequal, isgreater,
    isgreaterequal, islessgreater, isunordered, j0, j1, jn,
    ldexp, lgamma, log, log10, log1p, log2, logb,
    modf, nearbyint, nextafter, nexttoward,
@@ -8185,6 +8185,64 @@ iscanonical_test (void)
   ALL_RM_TEST (iscanonical, 1, iscanonical_test_data, RUN_TEST_LOOP_f_b_tg, END);
 }
 
+static const struct test_ff_i_data iseqsig_test_data[] =
+  {
+    TEST_ff_i (iseqsig, minus_zero, minus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+    TEST_ff_i (iseqsig, minus_zero, plus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+    TEST_ff_i (iseqsig, minus_zero, (FLOAT) 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+    TEST_ff_i (iseqsig, minus_zero, qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, minus_zero, -qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, minus_zero, snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, minus_zero, -snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, plus_zero, minus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+    TEST_ff_i (iseqsig, plus_zero, plus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+    TEST_ff_i (iseqsig, plus_zero, (FLOAT) 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+    TEST_ff_i (iseqsig, plus_zero, qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, plus_zero, -qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, plus_zero, snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, plus_zero, -snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, (FLOAT) 1, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+    TEST_ff_i (iseqsig, (FLOAT) 1, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+    TEST_ff_i (iseqsig, (FLOAT) 1, (FLOAT) 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+    TEST_ff_i (iseqsig, (FLOAT) 1, qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, (FLOAT) 1, -qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, (FLOAT) 1, snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, (FLOAT) 1, -snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, qnan_value, minus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, -qnan_value, minus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, qnan_value, plus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, -qnan_value, plus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, qnan_value, (FLOAT) 1, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, -qnan_value, (FLOAT) 1, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, snan_value, minus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, -snan_value, minus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, snan_value, plus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, -snan_value, plus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, snan_value, (FLOAT) 1, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, -snan_value, (FLOAT) 1, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, qnan_value, qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, qnan_value, -qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, -qnan_value, qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, -qnan_value, -qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, snan_value, qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, snan_value, -qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, -snan_value, qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, -snan_value, -qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, qnan_value, snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, qnan_value, -snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, -qnan_value, snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, -qnan_value, -snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, snan_value, snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, snan_value, -snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, -snan_value, snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_ff_i (iseqsig, -snan_value, -snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+  };
+
+static void
+iseqsig_test (void)
+{
+  ALL_RM_TEST (iseqsig, 1, iseqsig_test_data, RUN_TEST_LOOP_ff_i_tg, END);
+}
 static const struct test_f_i_data isfinite_test_data[] =
   {
     TEST_f_b (isfinite, 0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
@@ -12834,6 +12892,7 @@ main (int argc, char **argv)
   fma_test ();
 
   /* Comparison macros:  */
+  iseqsig_test ();
   isgreater_test ();
   isgreaterequal_test ();
   isless_test ();
index 8cd641688d6b59e797abd5ab0252829f2c846684..394cefae020bd1ff76a17e10bc516b7842a62320 100644 (file)
@@ -531,6 +531,24 @@ extern int matherr (struct exception *__exc);
 
 #endif
 
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Return X == Y but raising "invalid" and setting errno if X or Y is
+   a NaN.  */
+# ifdef __NO_LONG_DOUBLE_MATH
+#  define iseqsig(x, y)                                \
+  (sizeof ((x) + (y)) == sizeof (float)                \
+   ? __iseqsigf ((x), (y))                     \
+   : __iseqsig ((x), (y)))
+# else
+#  define iseqsig(x, y)                                \
+  (sizeof ((x) + (y)) == sizeof (float)                \
+   ? __iseqsigf ((x), (y))                     \
+   : sizeof ((x) + (y)) == sizeof (double)     \
+   ? __iseqsig ((x), (y))                      \
+   : __iseqsigl ((x), (y)))
+# endif
+#endif
+
 __END_DECLS
 
 
diff --git a/math/s_iseqsig_template.c b/math/s_iseqsig_template.c
new file mode 100644 (file)
index 0000000..ebdae64
--- /dev/null
@@ -0,0 +1,42 @@
+/* Test whether X == Y.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <fenv.h>
+#include <math.h>
+#include <stdbool.h>
+#include <fix-fp-int-compare-invalid.h>
+
+int
+M_DECL_FUNC (__iseqsig) (FLOAT x, FLOAT y)
+{
+  /* Comparing <= and >= is sufficient to determine both whether X and
+     Y are equal, and whether they are unordered, while raising the
+     "invalid" exception if they are unordered.  */
+  bool cmp1 = x <= y;
+  bool cmp2 = x >= y;
+  if (cmp1 && cmp2)
+    return 1;
+  else if (!cmp1 && !cmp2)
+    {
+      if (FIX_COMPARE_INVALID)
+       feraiseexcept (FE_INVALID);
+      __set_errno (EDOM);
+    }
+  return 0;
+}
diff --git a/sysdeps/generic/fix-fp-int-compare-invalid.h b/sysdeps/generic/fix-fp-int-compare-invalid.h
new file mode 100644 (file)
index 0000000..42e3d12
--- /dev/null
@@ -0,0 +1,27 @@
+/* Fix for missing "invalid" exceptions from floating-point
+   comparisons.  Generic version.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef FIX_FP_INT_COMPARE_INVALID_H
+#define FIX_FP_INT_COMPARE_INVALID_H   1
+
+/* Define this macro to 1 to work around ordered comparison operators
+   in C failing to raise the "invalid" exception for NaN operands.  */
+#define FIX_COMPARE_INVALID 0
+
+#endif /* fix-fp-int-compare-invalid.h */
index 85ee684a1a5ad5a58117d14bb0c9785c998d7ba7..cdc65c3069a0a7c57c019f9def6331e1f09b5fe2 100644 (file)
@@ -380,6 +380,8 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
diff --git a/sysdeps/powerpc/fpu/fix-fp-int-compare-invalid.h b/sysdeps/powerpc/fpu/fix-fp-int-compare-invalid.h
new file mode 100644 (file)
index 0000000..cb2a272
--- /dev/null
@@ -0,0 +1,28 @@
+/* Fix for missing "invalid" exceptions from floating-point
+   comparisons.  PowerPC version.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef FIX_FP_INT_COMPARE_INVALID_H
+#define FIX_FP_INT_COMPARE_INVALID_H   1
+
+/* As of GCC 5, comparisons use unordered comparison instructions when
+   they should use ordered comparisons
+   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58684>.  */
+#define FIX_COMPARE_INVALID 1
+
+#endif /* fix-fp-int-compare-invalid.h */
index aee63a105cf19276ea9fcd8127457a69a43b705e..1ec00012c8a1234d05bb8973d0d6f9bf4686a6a1 100644 (file)
@@ -411,6 +411,9 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 339b896ac705f973f581f579bf93f7ae26039bdf..1edbb96e87c1895da62beff477b95fa896a7f840 100644 (file)
@@ -421,6 +421,9 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index f7b824413b0f8446bbd105cda1eb8cc40e2f355d..26d9cc674be220e0199731bdec6f3d159eae7be0 100644 (file)
@@ -69,6 +69,8 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 576b514a5399ce46cab2f466a7f377b83ad8bf19..a191cd8e0b107ddfcfb11048884fbd745868fe92 100644 (file)
@@ -381,6 +381,8 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 19e9792931da395f6712c55be85643e45dea1ffe..0a0383f01641599347a000dc774f0ebe6ccc625e 100644 (file)
@@ -424,6 +424,9 @@ GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
 GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 1a32e2c07d750e5638775c570f561af1139c835f..017b0f9f7a915951fbf1ace8796f6a15b84d14e8 100644 (file)
@@ -353,6 +353,9 @@ GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
 GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index f7b824413b0f8446bbd105cda1eb8cc40e2f355d..26d9cc674be220e0199731bdec6f3d159eae7be0 100644 (file)
@@ -69,6 +69,8 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 2a8cba458ecc0e2b3005399f1c950659b86817e4..945d51e325a0e6cf7c4b86d86dfee594d1b2b945 100644 (file)
@@ -422,6 +422,9 @@ GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
 GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index c59437fe736aed641815e886171026f5b0f350a9..deb4189844a42dbe0ca5e86fe9e0b042dce2e301 100644 (file)
@@ -380,6 +380,8 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 31d6f9eb7051e4630877ba124a7e32f2668f82ca..ceb12918e9905afc1be4a731359562910cec558d 100644 (file)
@@ -382,6 +382,8 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 83e031125b025a381bd3cb855369be5c5b440a74..003fe7b56794783bfbe80f3943f568e31446ce34 100644 (file)
@@ -413,6 +413,9 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 151574d6708cbe3e08a3ba9d3d410fa75e1a7d26..d57c3ebc1cff224654edb961734e3a871c9c5c32 100644 (file)
@@ -380,6 +380,8 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 155daf5ecd1fd58b84e302363f08d4bef5949cce..b22ec567403c2106ec7ece4b9054eefa49532172 100644 (file)
@@ -424,6 +424,9 @@ GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
 GLIBC_2.25 __fe_dfl_mode D 0x8
 GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 7b3863247544529d358ae3d9a249f645cab14a1d..777a39d0e15c9e0c2ff1ec1ed4d42691dc8a55b6 100644 (file)
@@ -423,6 +423,9 @@ GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
 GLIBC_2.25 __fe_dfl_mode D 0x8
 GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 26c8d413302d22ba320df31c82d7961b9ddbd27e..1b900c7144d53ee0760de8eefcc7ac917af936a9 100644 (file)
@@ -418,6 +418,9 @@ GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
 GLIBC_2.25 __fe_dfl_mode D 0x8
 GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 0e76e88f7b91dcefa76e9baf9503677e16a9b96a..0a8600e29de30c560631af4b77a20c5a70c59c30 100644 (file)
@@ -99,6 +99,9 @@ GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
 GLIBC_2.25 __fe_dfl_mode D 0x8
 GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 377cea952a3b1e2982663d3f5947b490321d411e..d7fff5327fa235c1d728b6bb18ca0629ff5b68f3 100644 (file)
@@ -411,6 +411,9 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index dafbff15a6f435fb9672018e72fc6e66f01b1a2f..4d682e604f1424cefedeaac00ab991e2984e8a62 100644 (file)
@@ -409,6 +409,9 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index a38baceb8ff3ff20e6ce7e897ae490f6d1a78c10..0092b62a240183442b47d7d4916353f072ca0f57 100644 (file)
@@ -381,6 +381,8 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 27166beb559dda72dfecac6e227fcdf9d05251d2..4ad593cbae3ff80cc860627ed274bc4ad7fa2cc5 100644 (file)
@@ -414,6 +414,9 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 46f79734653059ad2ff0c372b0cba79b5d1c027b..90a2bd57edf879e3edebd5c8b2b1d385cd24a9a4 100644 (file)
@@ -412,6 +412,9 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index ec6f0b360036aa3abf7a5ef1ba208a8ea50226d4..5d502c0bc8a352c6d17d949c21f44ab3d345db69 100644 (file)
@@ -381,6 +381,8 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index ec6f0b360036aa3abf7a5ef1ba208a8ea50226d4..5d502c0bc8a352c6d17d949c21f44ab3d345db69 100644 (file)
@@ -381,6 +381,8 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index ec6f0b360036aa3abf7a5ef1ba208a8ea50226d4..5d502c0bc8a352c6d17d949c21f44ab3d345db69 100644 (file)
@@ -381,6 +381,8 @@ GLIBC_2.24 nextup F
 GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 1965316647902223b1eeaa3e1a0b01d4d5075783..3364b0271d2158f2831965e18432e2067e1a5b00 100644 (file)
@@ -413,6 +413,9 @@ GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
 GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
index 82207c9d703995a89bf55e6617fa0e549818607a..6a3a3ce0ca394449e70bda5a6daf456389b5744c 100644 (file)
@@ -412,6 +412,9 @@ GLIBC_2.24 nextupf F
 GLIBC_2.24 nextupl F
 GLIBC_2.25 GLIBC_2.25 A
 GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
 GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
diff --git a/sysdeps/x86/fpu/fix-fp-int-compare-invalid.h b/sysdeps/x86/fpu/fix-fp-int-compare-invalid.h
new file mode 100644 (file)
index 0000000..6052280
--- /dev/null
@@ -0,0 +1,28 @@
+/* Fix for missing "invalid" exceptions from floating-point
+   comparisons.  x86 version.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef FIX_FP_INT_COMPARE_INVALID_H
+#define FIX_FP_INT_COMPARE_INVALID_H   1
+
+/* As of GCC 5, both x87 and SSE comparisons use unordered comparison
+   instructions when they should use ordered comparisons
+   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52451>.  */
+#define FIX_COMPARE_INVALID 1
+
+#endif /* fix-fp-int-compare-invalid.h */