Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/arch Reuse the trick of loading 0.0 (rather than 1....



details:   https://anonhg.NetBSD.org/src/rev/90f67169fa65
branches:  trunk
changeset: 475948:90f67169fa65
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Mon Aug 30 18:01:40 1999 +0000

description:
Reuse the trick of loading 0.0 (rather than 1.0) and then modifying the
exponent.  It's a bit faster on some machines.

diffstat:

 lib/libc/arch/alpha/gen/ldexp.c    |  10 +++++-----
 lib/libc/arch/arm32/gen/ldexp.c    |  10 +++++-----
 lib/libc/arch/m68k/gen/ldexp_040.c |  10 +++++-----
 lib/libc/arch/ns32k/gen/ldexp.c    |  10 +++++-----
 lib/libc/arch/powerpc/gen/ldexp.c  |  10 +++++-----
 lib/libc/arch/sparc/gen/ldexp.c    |  10 +++++-----
 lib/libc/arch/sparc64/gen/ldexp.c  |  10 +++++-----
 7 files changed, 35 insertions(+), 35 deletions(-)

diffs (truncated from 315 to 300 lines):

diff -r 5bc9d0e339d9 -r 90f67169fa65 lib/libc/arch/alpha/gen/ldexp.c
--- a/lib/libc/arch/alpha/gen/ldexp.c   Mon Aug 30 17:06:33 1999 +0000
+++ b/lib/libc/arch/alpha/gen/ldexp.c   Mon Aug 30 18:01:40 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldexp.c,v 1.7 1999/08/30 15:11:32 augustss Exp $       */
+/*     $NetBSD: ldexp.c,v 1.8 1999/08/30 18:01:40 mycroft Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: ldexp.c,v 1.7 1999/08/30 15:11:32 augustss Exp $");
+__RCSID("$NetBSD: ldexp.c,v 1.8 1999/08/30 18:01:40 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -83,7 +83,7 @@
                                errno = ERANGE;
                                return (0.0);
                        }
-                       mul.v = 1.0;
+                       mul.v = 0.0;
                        mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                        u.v *= mul.v;
                        if (u.v == 0.0) {
@@ -97,7 +97,7 @@
                         * result cannot be denormal (though it may be Inf).
                         * Shift u.v by just enough to make it normal.
                         */
-                       mul.v = 1.0;
+                       mul.v = 0.0;
                        mul.s.dbl_exp = DBL_FRACBITS + DBL_EXP_BIAS;
                        u.v *= mul.v;
                        exp -= DBL_FRACBITS;
@@ -139,7 +139,7 @@
                        u.s.dbl_exp = 1;
                        exp += oldexp - 1;
                }
-               mul.v = 1.0;
+               mul.v = 0.0;
                mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                u.v *= mul.v;
                return (u.v);
diff -r 5bc9d0e339d9 -r 90f67169fa65 lib/libc/arch/arm32/gen/ldexp.c
--- a/lib/libc/arch/arm32/gen/ldexp.c   Mon Aug 30 17:06:33 1999 +0000
+++ b/lib/libc/arch/arm32/gen/ldexp.c   Mon Aug 30 18:01:40 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldexp.c,v 1.10 1999/08/30 12:14:09 augustss Exp $      */
+/*     $NetBSD: ldexp.c,v 1.11 1999/08/30 18:01:41 mycroft Exp $       */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: ldexp.c,v 1.10 1999/08/30 12:14:09 augustss Exp $");
+__RCSID("$NetBSD: ldexp.c,v 1.11 1999/08/30 18:01:41 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -83,7 +83,7 @@
                                errno = ERANGE;
                                return (0.0);
                        }
-                       mul.v = 1.0;
+                       mul.v = 0.0;
                        mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                        u.v *= mul.v;
                        if (u.v == 0.0) {
@@ -97,7 +97,7 @@
                         * result cannot be denormal (though it may be Inf).
                         * Shift u.v by just enough to make it normal.
                         */
-                       mul.v = 1.0;
+                       mul.v = 0.0;
                        mul.s.dbl_exp = DBL_FRACBITS + DBL_EXP_BIAS;
                        u.v *= mul.v;
                        exp -= DBL_FRACBITS;
@@ -139,7 +139,7 @@
                        u.s.dbl_exp = 1;
                        exp += oldexp - 1;
                }
