Bug 1303085: updates meta-patches after adding rint/rintf/nearbyint/nearbyintf; r=arai
authorBenjamin Bouvier <benj@benj.me>
Thu, 15 Sep 2016 20:50:09 +0200
changeset 314530 922941564e6a07117bd3d607f509de2dc57eab76
parent 314529 420aea33cee63aed1f69ea80b5876a4b5338ccc3
child 314531 aeef09f7560c6de760dc7d9eb59ccdb5c54240ab
push id81913
push userbbouvier@mozilla.com
push dateTue, 20 Sep 2016 14:24:37 +0000
treeherdermozilla-inbound@922941564e6a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1303085
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1303085: updates meta-patches after adding rint/rintf/nearbyint/nearbyintf; r=arai MozReview-Commit-ID: LLDpA6SplXi
modules/fdlibm/patches/01_remove_unused_declarations_from_fdlibm_h.patch
modules/fdlibm/patches/02_change_include_guard_in_fdlibm_h.patch
modules/fdlibm/patches/03_put_fdlibm_functions_into_fdlibm_namespace.patch
modules/fdlibm/patches/04_include_fdlibm_h_from_math_private_h.patch
modules/fdlibm/patches/07_add_fdlibm_namespace_to_functions_defined_and_used_in_fdlibm.patch
modules/fdlibm/patches/08_remove_weak_reference_macro.patch
modules/fdlibm/patches/09_comment_out_rcsid_variable.patch
modules/fdlibm/patches/15_remove_unused_rintl_function_from_s_nearbyint_cpp.patch
--- a/modules/fdlibm/patches/01_remove_unused_declarations_from_fdlibm_h.patch
+++ b/modules/fdlibm/patches/01_remove_unused_declarations_from_fdlibm_h.patch
@@ -1,12 +1,12 @@
 diff --git a/modules/fdlibm/src/fdlibm.h b/modules/fdlibm/src/fdlibm.h
 --- a/modules/fdlibm/src/fdlibm.h
 +++ b/modules/fdlibm/src/fdlibm.h
-@@ -12,496 +12,46 @@
+@@ -12,496 +12,50 @@
  /*
   * from: @(#)fdlibm.h 5.1 93/09/24
   * $FreeBSD$
   */
  
  #ifndef _MATH_H_
  #define	_MATH_H_
  
@@ -274,47 +274,46 @@ diff --git a/modules/fdlibm/src/fdlibm.h
  double	log2(double);
 -double	logb(double);
 -long	lrint(double);
 -long	lround(double);
 -double	nan(const char *) __pure2;
 -double	nextafter(double, double);
 -double	remainder(double, double);
 -double	remquo(double, double, int *);
--double	rint(double);
+ double	rint(double);
 -#endif /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */
- 
+-
 -#if __BSD_VISIBLE || __XSI_VISIBLE
 -double	j0(double);
 -double	j1(double);
 -double	jn(int, double);
 -double	y0(double);
 -double	y1(double);
 -double	yn(int, double);
-+double	copysign(double, double);
-+double	scalbn(double, int);
- 
+-
 -#if __XSI_VISIBLE <= 500 || __BSD_VISIBLE
 -double	gamma(double);
 -#endif
 -
 -#if __XSI_VISIBLE <= 600 || __BSD_VISIBLE
 -double	scalb(double, double);
 -#endif
 -#endif /* __BSD_VISIBLE || __XSI_VISIBLE */
 -
 -#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999
 -double	copysign(double, double) __pure2;
 -double	fdim(double, double);
 -double	fmax(double, double) __pure2;
 -double	fmin(double, double) __pure2;
--double	nearbyint(double);
++double	copysign(double, double);
+ double	nearbyint(double);
 -double	round(double);
 -double	scalbln(double, long);
--double	scalbn(double, int);
+ double	scalbn(double, int);
 -double	tgamma(double);
 -double	trunc(double);
 -#endif
 -
 -/*
 - * BSD math library entry points
 - */
 -#if __BSD_VISIBLE
