Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/arch Another microoptimization. Take advantage of ...



details:   https://anonhg.NetBSD.org/src/rev/2c991c91ca90
branches:  trunk
changeset: 475949:2c991c91ca90
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Mon Aug 30 18:28:24 1999 +0000

description:
Another microoptimization.  Take advantage of the addition already having set
the flags for the <=0 comparison.

diffstat:

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

diffs (truncated from 364 to 300 lines):

diff -r 90f67169fa65 -r 2c991c91ca90 lib/libc/arch/alpha/gen/ldexp.c
--- a/lib/libc/arch/alpha/gen/ldexp.c   Mon Aug 30 18:01:40 1999 +0000
+++ b/lib/libc/arch/alpha/gen/ldexp.c   Mon Aug 30 18:28:24 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldexp.c,v 1.8 1999/08/30 18:01:40 mycroft Exp $        */
+/*     $NetBSD: ldexp.c,v 1.9 1999/08/30 18:28:24 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.8 1999/08/30 18:01:40 mycroft Exp $");
+__RCSID("$NetBSD: ldexp.c,v 1.9 1999/08/30 18:28:24 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -111,16 +111,7 @@
         */
        newexp = oldexp + exp;
 
-       if (newexp >= DBL_EXP_INFNAN) {
-               /*
-                * The result overflowed; return +/-Inf.
-                */
-               u.s.dbl_exp = DBL_EXP_INFNAN;
-               u.s.dbl_frach = 0;
-               u.s.dbl_fracl = 0;
-               errno = ERANGE;
-               return (u.v);
-       } else if (newexp <= 0) {
+       if (newexp <= 0) {
                /*
                 * The output number is either denormal or underflows (see
                 * comments in machine/ieee.h).
@@ -143,6 +134,15 @@
                mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                u.v *= mul.v;
                return (u.v);
+       } else if (newexp >= DBL_EXP_INFNAN) {
+               /*
+                * The result overflowed; return +/-Inf.
+                */
+               u.s.dbl_exp = DBL_EXP_INFNAN;
+               u.s.dbl_frach = 0;
+               u.s.dbl_fracl = 0;
+               errno = ERANGE;
+               return (u.v);
        } else {
                /*
                 * The result is normal; just replace the old exponent with the
diff -r 90f67169fa65 -r 2c991c91ca90 lib/libc/arch/arm32/gen/ldexp.c
--- a/lib/libc/arch/arm32/gen/ldexp.c   Mon Aug 30 18:01:40 1999 +0000
+++ b/lib/libc/arch/arm32/gen/ldexp.c   Mon Aug 30 18:28:24 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldexp.c,v 1.11 1999/08/30 18:01:41 mycroft Exp $       */
+/*     $NetBSD: ldexp.c,v 1.12 1999/08/30 18:28:25 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.11 1999/08/30 18:01:41 mycroft Exp $");
+__RCSID("$NetBSD: ldexp.c,v 1.12 1999/08/30 18:28:25 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -111,16 +111,7 @@
         */
        newexp = oldexp + exp;
 
-       if (newexp >= DBL_EXP_INFNAN) {
-               /*
-                * The result overflowed; return +/-Inf.
-                */
-               u.s.dbl_exp = DBL_EXP_INFNAN;
-               u.s.dbl_frach = 0;
-               u.s.dbl_fracl = 0;
-               errno = ERANGE;
-               return (u.v);
-       } else if (newexp <= 0) {
+       if (newexp <= 0) {
                /*
                 * The output number is either denormal or underflows (see
                 * comments in machine/ieee.h).
@@ -143,6 +134,15 @@
                mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                u.v *= mul.v;
                return (u.v);
+       } else if (newexp >= DBL_EXP_INFNAN) {
+               /*
+                * The result overflowed; return +/-Inf.
+                */
+               u.s.dbl_exp = DBL_EXP_INFNAN;
+               u.s.dbl_frach = 0;
+               u.s.dbl_fracl = 0;
+               errno = ERANGE;
+               return (u.v);
        } else {
                /*
                 * The result is normal; just replace the old exponent with the
diff -r 90f67169fa65 -r 2c991c91ca90 lib/libc/arch/m68k/gen/ldexp_040.c
--- a/lib/libc/arch/m68k/gen/ldexp_040.c        Mon Aug 30 18:01:40 1999 +0000
+++ b/lib/libc/arch/m68k/gen/ldexp_040.c        Mon Aug 30 18:28:24 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldexp_040.c,v 1.5 1999/08/30 18:01:41 mycroft Exp $    */
+/*     $NetBSD: ldexp_040.c,v 1.6 1999/08/30 18:28:25 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.5 1999/08/30 18:01:41 mycroft Exp $");
+__RCSID("$NetBSD: ldexp_040.c,v 1.6 1999/08/30 18:28:25 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -111,16 +111,7 @@
         */
        newexp = oldexp + exp;
 
-       if (newexp >= DBL_EXP_INFNAN) {
-               /*
-                * The result overflowed; return +/-Inf.
-                */
-               u.s.dbl_exp = DBL_EXP_INFNAN;
-               u.s.dbl_frach = 0;
-               u.s.dbl_fracl = 0;
-               errno = ERANGE;
-               return (u.v);
-       } else if (newexp <= 0) {
+       if (newexp <= 0) {
                /*
                 * The output number is either denormal or underflows (see
                 * comments in machine/ieee.h).
@@ -143,6 +134,15 @@
                mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                u.v *= mul.v;
                return (u.v);
+       } else if (newexp >= DBL_EXP_INFNAN) {
+               /*
+                * The result overflowed; return +/-Inf.
+                */
+               u.s.dbl_exp = DBL_EXP_INFNAN;
+               u.s.dbl_frach = 0;
+               u.s.dbl_fracl = 0;
+               errno = ERANGE;
+               return (u.v);
        } else {
                /*
                 * The result is normal; just replace the old exponent with the
diff -r 90f67169fa65 -r 2c991c91ca90 lib/libc/arch/ns32k/gen/ldexp.c
--- a/lib/libc/arch/ns32k/gen/ldexp.c   Mon Aug 30 18:01:40 1999 +0000
+++ b/lib/libc/arch/ns32k/gen/ldexp.c   Mon Aug 30 18:28:24 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldexp.c,v 1.4 1999/08/30 18:01:41 mycroft Exp $        */
+/*     $NetBSD: ldexp.c,v 1.5 1999/08/30 18:28:26 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.4 1999/08/30 18:01:41 mycroft Exp $");
+__RCSID("$NetBSD: ldexp.c,v 1.5 1999/08/30 18:28:26 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -111,16 +111,7 @@
         */
        newexp = oldexp + exp;
 
-       if (newexp >= DBL_EXP_INFNAN) {
-               /*
-                * The result overflowed; return +/-Inf.
-                */
-               u.s.dbl_exp = DBL_EXP_INFNAN;
-               u.s.dbl_frach = 0;
-               u.s.dbl_fracl = 0;
-               errno = ERANGE;
-               return (u.v);
-       } else if (newexp <= 0) {
+       if (newexp <= 0) {
                /*
                 * The output number is either denormal or underflows (see
                 * comments in machine/ieee.h).
@@ -143,6 +134,15 @@
                mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                u.v *= mul.v;
                return (u.v);
+       } else if (newexp >= DBL_EXP_INFNAN) {
+               /*
+                * The result overflowed; return +/-Inf.
+                */
+               u.s.dbl_exp = DBL_EXP_INFNAN;
+               u.s.dbl_frach = 0;
+               u.s.dbl_fracl = 0;
+               errno = ERANGE;
+               return (u.v);
        } else {
                /*
                 * The result is normal; just replace the old exponent with the
diff -r 90f67169fa65 -r 2c991c91ca90 lib/libc/arch/powerpc/gen/ldexp.c
--- a/lib/libc/arch/powerpc/gen/ldexp.c Mon Aug 30 18:01:40 1999 +0000
+++ b/lib/libc/arch/powerpc/gen/ldexp.c Mon Aug 30 18:28:24 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldexp.c,v 1.8 1999/08/30 18:01:41 mycroft Exp $        */
+/*     $NetBSD: ldexp.c,v 1.9 1999/08/30 18:28:26 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.8 1999/08/30 18:01:41 mycroft Exp $");
+__RCSID("$NetBSD: ldexp.c,v 1.9 1999/08/30 18:28:26 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -111,16 +111,7 @@
         */
        newexp = oldexp + exp;
 
-       if (newexp >= DBL_EXP_INFNAN) {
-               /*
-                * The result overflowed; return +/-Inf.
-                */
-               u.s.dbl_exp = DBL_EXP_INFNAN;
-               u.s.dbl_frach = 0;
-               u.s.dbl_fracl = 0;
-               errno = ERANGE;
-               return (u.v);
-       } else if (newexp <= 0) {
+       if (newexp <= 0) {
                /*
                 * The output number is either denormal or underflows (see
                 * comments in machine/ieee.h).
@@ -143,6 +134,15 @@
                mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                u.v *= mul.v;
                return (u.v);
+       } else if (newexp >= DBL_EXP_INFNAN) {
+               /*
+                * The result overflowed; return +/-Inf.
+                */
+               u.s.dbl_exp = DBL_EXP_INFNAN;
+               u.s.dbl_frach = 0;
+               u.s.dbl_fracl = 0;
+               errno = ERANGE;
+               return (u.v);
        } else {
                /*
                 * The result is normal; just replace the old exponent with the
diff -r 90f67169fa65 -r 2c991c91ca90 lib/libc/arch/sparc/gen/ldexp.c
--- a/lib/libc/arch/sparc/gen/ldexp.c   Mon Aug 30 18:01:40 1999 +0000
+++ b/lib/libc/arch/sparc/gen/ldexp.c   Mon Aug 30 18:28:24 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldexp.c,v 1.8 1999/08/30 18:01:41 mycroft Exp $        */
+/*     $NetBSD: ldexp.c,v 1.9 1999/08/30 18:28:26 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.8 1999/08/30 18:01:41 mycroft Exp $");
+__RCSID("$NetBSD: ldexp.c,v 1.9 1999/08/30 18:28:26 mycroft Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -111,16 +111,7 @@
         */
        newexp = oldexp + exp;
 
-       if (newexp >= DBL_EXP_INFNAN) {
-               /*
-                * The result overflowed; return +/-Inf.
-                */
-               u.s.dbl_exp = DBL_EXP_INFNAN;
-               u.s.dbl_frach = 0;
-               u.s.dbl_fracl = 0;
-               errno = ERANGE;
-               return (u.v);
-       } else if (newexp <= 0) {
+       if (newexp <= 0) {
                /*
                 * The output number is either denormal or underflows (see
                 * comments in machine/ieee.h).
@@ -143,6 +134,15 @@
                mul.s.dbl_exp = exp + DBL_EXP_BIAS;
                u.v *= mul.v;
                return (u.v);



Home | Main Index | Thread Index | Old Index