-               mul.v = 1.0;
+               mul.v = 0.0;
                mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                u.v *= mul.v;
                return (u.v);
diff -r 5bc9d0e339d9 -r 90f67169fa65 lib/libc/arch/m68k/gen/ldexp_040.c
--- a/lib/libc/arch/m68k/gen/ldexp_040.c        Mon Aug 30 17:06:33 1999 +0000
+++ b/lib/libc/arch/m68k/gen/ldexp_040.c        Mon Aug 30 18:01:40 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldexp_040.c,v 1.4 1999/08/30 16:48:07 mycroft Exp $    */
+/*     $NetBSD: ldexp_040.c,v 1.5 1999/08/30 18:01:41 mycroft Exp $    */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: ldexp_040.c,v 1.4 1999/08/30 16:48:07 mycroft Exp $");
+__RCSID("$NetBSD: ldexp_040.c,v 1.5 1999/08/30 18:01:41 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -83,7 +83,7 @@
                                errno = ERANGE;
                                return (0.0);
                        }
-                       mul.v = 1.0;
+                       mul.v = 0.0;
                        mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                        u.v *= mul.v;
                        if (u.v == 0.0) {
@@ -97,7 +97,7 @@
                         * result cannot be denormal (though it may be Inf).
                         * Shift u.v by just enough to make it normal.
                         */
-                       mul.v = 1.0;
+                       mul.v = 0.0;
                        mul.s.dbl_exp = DBL_FRACBITS + DBL_EXP_BIAS;
                        u.v *= mul.v;
                        exp -= DBL_FRACBITS;
@@ -139,7 +139,7 @@
                        u.s.dbl_exp = 1;
                        exp += oldexp - 1;
                }
-               mul.v = 1.0;
+               mul.v = 0.0;
                mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                u.v *= mul.v;
                return (u.v);
diff -r 5bc9d0e339d9 -r 90f67169fa65 lib/libc/arch/ns32k/gen/ldexp.c
--- a/lib/libc/arch/ns32k/gen/ldexp.c   Mon Aug 30 17:06:33 1999 +0000
+++ b/lib/libc/arch/ns32k/gen/ldexp.c   Mon Aug 30 18:01:40 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldexp.c,v 1.3 1999/08/30 15:11:33 augustss Exp $       */
+/*     $NetBSD: ldexp.c,v 1.4 1999/08/30 18:01:41 mycroft Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: ldexp.c,v 1.3 1999/08/30 15:11:33 augustss Exp $");
+__RCSID("$NetBSD: ldexp.c,v 1.4 1999/08/30 18:01:41 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -83,7 +83,7 @@
                                errno = ERANGE;
                                return (0.0);
                        }
-                       mul.v = 1.0;
+                       mul.v = 0.0;
                        mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                        u.v *= mul.v;
                        if (u.v == 0.0) {
@@ -97,7 +97,7 @@
                         * result cannot be denormal (though it may be Inf).
                         * Shift u.v by just enough to make it normal.
                         */
-                       mul.v = 1.0;
+                       mul.v = 0.0;
                        mul.s.dbl_exp = DBL_FRACBITS + DBL_EXP_BIAS;
                        u.v *= mul.v;
                        exp -= DBL_FRACBITS;
@@ -139,7 +139,7 @@
                        u.s.dbl_exp = 1;
                        exp += oldexp - 1;
                }
-               mul.v = 1.0;
+               mul.v = 0.0;
                mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                u.v *= mul.v;
                return (u.v);
