lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 1fd91fbf 10/22: Rename high- and low-word mac


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 1fd91fbf 10/22: Rename high- and low-word macros
Date: Fri, 20 May 2022 22:43:42 -0400 (EDT)

branch: master
commit 1fd91fbf4d7d97784d19818a3e45a6dbef94878c
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Rename high- and low-word macros
---
 fdlibm_expm1.c.txt | 30 +++++++++++++++---------------
 fdlibm_log1p.c.txt | 26 +++++++++++++-------------
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/fdlibm_expm1.c.txt b/fdlibm_expm1.c.txt
index f3bee8b2..bc00d625 100644
--- a/fdlibm_expm1.c.txt
+++ b/fdlibm_expm1.c.txt
@@ -20,15 +20,15 @@
 #endif // big endian
 
 #if defined __LITTLE_ENDIAN
-#define __HI(x) *(1+(int*)&x)
-#define __LO(x) *(int*)&x
-#define __HIp(x) *(1+(int*)x)
-#define __LOp(x) *(int*)x
+#define FDLIBM_HI(x) *(1+(int*)&x)
+#define FDLIBM_LO(x) *(int*)&x
+#define FDLIBM_HIp(x) *(1+(int*)x)
+#define FDLIBM_LOp(x) *(int*)x
 #else  // !defined __LITTLE_ENDIAN
-#define __HI(x) *(int*)&x
-#define __LO(x) *(1+(int*)&x)
-#define __HIp(x) *(int*)x
-#define __LOp(x) *(1+(int*)x)
+#define FDLIBM_HI(x) *(int*)&x
+#define FDLIBM_LO(x) *(1+(int*)&x)
+#define FDLIBM_HIp(x) *(int*)x
+#define FDLIBM_LOp(x) *(1+(int*)x)
 #endif // !defined __LITTLE_ENDIAN
 
 #if defined __STDC__
@@ -220,7 +220,7 @@ Q5  =  -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */
     int k,xsb;
     unsigned hx;
 
-    hx  = __HI(x);              /* high word of x */
+    hx  = FDLIBM_HI(x);         /* high word of x */
     xsb = hx&0x80000000;        /* sign bit of x */
     if(xsb==0) y=x; else y= -x; /* y = |x| */
     hx &= 0x7fffffff;           /* high word of |x| */
@@ -229,7 +229,7 @@ Q5  =  -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */
     if(hx >= 0x4043687A) {      /* if |x|>=56*ln2 */
         if(hx >= 0x40862E42) {  /* if |x|>=709.78... */
           if(hx>=0x7ff00000) {
-            if(((hx&0xfffff)|__LO(x))!=0)
+            if(((hx&0xfffff)|FDLIBM_LO(x))!=0)
                  return x+x;    /* NaN */
             else return (xsb==0)? x:-1.0;/* exp(+-inf)={inf,-1} */
           }
@@ -279,19 +279,19 @@ Q5  =  -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D 
*/
             else           return  one+2.0*(x-e);
         if (k <= -2 || k>56) {     /* suffice to return exp(x)-1 */
             y = one-(e-x);
-            __HI(y) += (k<<20);    /* add k to y's exponent */
+            FDLIBM_HI(y) += (k<<20); /* add k to y's exponent */
             return y-one;
         }
         t = one;
         if(k<20) {
-               __HI(t) = 0x3ff00000 - (0x200000>>k);  /* t=1-2^-k */
+               FDLIBM_HI(t) = 0x3ff00000 - (0x200000>>k);  /* t=1-2^-k */
                y = t-(e-x);
-               __HI(y) += (k<<20); /* add k to y's exponent */
+               FDLIBM_HI(y) += (k<<20); /* add k to y's exponent */
         } else {
-               __HI(t)  = ((0x3ff-k)<<20);    /* 2^-k */
+               FDLIBM_HI(t)  = ((0x3ff-k)<<20);    /* 2^-k */
                y = x-(e+t);
                y += one;
-               __HI(y) += (k<<20); /* add k to y's exponent */
+               FDLIBM_HI(y) += (k<<20); /* add k to y's exponent */
         }
     }
     return y;
diff --git a/fdlibm_log1p.c.txt b/fdlibm_log1p.c.txt
index 36435295..76b62a1f 100644
--- a/fdlibm_log1p.c.txt
+++ b/fdlibm_log1p.c.txt
@@ -20,15 +20,15 @@
 #endif // big endian
 
 #if defined __LITTLE_ENDIAN
-#define __HI(x) *(1+(int*)&x)
-#define __LO(x) *(int*)&x
-#define __HIp(x) *(1+(int*)x)
-#define __LOp(x) *(int*)x
+#define FDLIBM_HI(x) *(1+(int*)&x)
+#define FDLIBM_LO(x) *(int*)&x
+#define FDLIBM_HIp(x) *(1+(int*)x)
+#define FDLIBM_LOp(x) *(int*)x
 #else  // !defined __LITTLE_ENDIAN
-#define __HI(x) *(int*)&x
-#define __LO(x) *(1+(int*)&x)
-#define __HIp(x) *(int*)x
-#define __LOp(x) *(1+(int*)x)
+#define FDLIBM_HI(x) *(int*)&x
+#define FDLIBM_LO(x) *(1+(int*)&x)
+#define FDLIBM_HIp(x) *(int*)x
+#define FDLIBM_LOp(x) *(1+(int*)x)
 #endif // !defined __LITTLE_ENDIAN
 
 #if defined __STDC__
@@ -189,7 +189,7 @@ static double zero = 0.0;
     double hfsq,f,c,s,z,R,u;
     int k,hx,hu,ax;
 
-    hx = __HI(x);        /* high word of x */
+    hx = FDLIBM_HI(x);        /* high word of x */
     ax = hx&0x7fffffff;
 
     k = 1;
@@ -213,22 +213,22 @@ static double zero = 0.0;
     if(k!=0) {
         if(hx<0x43400000) {
             u  = 1.0+x;
-            hu = __HI(u);                       /* high word of u */
+            hu = FDLIBM_HI(u);                  /* high word of u */
             k  = (hu>>20)-1023;
             c  = (k>0)? 1.0-(u-x):x-(u-1.0);/* correction term */
             c /= u;
         } else {
             u  = x;
-            hu = __HI(u);                       /* high word of u */
+            hu = FDLIBM_HI(u);                  /* high word of u */
             k  = (hu>>20)-1023;
             c  = 0;
         }
         hu &= 0x000fffff;
         if(hu<0x6a09e) {
-            __HI(u) = hu|0x3ff00000;            /* normalize u */
+            FDLIBM_HI(u) = hu|0x3ff00000;       /* normalize u */
         } else {
             k += 1;
-            __HI(u) = hu|0x3fe00000;            /* normalize u/2 */
+            FDLIBM_HI(u) = hu|0x3fe00000;       /* normalize u/2 */
             hu = (0x00100000-hu)>>2;
         }
         f = u-1.0;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]