about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/ieee754/dbl-64/s_totalorder.c53
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c49
-rw-r--r--sysdeps/ieee754/flt-32/s_totalorderf.c45
-rw-r--r--sysdeps/ieee754/ldbl-128/s_totalorderl.c53
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/Makefile3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c61
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c64
-rw-r--r--sysdeps/ieee754/ldbl-96/Makefile2
-rw-r--r--sysdeps/ieee754/ldbl-96/s_totalorderl.c56
-rw-r--r--sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c71
-rw-r--r--sysdeps/ieee754/ldbl-opt/Makefile3
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c26
-rw-r--r--sysdeps/nacl/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/arm/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/i386/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/sh/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libm.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist3
39 files changed, 564 insertions, 3 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_totalorder.c b/sysdeps/ieee754/dbl-64/s_totalorder.c
new file mode 100644
index 0000000000..73ac32f78b
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_totalorder.c
@@ -0,0 +1,53 @@
+/* Total order operation.  dbl-64 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/>.  */
+
+#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
+
+int
+totalorder (double x, double y)
+{
+  int32_t hx, hy;
+  uint32_t lx, ly;
+  EXTRACT_WORDS (hx, lx, x);
+  EXTRACT_WORDS (hy, ly, y);
+#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+  uint32_t uhx = hx & 0x7fffffff, uhy = hy & 0x7fffffff;
+  /* For the preferred quiet NaN convention, this operation is a
+     comparison of the representations of the arguments interpreted as
+     sign-magnitude integers.  If both arguments are NaNs, invert the
+     quiet/signaling bit so comparing that way works.  */
+  if ((uhx > 0x7ff00000 || (uhx == 0x7ff00000 && lx != 0))
+      && (uhy > 0x7ff00000 || (uhy == 0x7ff00000 && ly != 0)))
+    {
+      hx ^= 0x00080000;
+      hy ^= 0x00080000;
+    }
+#endif
+  uint32_t hx_sign = hx >> 31;
+  uint32_t hy_sign = hy >> 31;
+  hx ^= hx_sign >> 1;
+  lx ^= hx_sign;
+  hy ^= hy_sign >> 1;
+  ly ^= hy_sign;
+  return hx < hy || (hx == hy && lx <= ly);
+}
+#ifdef NO_LONG_DOUBLE
+weak_alias (totalorder, totalorderl)
+#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c
new file mode 100644
index 0000000000..02cd799cf6
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c
@@ -0,0 +1,49 @@
+/* Total order operation.  dbl-64/wordsize-64 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/>.  */
+
+#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
+
+int
+totalorder (double x, double y)
+{
+  int64_t ix, iy;
+  EXTRACT_WORDS64 (ix, x);
+  EXTRACT_WORDS64 (iy, y);
+#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+  /* For the preferred quiet NaN convention, this operation is a
+     comparison of the representations of the arguments interpreted as
+     sign-magnitude integers.  If both arguments are NaNs, invert the
+     quiet/signaling bit so comparing that way works.  */
+  if ((ix & 0x7fffffffffffffffULL) > 0x7ff0000000000000ULL
+      && (iy & 0x7fffffffffffffffULL) > 0x7ff0000000000000ULL)
+    {
+      ix ^= 0x0008000000000000ULL;
+      iy ^= 0x0008000000000000ULL;
+    }
+#endif
+  uint64_t ix_sign = ix >> 63;
+  uint64_t iy_sign = iy >> 63;
+  ix ^= ix_sign >> 1;
+  iy ^= iy_sign >> 1;
+  return ix <= iy;
+}
+#ifdef NO_LONG_DOUBLE
+weak_alias (totalorder, totalorderl)
+#endif
diff --git a/sysdeps/ieee754/flt-32/s_totalorderf.c b/sysdeps/ieee754/flt-32/s_totalorderf.c
new file mode 100644
index 0000000000..1ed30d8116
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_totalorderf.c
@@ -0,0 +1,45 @@
+/* Total order operation.  flt-32 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/>.  */
+
+#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
+
+int
+totalorderf (float x, float y)
+{
+  int32_t ix, iy;
+  GET_FLOAT_WORD (ix, x);
+  GET_FLOAT_WORD (iy, y);
+#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+  /* For the preferred quiet NaN convention, this operation is a
+     comparison of the representations of the arguments interpreted as
+     sign-magnitude integers.  If both arguments are NaNs, invert the
+     quiet/signaling bit so comparing that way works.  */
+  if ((ix & 0x7fffffff) > 0x7f800000 && (iy & 0x7fffffff) > 0x7f800000)
+    {
+      ix ^= 0x00400000;
+      iy ^= 0x00400000;
+    }
+#endif
+  uint32_t ix_sign = ix >> 31;
+  uint32_t iy_sign = iy >> 31;
+  ix ^= ix_sign >> 1;
+  iy ^= iy_sign >> 1;
+  return ix <= iy;
+}
diff --git a/sysdeps/ieee754/ldbl-128/s_totalorderl.c b/sysdeps/ieee754/ldbl-128/s_totalorderl.c
new file mode 100644
index 0000000000..dc76ccf204
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_totalorderl.c
@@ -0,0 +1,53 @@
+/* Total order operation.  ldbl-128 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/>.  */
+
+#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
+
+int
+totalorderl (_Float128 x, _Float128 y)
+{
+  int64_t hx, hy;
+  uint64_t lx, ly;
+  GET_LDOUBLE_WORDS64 (hx, lx, x);
+  GET_LDOUBLE_WORDS64 (hy, ly, y);
+#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+  uint64_t uhx = hx & 0x7fffffffffffffffULL;
+  uint64_t uhy = hy & 0x7fffffffffffffffULL;
+  /* For the preferred quiet NaN convention, this operation is a
+     comparison of the representations of the arguments interpreted as
+     sign-magnitude integers.  If both arguments are NaNs, invert the
+     quiet/signaling bit so comparing that way works.  */
+  if ((uhx > 0x7fff000000000000ULL || (uhx == 0x7fff000000000000ULL
+				       && lx != 0))
+      && (uhy > 0x7fff000000000000ULL || (uhy == 0x7fff000000000000ULL
+					  && ly != 0)))
+    {
+      hx ^= 0x0000800000000000ULL;
+      hy ^= 0x0000800000000000ULL;
+    }
+#endif
+  uint64_t hx_sign = hx >> 63;
+  uint64_t hy_sign = hy >> 63;
+  hx ^= hx_sign >> 1;
+  lx ^= hx_sign;
+  hy ^= hy_sign >> 1;
+  ly ^= hy_sign;
+  return hx < hy || (hx == hy && lx <= ly);
+}
diff --git a/sysdeps/ieee754/ldbl-128ibm/Makefile b/sysdeps/ieee754/ldbl-128ibm/Makefile
index 56bebf8391..eb625a7234 100644
--- a/sysdeps/ieee754/ldbl-128ibm/Makefile
+++ b/sysdeps/ieee754/ldbl-128ibm/Makefile
@@ -11,5 +11,6 @@ endif
 
 ifeq ($(subdir),math)
 tests += test-fmodl-ldbl-128ibm test-remainderl-ldbl-128ibm \