diff -r 5bc9d0e339d9 -r 90f67169fa65 lib/libc/arch/powerpc/gen/ldexp.c
--- a/lib/libc/arch/powerpc/gen/ldexp.c Mon Aug 30 17:06:33 1999 +0000
+++ b/lib/libc/arch/powerpc/gen/ldexp.c Mon Aug 30 18:01:40 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldexp.c,v 1.7 1999/08/30 15:11:33 augustss Exp $       */
+/*     $NetBSD: ldexp.c,v 1.8 1999/08/30 18:01:41 mycroft Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: ldexp.c,v 1.7 1999/08/30 15:11:33 augustss Exp $");
+__RCSID("$NetBSD: ldexp.c,v 1.8 1999/08/30 18:01:41 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -83,7 +83,7 @@
                                errno = ERANGE;
                                return (0.0);
                        }
-                       mul.v = 1.0;
+                       mul.v = 0.0;
                        mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                        u.v *= mul.v;
                        if (u.v == 0.0) {
@@ -97,7 +97,7 @@
                         * result cannot be denormal (though it may be Inf).
                         * Shift u.v by just enough to make it normal.
                         */
-                       mul.v = 1.0;
+                       mul.v = 0.0;
                        mul.s.dbl_exp = DBL_FRACBITS + DBL_EXP_BIAS;
                        u.v *= mul.v;
                        exp -= DBL_FRACBITS;
@@ -139,7 +139,7 @@
                        u.s.dbl_exp = 1;
                        exp += oldexp - 1;
                }
-               mul.v = 1.0;
+               mul.v = 0.0;
                mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                u.v *= mul.v;
                return (u.v);
diff -r 5bc9d0e339d9 -r 90f67169fa65 lib/libc/arch/sparc/gen/ldexp.c
--- a/lib/libc/arch/sparc/gen/ldexp.c   Mon Aug 30 17:06:33 1999 +0000
+++ b/lib/libc/arch/sparc/gen/ldexp.c   Mon Aug 30 18:01:40 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldexp.c,v 1.7 1999/08/30 15:11:33 augustss Exp $       */
+/*     $NetBSD: ldexp.c,v 1.8 1999/08/30 18:01:41 mycroft Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: ldexp.c,v 1.7 1999/08/30 15:11:33 augustss Exp $");
+__RCSID("$NetBSD: ldexp.c,v 1.8 1999/08/30 18:01:41 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -83,7 +83,7 @@
                                errno = ERANGE;
                                return (0.0);
                        }
-                       mul.v = 1.0;
+                       mul.v = 0.0;
                        mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                        u.v *= mul.v;
                        if (u.v == 0.0) {
@@ -97,7 +97,7 @@
                         * result cannot be denormal (though it may be Inf).
                         * Shift u.v by just enough to make it normal.
                         */
-                       mul.v = 1.0;
+                       mul.v = 0.0;
                        mul.s.dbl_exp = DBL_FRACBITS + DBL_EXP_BIAS;
                        u.v *= mul.v;
                        exp -= DBL_FRACBITS;
@@ -139,7 +139,7 @@
                        u.s.dbl_exp = 1;
                        exp += oldexp - 1;
                }
-               mul.v = 1.0;
+               mul.v = 0.0;
                mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                u.v *= mul.v;
                return (u.v);
diff -r 5bc9d0e339d9 -r 90f67169fa65 lib/libc/arch/sparc64/gen/ldexp.c
--- a/lib/libc/arch/sparc64/gen/ldexp.c Mon Aug 30 17:06:33 1999 +0000
+++ b/lib/libc/arch/sparc64/gen/ldexp.c Mon Aug 30 18:01:40 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldexp.c,v 1.6 1999/08/30 15:11:33 augustss Exp $       */
+/*     $NetBSD: ldexp.c,v 1.7 1999/08/30 18:01:42 mycroft Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: ldexp.c,v 1.6 1999/08/30 15:11:33 augustss Exp $");
+__RCSID("$NetBSD: ldexp.c,v 1.7 1999/08/30 18:01:42 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -83,7 +83,7 @@
                                errno = ERANGE;
                                return (0.0);
                        }
-                       mul.v = 1.0;
+                       mul.v = 0.0;
                        mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                        u.v *= mul.v;
                        if (u.v == 0.0) {
@@ -97,7 +97,7 @@
                         * result cannot be denormal (though it may be Inf).
                         * Shift u.v by just enough to make it normal.



Home | Main Index | Thread Index | Old Index