jjames / rpms / crlibm

Forked from rpms/crlibm 4 months ago
Clone
Blob Blame Raw
--- crlibm-eb30637/log10-td.c.orig	2016-01-04 07:59:09.000000000 -0700
+++ crlibm-eb30637/log10-td.c	2019-07-11 10:20:23.785394133 -0600
@@ -200,10 +200,10 @@ void log10_td_accurate(double *logb10h,
    /* Filter cases */
    if (xdb.i[HI] < 0x00100000){        /* x < 2^(-1022)    */
      if (((xdb.i[HI] & 0x7fffffff)|xdb.i[LO])==0){
-       return -1.0/0.0;     
+       return -__builtin_inf();     
      }                    		   /* log(+/-0) = -Inf */
      if (xdb.i[HI] < 0){ 
-       return (x-x)/0;                      /* log(-x) = Nan    */
+       return __builtin_nan("");           /* log(-x) = Nan    */
      }
      /* Subnormal number */
      E = -52; 		
@@ -385,10 +385,10 @@ void log10_td_accurate(double *logb10h,
    /* Filter cases */
    if (xdb.i[HI] < 0x00100000){        /* x < 2^(-1022)    */
      if (((xdb.i[HI] & 0x7fffffff)|xdb.i[LO])==0){
-       return -1.0/0.0;     
+       return -__builtin_inf();     
      }                    		   /* log(+/-0) = -Inf */
      if (xdb.i[HI] < 0){ 
-       return (x-x)/0;                      /* log(-x) = Nan    */
+       return __builtin_nan("");           /* log(-x) = Nan    */
      }
      /* Subnormal number */
      E = -52; 		
@@ -565,10 +565,10 @@ void log10_td_accurate(double *logb10h,
    /* Filter cases */
    if (xdb.i[HI] < 0x00100000){        /* x < 2^(-1022)    */
      if (((xdb.i[HI] & 0x7fffffff)|xdb.i[LO])==0){
-       return -1.0/0.0;     
+       return -__builtin_inf();     
      }                    		   /* log(+/-0) = -Inf */
      if (xdb.i[HI] < 0){ 
-       return (x-x)/0;                      /* log(-x) = Nan    */
+       return __builtin_nan("");           /* log(-x) = Nan    */
      }
      /* Subnormal number */
      E = -52; 		
@@ -743,10 +743,10 @@ void log10_td_accurate(double *logb10h,
    /* Filter cases */
    if (xdb.i[HI] < 0x00100000){        /* x < 2^(-1022)    */
      if (((xdb.i[HI] & 0x7fffffff)|xdb.i[LO])==0){
-       return -1.0/0.0;     
+       return -__builtin_inf();     
      }                    		   /* log(+/-0) = -Inf */
      if (xdb.i[HI] < 0){ 
-       return (x-x)/0;                      /* log(-x) = Nan    */
+       return __builtin_nan("");           /* log(-x) = Nan    */
      }
      /* Subnormal number */
      E = -52; 		
--- crlibm-eb30637/log2-td.c.orig	2016-01-04 07:59:09.000000000 -0700
+++ crlibm-eb30637/log2-td.c	2019-07-11 10:22:35.584115598 -0600
@@ -182,10 +182,10 @@ void log2_td_accurate(double *logb2h, do
    /* Filter cases */
    if (xdb.i[HI] < 0x00100000){        /* x < 2^(-1022)    */
      if (((xdb.i[HI] & 0x7fffffff)|xdb.i[LO])==0){
-       return -1.0/0.0;     
+       return -__builtin_inf();     
      }                    		   /* log(+/-0) = -Inf */
      if (xdb.i[HI] < 0){ 
-       return (x-x)/0;                      /* log(-x) = Nan    */
+       return __builtin_nan("");           /* log(-x) = Nan    */
      }
      /* Subnormal number */
      E = -52; 		
@@ -368,10 +368,10 @@ void log2_td_accurate(double *logb2h, do
    /* Filter cases */
    if (xdb.i[HI] < 0x00100000){        /* x < 2^(-1022)    */
      if (((xdb.i[HI] & 0x7fffffff)|xdb.i[LO])==0){
-       return -1.0/0.0;     
+       return -__builtin_inf();     
      }                    		   /* log(+/-0) = -Inf */
      if (xdb.i[HI] < 0){ 
-       return (x-x)/0;                      /* log(-x) = Nan    */
+       return __builtin_nan("");           /* log(-x) = Nan    */
      }
      /* Subnormal number */
      E = -52; 		
@@ -565,10 +565,10 @@ void log2_td_accurate(double *logb2h, do
    /* Filter cases */
    if (xdb.i[HI] < 0x00100000){        /* x < 2^(-1022)    */
      if (((xdb.i[HI] & 0x7fffffff)|xdb.i[LO])==0){
-       return -1.0/0.0;     
+       return -__builtin_inf();     
      }                    		   /* log(+/-0) = -Inf */
      if (xdb.i[HI] < 0){ 
-       return (x-x)/0;                      /* log(-x) = Nan    */
+       return __builtin_nan("");           /* log(-x) = Nan    */
      }
      /* Subnormal number */
      E = -52; 		
@@ -760,10 +760,10 @@ void log2_td_accurate(double *logb2h, do
    /* Filter cases */
    if (xdb.i[HI] < 0x00100000){        /* x < 2^(-1022)    */
      if (((xdb.i[HI] & 0x7fffffff)|xdb.i[LO])==0){
-       return -1.0/0.0;     
+       return -__builtin_inf();     
      }                    		   /* log(+/-0) = -Inf */
      if (xdb.i[HI] < 0){ 
-       return (x-x)/0;                      /* log(-x) = Nan    */
+       return __builtin_nan("");           /* log(-x) = Nan    */
      }
      /* Subnormal number */
      E = -52; 		
@@ -969,11 +969,11 @@ void log2_td_accurate(double *logb2h, do
    if (xdb_inf.i[HI] < 0x00100000){        /* x < 2^(-1022)    */
      if (((xdb_inf.i[HI] & 0x7fffffff)|xdb_inf.i[LO])==0){
        infDone=1;
-       restemp_inf = -1.0/0.0;     
+       restemp_inf = -__builtin_inf();     
      }                    		   /* log(+/-0) = -Inf */
      if ((xdb_inf.i[HI] < 0) && (infDone==0)){ 
        infDone=1;
-       restemp_inf = (x_inf-x_inf)/0;                      /* log(-x) = Nan    */
+       restemp_inf = __builtin_nan("");    /* log(-x) = Nan    */
      }
      /* Subnormal number */
      E_inf = -52; 		
@@ -989,11 +989,11 @@ void log2_td_accurate(double *logb2h, do
    if (xdb_sup.i[HI] < 0x00100000){        /* x < 2^(-1022)    */
      if (((xdb_sup.i[HI] & 0x7fffffff)|xdb_sup.i[LO])==0){
        supDone=1;
-       restemp_sup = -1.0/0.0;     
+       restemp_sup = -__builtin_inf();     
      }                    		   /* log(+/-0) = -Inf */
      if ((xdb_sup.i[HI] < 0) && (supDone==0)){ 
        supDone=1;
-       restemp_sup = (x_sup-x_sup)/0;                      /* log(-x) = Nan    */
+       restemp_sup = __builtin_nan("");    /* log(-x) = Nan    */
      }
      /* Subnormal number */
      E_sup = -52; 		
--- crlibm-eb30637/log-de.c.orig	2016-01-04 07:59:09.000000000 -0700
+++ crlibm-eb30637/log-de.c	2019-07-11 10:18:16.304598021 -0600
@@ -105,8 +105,8 @@ double log_rn(double x) {
 
    /* Filter cases */
    if (xdb.i[HI] < 0x00100000){        /* x < 2^(-1022)    */
-     if (((xdb.i[HI] & 0x7fffffff)|xdb.i[LO])==0)    return -1.0/0.0;  /* log(+/-0) = -Inf */
-     if (xdb.i[HI] < 0)                              return (x-x)/0;   /* log(-x) = Nan    */
+     if (((xdb.i[HI] & 0x7fffffff)|xdb.i[LO])==0)    return -__builtin_inf();  /* log(+/-0) = -Inf */
+     if (xdb.i[HI] < 0)                              return __builtin_nan(""); /* log(-x) = Nan    */
      /* Else subnormal number */
      xdb.d *= two64; 	  /* make x a normal number    */ 
      E = -64 + (xdb.i[HI]>>20)-1023;             /* extract the exponent */
@@ -136,8 +136,8 @@ double log_rn(double x) {
 
    /* Filter special cases */
    if (i<(int64_t)ULL(0010000000000000)){   /* equivalent to : x < 2^(-1022)    */
-     if ((i & ULL(7fffffffffffffff))==0)  return -1.0/0.0;    /* log(+/-0) = -Inf */
-     if (i<0)                             return (x-x)/0;     /* log(-x) = Nan    */
+     if ((i & ULL(7fffffffffffffff))==0)  return -__builtin_inf();    /* log(+/-0) = -Inf */
+     if (i<0)                             return __builtin_nan("");   /* log(-x) = Nan    */
      /* Else subnormal number */
      y *= two64; 	  /* make x a normal number    */ 
      E = -64;
@@ -239,8 +239,8 @@ double log_rd(double x) {
 
    /* Filter cases */
    if (xdb.i[HI] < 0x00100000){        /* x < 2^(-1022)    */
-     if (((xdb.i[HI] & 0x7fffffff)|xdb.i[LO])==0)    return -1.0/0.0;  /* log(+/-0) = -Inf */
-     if (xdb.i[HI] < 0)                              return (x-x)/0;   /* log(-x) = Nan    */
+     if (((xdb.i[HI] & 0x7fffffff)|xdb.i[LO])==0)    return -__builtin_inf();  /* log(+/-0) = -Inf */
+     if (xdb.i[HI] < 0)                              return __builtin_nan(""); /* log(-x) = Nan    */
      /* Else subnormal number */
      E = -64; 		
      xdb.d *= two64; 	  /* make x a normal number    */ 
@@ -269,8 +269,8 @@ double log_rd(double x) {
 
    /* Filter special cases */
    if (i<(int64_t)ULL(0010000000000000)){   /* equivalent to : x < 2^(-1022)    */
-     if ((i & ULL(7fffffffffffffff))==0)  return -1.0/0.0;    /* log(+/-0) = -Inf */
-     if (i<0)                             return (x-x)/0;     /* log(-x) = Nan    */
+     if ((i & ULL(7fffffffffffffff))==0)  return -__builtin_inf();  /* log(+/-0) = -Inf */
+     if (i<0)                             return __builtin_nan(""); /* log(-x) = Nan    */
      /* Else subnormal number */
      y *= two64; 	  /* make x a normal number    */ 
      E = -64;
@@ -366,8 +366,8 @@ double log_ru(double x) {
 
    /* Filter cases */
    if (xdb.i[HI] < 0x00100000){        /* x < 2^(-1022)    */
-     if (((xdb.i[HI] & 0x7fffffff)|xdb.i[LO])==0)    return -1.0/0.0;  /* log(+/-0) = -Inf */
-     if (xdb.i[HI] < 0)                              return (x-x)/0;   /* log(-x) = Nan    */
+     if (((xdb.i[HI] & 0x7fffffff)|xdb.i[LO])==0)    return -__builtin_inf();  /* log(+/-0) = -Inf */
+     if (xdb.i[HI] < 0)                              return __builtin_nan(""); /* log(-x) = Nan    */
      /* Else subnormal number */
      E = -64; 		
      xdb.d *= two64; 	  /* make x a normal number    */ 
@@ -398,8 +398,8 @@ double log_ru(double x) {
 
    /* Filter special cases */
    if (i<(int64_t)ULL(0010000000000000)){   /* equivalent to : x < 2^(-1022)    */
-     if ((i & ULL(7fffffffffffffff))==0)  return -1.0/0.0;    /* log(+/-0) = -Inf */
-     if (i<0)                             return (x-x)/0;     /* log(-x) = Nan    */
+     if ((i & ULL(7fffffffffffffff))==0)  return -__builtin_inf();  /* log(+/-0) = -Inf */
+     if (i<0)                             return __builtin_nan(""); /* log(-x) = Nan    */
      /* Else subnormal number */
      y *= two64; 	  /* make x a normal number    */ 
      E = -64;