Bug 1888033 - [Menu Redesign] Add a secret setting and feature flag for the menu...
[gecko.git] / modules / fdlibm / patches / 22_add_float_types.patch
blob39b991a4868281f21dcd6e556a239a893dac0ae5
1 diff --git a/math_private.h b/math_private.h
2 --- a/math_private.h
3 +++ b/math_private.h
4 @@ -27,16 +27,17 @@
6 /*
7 * Emulate FreeBSD internal double types.
8 * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
9 */
11 typedef double __double_t;
12 typedef __double_t double_t;
13 +typedef float __float_t;
16 * The original fdlibm code used statements like:
17 * n0 = ((*(int*)&one)>>29)^1; * index of high word *
18 * ix0 = *(n0+(int*)&x); * high word of x *
19 * ix1 = *((1-n0)+(int*)&x); * low word of x *
20 * to dig two 32 bit words out of the 64 bit IEEE floating point
21 * value. That is non-ANSI, and, moreover, the gcc instruction
22 diff --git a/e_rem_pio2f.cpp b/e_rem_pio2f.cpp
23 --- a/e_rem_pio2f.cpp
24 +++ b/e_rem_pio2f.cpp
25 @@ -49,17 +49,17 @@ int
26 double tx[1],ty[1];
27 float z;
28 int32_t e0,n,ix,hx;
30 GET_FLOAT_WORD(hx,x);
31 ix = hx&0x7fffffff;
32 /* 33+53 bit pi is good enough for medium size */
33 if(ix<0x4dc90fdb) { /* |x| ~< 2^28*(pi/2), medium size */
34 - fn = rnint((float_t)x*invpio2);
35 + fn = rnint((float)x*invpio2);
36 n = irint(fn);
37 r = x-fn*pio2_1;
38 w = fn*pio2_1t;
39 *y = r-w;
40 return n;
43 * all other (large) arguments
44 diff --git a/s_scalbnf.cpp b/s_scalbnf.cpp
45 --- a/s_scalbnf.cpp
46 +++ b/s_scalbnf.cpp
47 @@ -7,18 +7,18 @@
48 * for all contributors to musl.
50 #include <stdint.h>
52 #include "math_private.h"
54 float scalbnf(float x, int n)
56 union {float f; uint32_t i;} u;
57 - float_t y = x;
58 + float y = x;
60 if (n > 127) {
61 y *= 0x1p127f;
62 n -= 127;
63 if (n > 127) {
64 y *= 0x1p127f;
65 n -= 127;
66 if (n > 127)