-	 test-remquol-ldbl-128ibm test-iscanonical-ldbl-128ibm
+	 test-remquol-ldbl-128ibm test-iscanonical-ldbl-128ibm \
+	 test-totalorderl-ldbl-128ibm
 endif
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c b/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c
new file mode 100644
index 0000000000..1535b2fb1e
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c
@@ -0,0 +1,61 @@
+/* Total order operation.  ldbl-128ibm 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/>.  */
+
+#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
+
+int
+totalorderl (long double x, long double y)
+{
+  double xhi, xlo, yhi, ylo;
+  int64_t hx, hy, lx, ly;
+
+  ldbl_unpack (x, &xhi, &xlo);
+  EXTRACT_WORDS64 (hx, xhi);
+  ldbl_unpack (y, &yhi, &ylo);
+  EXTRACT_WORDS64 (hy, yhi);
+#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+# error not implemented
+#endif
+  uint64_t hx_sign = hx >> 63;
+  uint64_t hy_sign = hy >> 63;
+  int64_t hx_adj = hx ^ (hx_sign >> 1);
+  int64_t hy_adj = hy ^ (hy_sign >> 1);
+  if (hx_adj < hy_adj)
+    return 1;
+  else if (hx_adj > hy_adj)
+    return 0;
+
+  /* The high doubles are identical.  If they are NaNs or both the low
+     parts are zero, the low parts are not significant (and if they
+     are infinities, both the low parts must be zero).  */
+  if ((hx & 0x7fffffffffffffffULL) >= 0x7ff0000000000000ULL)
+    return 1;
+  EXTRACT_WORDS64 (lx, xlo);
+  EXTRACT_WORDS64 (ly, ylo);
+  if (((lx | ly) & 0x7fffffffffffffffULL) == 0)
+    return 1;
+
+  /* Otherwise compare the low parts.  */
+  uint64_t lx_sign = lx >> 63;
+  uint64_t ly_sign = ly >> 63;
+  lx ^= lx_sign >> 1;
+  ly ^= ly_sign >> 1;
+  return lx <= ly;
+}
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c
new file mode 100644
index 0000000000..78b162c4fc
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c
@@ -0,0 +1,64 @@
+/* Test totalorderl for ldbl-128ibm.
+   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 <math.h>
+#include <math_private.h>
+#include <stdbool.h>
+#include <stdio.h>
+
+struct test
+{
+  double hi, lo1, lo2;
+};
+
+static const struct test tests[] =
+  {
+    { __builtin_nan (""), 1, __builtin_nans ("") },
+    { -__builtin_nan (""), 1, __builtin_nans ("") },
+    { __builtin_nans (""), 1, __builtin_nan ("") },
+    { -__builtin_nans (""), 1, __builtin_nan ("") },
+    { __builtin_inf (), 0.0, -0.0 },
+    { -__builtin_inf (), 0.0, -0.0 },
+    { 1.5, 0.0, -0.0 },
+  };
+
+static int
+do_test (void)
+{
+  int result = 0;
+
+  for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
+    {
+      long double ldx = ldbl_pack (tests[i].hi, tests[i].lo1);
+      long double ldy = ldbl_pack (tests[i].hi, tests[i].lo2);
+      bool to1 = totalorderl (ldx, ldy);
+      bool to2 = totalorderl (ldy, ldx);
+      if (to1 && to2)
+	printf ("PASS: test %zu\n", i);
+      else
+	{
+	  printf ("FAIL: test %zu\n", i);
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-96/Makefile b/sysdeps/ieee754/ldbl-96/Makefile
index bf9676e907..931976d7b1 100644
--- a/sysdeps/ieee754/ldbl-96/Makefile
+++ b/sysdeps/ieee754/ldbl-96/Makefile
@@ -17,5 +17,5 @@
 # <http://www.gnu.org/licenses/>.
 
 ifeq ($(subdir),math)
-tests += test-iscanonical-ldbl-96
+tests += test-iscanonical-ldbl-96 test-totalorderl-ldbl-96
 endif
diff --git a/sysdeps/ieee754/ldbl-96/s_totalorderl.c b/sysdeps/ieee754/ldbl-96/s_totalorderl.c
new file mode 100644
index 0000000000..4f14bafb44
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_totalorderl.c
@@ -0,0 +1,56 @@
+/* Total order operation.  ldbl-96 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/>.  */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
+
+int
+totalorderl (long double x, long double y)
+{
+  int16_t expx, expy;
+  uint32_t hx, hy;
+  uint32_t lx, ly;
+  GET_LDOUBLE_WORDS (expx, hx, lx, x);
+  GET_LDOUBLE_WORDS (expy, hy, ly, y);
+  if (LDBL_MIN_EXP == -16382)
+    {
+      /* M68K variant: for the greatest exponent, the high mantissa
+	 bit is not significant and both values of it are valid, so
+	 set it before comparing.  For the Intel variant, only one
+	 value of the high mantissa bit is valid for each exponent, so
+	 this is not necessary.  */
+      if ((expx & 0x7fff) == 0x7fff)
+	hx |= 0x80000000;
+      if ((expy & 0x7fff) == 0x7fff)
+	hy |= 0x80000000;
+    }
+#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+# error not implemented
+#endif
+  uint32_t x_sign = expx >> 15;
+  uint32_t y_sign = expy >> 15;
+  expx ^= x_sign >> 17;
+  hx ^= x_sign;
+  lx ^= x_sign;
+  expy ^= y_sign >> 17;
+  hy ^= y_sign;
+  ly ^= y_sign;
+  return expx < expy || (expx == expy && (hx < hy || (hx == hy && lx <= ly)));
+}
diff --git a/sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c b/sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c
new file mode 100644
index 0000000000..07fa772414
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c
@@ -0,0 +1,71 @@
+/* Test totalorderl for ldbl-96.
+   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 <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+
+static const uint64_t tests[] =
+  {
+    0, 1, 0x4000000000000000ULL, 0x4000000000000001ULL,
+    0x7fffffffffffffffULL
+  };
+
+static int
+do_test (void)
+{
+  int result = 0;
+
+  if (LDBL_MIN_EXP == -16382)
+    for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
+      {
+	long double ldx, ldy, ldnx, ldny;
+	/* Verify that the high bit of the mantissa is ignored for
+	   infinities and NaNs for the M68K variant of this
+	   format.  */
+	SET_LDOUBLE_WORDS (ldx, 0x7fff,
+			   tests[i] >> 32, tests[i] & 0xffffffffULL);
+	SET_LDOUBLE_WORDS (ldy, 0x7fff,
+			   (tests[i] >> 32) | 0x80000000,
+			   tests[i] & 0xffffffffULL);
+	SET_LDOUBLE_WORDS (ldnx, 0xffff,
+			   tests[i] >> 32, tests[i] & 0xffffffffULL);
+	SET_LDOUBLE_WORDS (ldny, 0xffff,
+			   (tests[i] >> 32) | 0x80000000,
+			   tests[i] & 0xffffffffULL);
+	bool to1 = totalorderl (ldx, ldy);
+	bool to2 = totalorderl (ldy, ldx);
+	bool to3 = totalorderl (ldnx, ldny);
+	bool to4 = totalorderl (ldny, ldnx);
+	if (to1 && to2 && to3 && to4)
+	  printf ("PASS: test %zu\n", i);
+	else
+	  {
+	    printf ("FAIL: test %zu\n", i);
+	    result = 1;
+	  }
+      }
+
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-opt/Makefile b/sysdeps/ieee754/ldbl-opt/Makefile
index af08209570..12255d6951 100644
--- a/sysdeps/ieee754/ldbl-opt/Makefile
+++ b/sysdeps/ieee754/ldbl-opt/Makefile
@@ -41,7 +41,7 @@ libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \
 		 isoc99_vscanf isoc99_vfscanf isoc99_vsscanf \
 		 isoc99_wscanf isoc99_fwscanf isoc99_swscanf \
 		 isoc99_vwscanf isoc99_vfwscanf isoc99_vswscanf \