@@ -358,25 +357,23 @@ diff --git a/modules/fdlibm/src/fdlibm.h
 -float	log10f(float);
 -float	log1pf(float);
 -float	log2f(float);
 -float	logf(float);
 -float	modff(float, float *);	/* fundamentally !__pure2 */
 -
 -float	powf(float, float);
 -float	sqrtf(float);
--
-+float	floorf(float);
-+float	truncf(float);
+ 
  float	ceilf(float);
 -float	fabsf(float) __pure2;
--float	floorf(float);
+ float	floorf(float);
 -float	fmodf(float, float);
 -float	roundf(float);
--
+ 
 -float	erff(float);
 -float	erfcf(float);
 -float	hypotf(float, float);
 -float	lgammaf(float);
 -float	tgammaf(float);
 -
 -float	acoshf(float);
 -float	asinhf(float);
@@ -384,25 +381,25 @@ diff --git a/modules/fdlibm/src/fdlibm.h
 -float	cbrtf(float);
 -float	logbf(float);
 -float	copysignf(float, float) __pure2;
 -long long llrintf(float);
 -long long llroundf(float);
 -long	lrintf(float);
 -long	lroundf(float);
 -float	nanf(const char *) __pure2;
--float	nearbyintf(float);
+ float	nearbyintf(float);
 -float	nextafterf(float, float);
 -float	remainderf(float, float);
 -float	remquof(float, float, int *);
--float	rintf(float);
+ float	rintf(float);
 -float	scalblnf(float, long);
 -float	scalbnf(float, int);
--float	truncf(float);
--
+ float	truncf(float);
+ 
 -float	fdimf(float, float);
 -float	fmaf(float, float, float);
 -float	fmaxf(float, float) __pure2;
 -float	fminf(float, float) __pure2;
 -#endif
 -
 -/*
 - * float versions of BSD math library entry points
@@ -456,17 +453,17 @@ diff --git a/modules/fdlibm/src/fdlibm.h
 -long double	expm1l(long double);
 -long double	fabsl(long double) __pure2;
 -long double	fdiml(long double, long double);
 -long double	floorl(long double);
 -long double	fmal(long double, long double, long double);
 -long double	fmaxl(long double, long double) __pure2;
 -long double	fminl(long double, long double) __pure2;
 -long double	fmodl(long double, long double);
--long double	frexpl(long double value, int *); /* fundamentally !__pure2 */
+-long double	frexpl(long double, int *); /* fundamentally !__pure2 */
 -long double	hypotl(long double, long double);
 -int		ilogbl(long double) __pure2;
 -long double	ldexpl(long double, int);
 -long double	lgammal(long double);
 -long long	llrintl(long double);
 -long long	llroundl(long double);
 -long double	log10l(long double);
 -long double	log1pl(long double);
@@ -498,10 +495,10 @@ diff --git a/modules/fdlibm/src/fdlibm.h
 -long double	truncl(long double);
 -#endif /* __ISO_C_VISIBLE >= 1999 */
 -
 -#if __BSD_VISIBLE
 -long double	lgammal_r(long double, int *);
 -#endif
 -
 -__END_DECLS
- 
+-
  #endif /* !_MATH_H_ */
--- a/modules/fdlibm/patches/02_change_include_guard_in_fdlibm_h.patch
+++ b/modules/fdlibm/patches/02_change_include_guard_in_fdlibm_h.patch
@@ -17,19 +17,19 @@ diff --git a/modules/fdlibm/src/fdlibm.h
  
  double	acos(double);
  double	asin(double);
  double	atan(double);
  double	atan2(double, double);
  
  double	cosh(double);
  double	sinh(double);
-@@ -49,9 +49,9 @@ double	log2(double);
+@@ -53,9 +53,9 @@ double	scalbn(double, int);
  
- double	copysign(double, double);
- double	scalbn(double, int);
+ float	ceilf(float);
+ float	floorf(float);
  
- float	floorf(float);
+ float	nearbyintf(float);
+ float	rintf(float);
  float	truncf(float);
- float	ceilf(float);
  
 -#endif /* !_MATH_H_ */
 +#endif /* mozilla_imported_fdlibm_h */
