about summary refs log tree commit diff
path: root/sysdeps/ieee754/dbl-64/s_totalordermag.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/dbl-64/s_totalordermag.c')
-rw-r--r--sysdeps/ieee754/dbl-64/s_totalordermag.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_totalordermag.c b/sysdeps/ieee754/dbl-64/s_totalordermag.c
index e6efc387a2..fd8aade28c 100644
--- a/sysdeps/ieee754/dbl-64/s_totalordermag.c
+++ b/sysdeps/ieee754/dbl-64/s_totalordermag.c
@@ -1,4 +1,4 @@
-/* Total order operation on absolute values.  dbl-64 version.
+/* Total order operation on absolute values.
    Copyright (C) 2016-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -18,8 +18,8 @@
 
 #include <math.h>
 #include <math_private.h>
-#include <libm-alias-double.h>
 #include <nan-high-order-bit.h>
+#include <libm-alias-double.h>
 #include <stdint.h>
 #include <shlib-compat.h>
 #include <first-versions.h>
@@ -27,25 +27,23 @@
 int
 __totalordermag (const double *x, const double *y)
 {
-  uint32_t hx, hy;
-  uint32_t lx, ly;
-  EXTRACT_WORDS (hx, lx, *x);
-  EXTRACT_WORDS (hy, ly, *y);
-  hx &= 0x7fffffff;
-  hy &= 0x7fffffff;
+  uint64_t ix, iy;
+  EXTRACT_WORDS64 (ix, *x);
+  EXTRACT_WORDS64 (iy, *y);
+  ix &= 0x7fffffffffffffffULL;
+  iy &= 0x7fffffffffffffffULL;
 #if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
   /* For the preferred quiet NaN convention, this operation is a
      comparison of the representations of the absolute values of the
      arguments.  If both arguments are NaNs, invert the
      quiet/signaling bit so comparing that way works.  */
-  if ((hx > 0x7ff00000 || (hx == 0x7ff00000 && lx != 0))
-      && (hy > 0x7ff00000 || (hy == 0x7ff00000 && ly != 0)))
+  if (ix > 0x7ff0000000000000ULL && iy > 0x7ff0000000000000ULL)
     {
-      hx ^= 0x00080000;
-      hy ^= 0x00080000;
+      ix ^= 0x0008000000000000ULL;
+      iy ^= 0x0008000000000000ULL;
     }
 #endif
-  return hx < hy || (hx == hy && lx <= ly);
+  return ix <= iy;
 }
 #ifdef SHARED
 # define CONCATX(x, y) x ## y