-		 nextup nextdown
+		 nextup nextdown totalorder
 libnldbl-routines = $(libnldbl-calls:%=nldbl-%)
 libnldbl-inhibit-o = $(object-suffixes)
 libnldbl-static-only-routines = $(libnldbl-routines)
@@ -142,6 +142,7 @@ CFLAGS-nldbl-sqrt.c = -fno-builtin-sqrtl
 CFLAGS-nldbl-tan.c = -fno-builtin-tanl
 CFLAGS-nldbl-tanh.c = -fno-builtin-tanhl
 CFLAGS-nldbl-tgamma.c = -fno-builtin-tgammal
+CFLAGS-nldbl-totalorder.c = -fno-builtin-totalorderl
 CFLAGS-nldbl-trunc.c = -fno-builtin-truncl
 CFLAGS-nldbl-y0.c = -fno-builtin-y0l
 CFLAGS-nldbl-y1.c = -fno-builtin-y1l
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c b/sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c
new file mode 100644
index 0000000000..0be5a6d07e
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for totalorder.
+   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 "nldbl-compat.h"
+
+double
+attribute_hidden
+totalorderl (double x, double y)
+{
+  return totalorder (x, y);
+}
diff --git a/sysdeps/nacl/libm.abilist b/sysdeps/nacl/libm.abilist
index cdc65c3069..8f01f60887 100644
--- a/sysdeps/nacl/libm.abilist
+++ b/sysdeps/nacl/libm.abilist
@@ -386,3 +386,6 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libm.abilist b/sysdeps/unix/sysv/linux/aarch64/libm.abilist
index 1ec00012c8..32a464ac50 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libm.abilist
@@ -418,3 +418,6 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
diff --git a/sysdeps/unix/sysv/linux/alpha/libm.abilist b/sysdeps/unix/sysv/linux/alpha/libm.abilist
index 1edbb96e87..3c7ed06bf4 100644
--- a/sysdeps/unix/sysv/linux/alpha/libm.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libm.abilist
@@ -428,6 +428,9 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.3.4 GLIBC_2.3.4 A
 GLIBC_2.3.4 __c1_cabsf F
 GLIBC_2.3.4 __c1_cacosf F