--- a/modules/fdlibm/patches/03_put_fdlibm_functions_into_fdlibm_namespace.patch
+++ b/modules/fdlibm/patches/03_put_fdlibm_functions_into_fdlibm_namespace.patch
@@ -15,20 +15,20 @@ diff --git a/modules/fdlibm/src/fdlibm.h
  double	acos(double);
  double	asin(double);
  double	atan(double);
  double	atan2(double, double);
  
  double	cosh(double);
  double	sinh(double);
  double	tanh(double);
-@@ -49,9 +51,11 @@ double	log2(double);
+@@ -53,9 +55,11 @@ double	scalbn(double, int);
  
- double	copysign(double, double);
- double	scalbn(double, int);
+ float	ceilf(float);
+ float	floorf(float);
  
- float	floorf(float);
+ float	nearbyintf(float);
+ float	rintf(float);
  float	truncf(float);
- float	ceilf(float);
  
 +} /* namespace fdlibm */
 +
  #endif /* mozilla_imported_fdlibm_h */
--- a/modules/fdlibm/patches/04_include_fdlibm_h_from_math_private_h.patch
+++ b/modules/fdlibm/patches/04_include_fdlibm_h_from_math_private_h.patch
@@ -561,16 +561,80 @@ diff --git a/modules/fdlibm/src/s_log1p.
  #include "math_private.h"
  
  static const double
  ln2_hi  =  6.93147180369123816490e-01,	/* 3fe62e42 fee00000 */
  ln2_lo  =  1.90821492927058770002e-10,	/* 3dea39ef 35793c76 */
  two54   =  1.80143985094819840000e+16,  /* 43500000 00000000 */
  Lp1 = 6.666666666666735130e-01,  /* 3FE55555 55555593 */
  Lp2 = 3.999999999940941908e-01,  /* 3FD99999 9997FA04 */
+diff --git a/modules/fdlibm/src/s_nearbyint.cpp b/modules/fdlibm/src/s_nearbyint.cpp
+--- a/modules/fdlibm/src/s_nearbyint.cpp
++++ b/modules/fdlibm/src/s_nearbyint.cpp
+@@ -23,17 +23,17 @@
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ 
+ #include <fenv.h>
+-#include <math.h>
++#include "math_private.h"
+ 
+ /*
+  * We save and restore the floating-point environment to avoid raising
+  * an inexact exception.  We can get away with using fesetenv()
+  * instead of feclearexcept()/feupdateenv() to restore the environment
+  * because the only exception defined for rint() is overflow, and
+  * rounding can't overflow as long as emax >= p.
+  *
+diff --git a/modules/fdlibm/src/s_rint.cpp b/modules/fdlibm/src/s_rint.cpp
+--- a/modules/fdlibm/src/s_rint.cpp
++++ b/modules/fdlibm/src/s_rint.cpp
+@@ -20,17 +20,16 @@
+  * Method:
+  *	Using floating addition.
+  * Exception:
+  *	Inexact flag raised if x not equal to rint(x).
+  */
+ 
+ #include <float.h>
+ 
+-#include "math.h"
+ #include "math_private.h"
+ 
+ static const double
+ TWO52[2]={
+   4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
+  -4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
+ };
+ 
+diff --git a/modules/fdlibm/src/s_rintf.cpp b/modules/fdlibm/src/s_rintf.cpp
+--- a/modules/fdlibm/src/s_rintf.cpp
++++ b/modules/fdlibm/src/s_rintf.cpp
+@@ -14,17 +14,16 @@
+  */
+ 
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ 
+ #include <float.h>
+ #include <stdint.h>
+ 
+-#include "math.h"
+ #include "math_private.h"
+ 
+ static const float
+ TWO23[2]={
+   8.3886080000e+06, /* 0x4b000000 */
+  -8.3886080000e+06, /* 0xcb000000 */
+ };
+ 
 diff --git a/modules/fdlibm/src/s_scalbn.cpp b/modules/fdlibm/src/s_scalbn.cpp
 --- a/modules/fdlibm/src/s_scalbn.cpp
 +++ b/modules/fdlibm/src/s_scalbn.cpp
 @@ -19,17 +19,16 @@ static char rcsid[] = "$FreeBSD$";
   * scalbn(x,n) returns x* 2**n  computed by  exponent
   * manipulation rather than by actually performing an
   * exponentiation or a multiplication.
   */
