mailing list of musl libc
 help / color / mirror / code / Atom feed
* Re: [updated/fixed] Patches for math subtree
@ 2019-12-10 16:56 Stefan Kanthak
  2019-12-11  9:37 ` Szabolcs Nagy
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Kanthak @ 2019-12-10 16:56 UTC (permalink / raw)
  To: musl

> Just some optimisations.

JFTR: I'm NOT subscribed to your mailing list, so CC: me in replies!

[ Patch for remquo unchanged ]

--- -/src/math/ceil.c
+++ +/src/math/ceil.c
@@ -18,10 +18,10 @@
+        /* special case because of non-nearest rounding modes */
+        if (e < 0x3ff) {
+                FORCE_EVAL(x + toint);
+                return u.i >> 63 ? -0.0 : 1.0;
+        }
         /* y = int(x) - x, where int(x) is an integer neighbor of x */
         if (u.i >> 63)
                 y = x - toint + toint - x;
         else
                 y = x + toint - toint - x;
-        /* special case because of non-nearest rounding modes */
-        if (e <= 0x3ff-1) {
-                FORCE_EVAL(y);
-                return u.i >> 63 ? -0.0 : 1;
-        }

--- -/src/math/floor.c
+++ +/src/math/floor.c
@@ -18,10 +18,10 @@
+        /* special case because of non-nearest rounding modes */
+        if (e < 0x3ff) {
+                 FORCE_EVAL(x + toint);
+                 return u.i >> 63 ? -1.0 : 0.0;
+        }
         /* y = int(x) - x, where int(x) is an integer neighbor of x */
         if (u.i >> 63)
                 y = x - toint + toint - x;
         else
                 y = x + toint - toint - x;
-        /* special case because of non-nearest rounding modes */
-        if (e <= 0x3ff-1) {
-                 FORCE_EVAL(y);
-                 return u.i >> 63 ? -1 : 0;
-        }



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-11  9:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 16:56 [updated/fixed] Patches for math subtree Stefan Kanthak
2019-12-11  9:37 ` Szabolcs Nagy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).