diff --git a/sysdeps/unix/sysv/linux/arm/libm.abilist b/sysdeps/unix/sysv/linux/arm/libm.abilist
index 26d9cc674b..df07c0813f 100644
--- a/sysdeps/unix/sysv/linux/arm/libm.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libm.abilist
@@ -75,6 +75,9 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
 GLIBC_2.4 _LIB_VERSION D 0x4
 GLIBC_2.4 __clog10 F
diff --git a/sysdeps/unix/sysv/linux/hppa/libm.abilist b/sysdeps/unix/sysv/linux/hppa/libm.abilist
index a191cd8e0b..8843496ece 100644
--- a/sysdeps/unix/sysv/linux/hppa/libm.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libm.abilist
@@ -387,5 +387,8 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
 GLIBC_2.4 exp2l F
diff --git a/sysdeps/unix/sysv/linux/i386/libm.abilist b/sysdeps/unix/sysv/linux/i386/libm.abilist
index 0a0383f016..d190600993 100644
--- a/sysdeps/unix/sysv/linux/i386/libm.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libm.abilist
@@ -431,4 +431,7 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/ia64/libm.abilist b/sysdeps/unix/sysv/linux/ia64/libm.abilist
index 017b0f9f7a..134ac93610 100644
--- a/sysdeps/unix/sysv/linux/ia64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libm.abilist
@@ -360,4 +360,7 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
index 26d9cc674b..df07c0813f 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
@@ -75,6 +75,9 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
 GLIBC_2.4 _LIB_VERSION D 0x4
 GLIBC_2.4 __clog10 F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