--- a/modules/fdlibm/patches/07_add_fdlibm_namespace_to_functions_defined_and_used_in_fdlibm.patch
+++ b/modules/fdlibm/patches/07_add_fdlibm_namespace_to_functions_defined_and_used_in_fdlibm.patch
@@ -1,12 +1,12 @@
 diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h
 --- a/modules/fdlibm/src/math_private.h
 +++ b/modules/fdlibm/src/math_private.h
-@@ -724,16 +724,47 @@ irintl(long double x)
+@@ -724,16 +724,51 @@ irintl(long double x)
  #define	__ieee754_j1f	j1f
  #define	__ieee754_y0f	y0f
  #define	__ieee754_y1f	y1f
  #define	__ieee754_jnf	jnf
  #define	__ieee754_ynf	ynf
  #define	__ieee754_remainderf remainderf
  #define	__ieee754_scalbf scalbf
  
@@ -35,16 +35,20 @@ diff --git a/modules/fdlibm/src/math_pri
 +#define log1p fdlibm::log1p
 +#define log2 fdlibm::log2
 +#define scalb fdlibm::scalb
 +#define copysign fdlibm::copysign
 +#define scalbn fdlibm::scalbn
 +#define trunc fdlibm::trunc
 +#define truncf fdlibm::truncf
 +#define floorf fdlibm::floorf
++#define nearbyint fdlibm::nearbyint
++#define nearbyintf fdlibm::nearbyintf
++#define rint fdlibm::rint
++#define rintf fdlibm::rintf
 +
  /* fdlibm kernel function */
  int	__kernel_rem_pio2(double*,double*,int,int,int);
  
  /* double precision kernel functions */
  #ifndef INLINE_REM_PIO2
  int	__ieee754_rem_pio2(double,double*);
  #endif
--- a/modules/fdlibm/patches/08_remove_weak_reference_macro.patch
+++ b/modules/fdlibm/patches/08_remove_weak_reference_macro.patch
@@ -321,16 +321,32 @@ diff --git a/modules/fdlibm/src/s_log1p.
  	R = z*(Lp1+z*(Lp2+z*(Lp3+z*(Lp4+z*(Lp5+z*(Lp6+z*Lp7))))));
  	if(k==0) return f-(hfsq-s*(hfsq+R)); else
  		 return k*ln2_hi-((hfsq-(s*(hfsq+R)+(k*ln2_lo+c)))-f);
  }
 -
 -#if (LDBL_MANT_DIG == 53)
 -__weak_reference(log1p, log1pl);
 -#endif
+diff --git a/modules/fdlibm/src/s_rint.cpp b/modules/fdlibm/src/s_rint.cpp
+--- a/modules/fdlibm/src/s_rint.cpp
++++ b/modules/fdlibm/src/s_rint.cpp
+@@ -80,12 +80,8 @@ rint(double x)
+ 	    if((i1&i)==0) return x;	/* x is integral */
+ 	    i>>=1;
+ 	    if((i1&i)!=0) i1 = (i1&(~i))|((0x40000000)>>(j0-20));
+ 	}
+ 	INSERT_WORDS(x,i0,i1);
+ 	STRICT_ASSIGN(double,w,TWO52[sx]+x);
+ 	return w-TWO52[sx];
+ }
+-
+-#if (LDBL_MANT_DIG == 53)
+-__weak_reference(rint, rintl);
+-#endif
 diff --git a/modules/fdlibm/src/s_scalbn.cpp b/modules/fdlibm/src/s_scalbn.cpp
 --- a/modules/fdlibm/src/s_scalbn.cpp
 +++ b/modules/fdlibm/src/s_scalbn.cpp
 @@ -53,13 +53,8 @@ scalbn (double x, int n)
          if (k <= -54)
              if (n > 50000) 	/* in case integer overflow in n+k */
  		return huge*copysign(huge,x);	/*overflow*/
  	    else return tiny*copysign(tiny,x); 	/*underflow*/
