Bug 1272640: Apply meta-patches to fdlibm/; r=arai

MozReview-Commit-ID: 3NNw1d0zF3k

--HG--
extra : rebase_source : e326698dfd32bf4e8734596ffabbfc2b390088c0
This commit is contained in:
Benjamin Bouvier 2016-05-19 16:05:34 +02:00
Родитель 65bc0f401d
Коммит 258bdc0148
5 изменённых файлов: 60 добавлений и 6 удалений

Просмотреть файл

@ -11,7 +11,7 @@ The in-tree copy is updated by running
sh update.sh
from within the modules/fdlibm directory.
Current version: [commit bcea9d50b15e4f0027a5dd526e0e2a612238471e].
Current version: [commit 9e7434b2c5c2ce4f2a9aa3e84de3e7cf33a910d5].
patches 01-14 fixes files to be usable within mozilla-central tree.
See https://bugzilla.mozilla.org/show_bug.cgi?id=933257

Просмотреть файл

@ -34,11 +34,11 @@ double log10(double);
double pow(double, double);
double sqrt(double);
double ceil(double);
float ceilf(float);
double fabs(double);
double floor(double);
double trunc(double);
double ceil(double);
double acosh(double);
double asinh(double);
@ -51,9 +51,10 @@ double log2(double);
double copysign(double, double);
double scalbn(double, int);
double trunc(double);
float floorf(float);
float truncf(float);
float ceilf(float);
} /* namespace fdlibm */

Просмотреть файл

@ -774,6 +774,7 @@ irintl(long double x)
#define copysign fdlibm::copysign
#define scalbn fdlibm::scalbn
#define trunc fdlibm::trunc
#define truncf fdlibm::truncf
#define floorf fdlibm::floorf
/* fdlibm kernel function */

Просмотреть файл

@ -58,7 +58,7 @@ cbrt(double x)
* error of about 1 in 16. Adding a bias of -0.03306235651 to the
* (e%3+m)/3 term reduces the error to about 1 in 32. With the IEEE
* floating point representation, for finite positive normal values,
* ordinary integer divison of the value in bits magically gives
* ordinary integer division of the value in bits magically gives
* almost exactly the RHS of the above provided we first subtract the
* exponent bias (1023 for doubles) and later add it back. We do the
* subtraction virtually to keep e >= 0 so that ordinary integer

Просмотреть файл

@ -0,0 +1,52 @@
/* @(#)s_floor.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* 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$");
/*
* truncf(x)
* Return x rounded toward 0 to integral value
* Method:
* Bit twiddling.
* Exception:
* Inexact flag raised if x not equal to truncf(x).
*/
#include "math_private.h"
static const float huge = 1.0e30F;
float
truncf(float x)
{
int32_t i0,j0;
u_int32_t i;
GET_FLOAT_WORD(i0,x);
j0 = ((i0>>23)&0xff)-0x7f;
if(j0<23) {
if(j0<0) { /* raise inexact if x != 0 */
if(huge+x>0.0F) /* |x|<1, so return 0*sign(x) */
i0 &= 0x80000000;
} else {
i = (0x007fffff)>>j0;
if((i0&i)==0) return x; /* x is integral */
if(huge+x>0.0F) /* raise inexact flag */
i0 &= (~i);
}
} else {
if(j0==0x80) return x+x; /* inf or NaN */
else return x; /* x is integral */
}
SET_FLOAT_WORD(x,i0);
return x;
}