index 945d51e325..92330262a5 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
@@ -429,4 +429,7 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/microblaze/libm.abilist b/sysdeps/unix/sysv/linux/microblaze/libm.abilist
index deb4189844..c2e2341007 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libm.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libm.abilist
@@ -386,3 +386,6 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
index ceb12918e9..0711143030 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
@@ -388,6 +388,9 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
 GLIBC_2.4 exp2l F
 _gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
index 003fe7b567..8a8c95b529 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
@@ -420,4 +420,7 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/nios2/libm.abilist b/sysdeps/unix/sysv/linux/nios2/libm.abilist
index d57c3ebc1c..c0c94ac4fd 100644
--- a/sysdeps/unix/sysv/linux/nios2/libm.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libm.abilist
@@ -386,3 +386,6 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
index b22ec56740..2bec6c63b4 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
@@ -431,6 +431,9 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
 GLIBC_2.4 __clog10l F
 GLIBC_2.4 __finitel F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
index 777a39d0e1..4e04409a83 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
@@ -430,6 +430,9 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
 GLIBC_2.4 __clog10l F
 GLIBC_2.4 __finitel F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist
index 1b900c7144..1a30becc27 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist
@@ -425,3 +425,6 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist
index 0a8600e29d..015a1149f2 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist
@@ -106,6 +106,9 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.3 GLIBC_2.3 A
 GLIBC_2.3 _LIB_VERSION D 0x4
 GLIBC_2.3 __clog10 F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
index d7fff5327f..0c2c3e90a4 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
@@ -418,6 +418,9 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
 GLIBC_2.4 __clog10l F
 GLIBC_2.4 __finitel F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
index 4d682e604f..d192753020 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
@@ -416,6 +416,9 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
 GLIBC_2.4 __clog10l F
 GLIBC_2.4 __finitel F
diff --git a/sysdeps/unix/sysv/linux/sh/libm.abilist b/sysdeps/unix/sysv/linux/sh/libm.abilist
index 0092b62a24..3f6a29622c 100644
--- a/sysdeps/unix/sysv/linux/sh/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libm.abilist
@@ -387,5 +387,8 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
 GLIBC_2.4 exp2l F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
index 4ad593cbae..739a06134a 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
@@ -421,6 +421,9 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
 GLIBC_2.4 __clog10l F
 GLIBC_2.4 __finitel F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
index 90a2bd57ed..80fd387a32 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
@@ -419,4 +419,7 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist
index 5d502c0bc8..6154ee8980 100644
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist
@@ -387,3 +387,6 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist
index 5d502c0bc8..6154ee8980 100644
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist
@@ -387,3 +387,6 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist
index 5d502c0bc8..6154ee8980 100644
--- a/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist
+++ b/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist
@@ -387,3 +387,6 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
index 3364b0271d..9b2c5abfe6 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
@@ -420,4 +420,7 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
 GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
index 6a3a3ce0ca..a93e4837e6 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
@@ -419,3 +419,6 @@ GLIBC_2.25 fegetmode F
 GLIBC_2.25 fesetexcept F
 GLIBC_2.25 fesetmode F
 GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F