--- a/modules/fdlibm/patches/09_comment_out_rcsid_variable.patch
+++ b/modules/fdlibm/patches/09_comment_out_rcsid_variable.patch
@@ -665,16 +665,88 @@ diff --git a/modules/fdlibm/src/s_log1p.
  
  /* double log1p(double x)
   *
   * Method :
   *   1. Argument Reduction: find k and f such that
   *			1+x = 2^k * (1+f),
   *	   where  sqrt(2)/2 < 1+f < sqrt(2) .
   *
+diff --git a/modules/fdlibm/src/s_nearbyint.cpp b/modules/fdlibm/src/s_nearbyint.cpp
+--- a/modules/fdlibm/src/s_nearbyint.cpp
++++ b/modules/fdlibm/src/s_nearbyint.cpp
+@@ -19,18 +19,18 @@
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+-__FBSDID("$FreeBSD$");
++//#include <sys/cdefs.h>
++//__FBSDID("$FreeBSD$");
+ 
+ #include <fenv.h>
+ #include "math_private.h"
+ 
+ /*
+  * We save and restore the floating-point environment to avoid raising
+  * an inexact exception.  We can get away with using fesetenv()
+  * instead of feclearexcept()/feupdateenv() to restore the environment
+diff --git a/modules/fdlibm/src/s_rint.cpp b/modules/fdlibm/src/s_rint.cpp
+--- a/modules/fdlibm/src/s_rint.cpp
++++ b/modules/fdlibm/src/s_rint.cpp
+@@ -5,18 +5,18 @@
+  *
+  * Developed at SunPro, a Sun Microsystems, Inc. business.
+  * Permission to use, copy, modify, and distribute this
+  * software is freely granted, provided that this notice
+  * is preserved.
+  * ====================================================
+  */
+ 
+-#include <sys/cdefs.h>
+-__FBSDID("$FreeBSD$");
++//#include <sys/cdefs.h>
++//__FBSDID("$FreeBSD$");
+ 
+ /*
+  * rint(x)
+  * Return x rounded to integral value according to the prevailing
+  * rounding mode.
+  * Method:
+  *	Using floating addition.
+  * Exception:
+diff --git a/modules/fdlibm/src/s_rintf.cpp b/modules/fdlibm/src/s_rintf.cpp
+--- a/modules/fdlibm/src/s_rintf.cpp
++++ b/modules/fdlibm/src/s_rintf.cpp
+@@ -8,18 +8,18 @@
+  *
+  * Developed at SunPro, a Sun Microsystems, Inc. business.
+  * Permission to use, copy, modify, and distribute this
+  * software is freely granted, provided that this notice
+  * is preserved.
+  * ====================================================
+  */
+ 
+-#include <sys/cdefs.h>
+-__FBSDID("$FreeBSD$");
++//#include <sys/cdefs.h>
++//__FBSDID("$FreeBSD$");
+ 
+ #include <float.h>
+ #include <stdint.h>
+ 
+ #include "math_private.h"
+ 
+ static const float
+ TWO23[2]={
 diff --git a/modules/fdlibm/src/s_scalbn.cpp b/modules/fdlibm/src/s_scalbn.cpp
 --- a/modules/fdlibm/src/s_scalbn.cpp
 +++ b/modules/fdlibm/src/s_scalbn.cpp
 @@ -6,27 +6,27 @@
   * Developed at SunPro, a Sun Microsystems, Inc. business.
   * Permission to use, copy, modify, and distribute this
   * software is freely granted, provided that this notice
   * is preserved.
new file mode 100644
--- /dev/null
+++ b/modules/fdlibm/patches/15_remove_unused_rintl_function_from_s_nearbyint_cpp.patch
@@ -0,0 +1,13 @@
+diff --git a/modules/fdlibm/src/s_nearbyint.cpp b/modules/fdlibm/src/s_nearbyint.cpp
+--- a/modules/fdlibm/src/s_nearbyint.cpp
++++ b/modules/fdlibm/src/s_nearbyint.cpp
+@@ -51,9 +51,8 @@ fn(type x)			\
+ 	fegetenv(&env);		\
+ 	ret = rint(x);		\
+ 	fesetenv(&env);		\
+ 	return (ret);		\
+ }
+ 
+ DECL(double, nearbyint, rint)
+ DECL(float, nearbyintf, rintf)
+-DECL(long double, nearbyintl, rintl)