Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ff4d7edc
Commit
ff4d7edc
authored
Jun 14, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Import pow implementation from musl.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9d2de96d
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
412 additions
and
115 deletions
+412
-115
Makefile.in
dlls/crtdll/Makefile.in
+0
-1
Makefile.in
dlls/msvcr100/Makefile.in
+0
-1
Makefile.in
dlls/msvcr110/Makefile.in
+0
-1
Makefile.in
dlls/msvcr120/Makefile.in
+0
-1
Makefile.in
dlls/msvcr70/Makefile.in
+0
-1
Makefile.in
dlls/msvcr71/Makefile.in
+0
-1
Makefile.in
dlls/msvcr80/Makefile.in
+0
-1
Makefile.in
dlls/msvcr90/Makefile.in
+0
-1
Makefile.in
dlls/msvcrt/Makefile.in
+0
-1
math.c
dlls/msvcrt/math.c
+412
-11
unixlib.c
dlls/msvcrt/unixlib.c
+0
-64
unixlib.h
dlls/msvcrt/unixlib.h
+0
-29
Makefile.in
dlls/msvcrtd/Makefile.in
+0
-1
Makefile.in
dlls/ucrtbase/Makefile.in
+0
-1
No files found.
dlls/crtdll/Makefile.in
View file @
ff4d7edc
...
...
@@ -33,5 +33,4 @@ C_SRCS = \
thread.c
\
time.c
\
undname.c
\
unixlib.c
\
wcs.c
dlls/msvcr100/Makefile.in
View file @
ff4d7edc
...
...
@@ -39,7 +39,6 @@ C_SRCS = \
thread.c
\
time.c
\
undname.c
\
unixlib.c
\
wcs.c
RC_SRCS
=
rsrc.rc
dlls/msvcr110/Makefile.in
View file @
ff4d7edc
...
...
@@ -39,5 +39,4 @@ C_SRCS = \
thread.c
\
time.c
\
undname.c
\
unixlib.c
\
wcs.c
dlls/msvcr120/Makefile.in
View file @
ff4d7edc
...
...
@@ -39,5 +39,4 @@ C_SRCS = \
thread.c
\
time.c
\
undname.c
\
unixlib.c
\
wcs.c
dlls/msvcr70/Makefile.in
View file @
ff4d7edc
...
...
@@ -38,5 +38,4 @@ C_SRCS = \
thread.c
\
time.c
\
undname.c
\
unixlib.c
\
wcs.c
dlls/msvcr71/Makefile.in
View file @
ff4d7edc
...
...
@@ -38,5 +38,4 @@ C_SRCS = \
thread.c
\
time.c
\
undname.c
\
unixlib.c
\
wcs.c
dlls/msvcr80/Makefile.in
View file @
ff4d7edc
...
...
@@ -38,7 +38,6 @@ C_SRCS = \
thread.c
\
time.c
\
undname.c
\
unixlib.c
\
wcs.c
RC_SRCS
=
msvcr80.rc
dlls/msvcr90/Makefile.in
View file @
ff4d7edc
...
...
@@ -38,7 +38,6 @@ C_SRCS = \
thread.c
\
time.c
\
undname.c
\
unixlib.c
\
wcs.c
RC_SRCS
=
msvcr90.rc
dlls/msvcrt/Makefile.in
View file @
ff4d7edc
...
...
@@ -43,7 +43,6 @@ C_SRCS = \
thread.c
\
time.c
\
undname.c
\
unixlib.c
\
wcs.c
RC_SRCS
=
\
...
...
dlls/msvcrt/math.c
View file @
ff4d7edc
...
...
@@ -45,7 +45,6 @@
#include "msvcrt.h"
#include "winternl.h"
#include "unixlib.h"
#include "wine/asm.h"
#include "wine/debug.h"
...
...
@@ -3564,21 +3563,423 @@ double CDECL log10( double x )
return
val_lo
+
val_hi
;
}
/* Compute y+TAIL = log(x) where the rounded result is y and TAIL has about
additional 15 bits precision. IX is the bit representation of x, but
normalized in the subnormal range using the sign bit for the exponent. */
static
double
pow_log
(
UINT64
ix
,
double
*
tail
)
{
static
const
struct
{
double
invc
,
logc
,
logctail
;
}
T
[]
=
{
{
0x1
.
6
a00000000000p
+
0
,
-
0x1
.
62
c82f2b9c800p
-
2
,
0x1
.
ab42428375680p
-
48
},
{
0x1
.
6800000000000
p
+
0
,
-
0x1
.
5
d1bdbf580800p
-
2
,
-
0x1
.
ca508d8e0f720p
-
46
},
{
0x1
.
6600000000000
p
+
0
,
-
0x1
.
5767717455800
p
-
2
,
-
0x1
.
362
a4d5b6506dp
-
45
},
{
0x1
.
6400000000000
p
+
0
,
-
0x1
.
51
aad872df800p
-
2
,
-
0x1
.684e49
eb067d5p
-
49
},
{
0x1
.
6200000000000
p
+
0
,
-
0x1
.
4
be5f95777800p
-
2
,
-
0x1
.
41
b6993293ee0p
-
47
},
{
0x1
.
6000000000000
p
+
0
,
-
0x1
.
4618
bc21c6000p
-
2
,
0x1
.
3
d82f484c84ccp
-
46
},
{
0x1
.5e00000000000
p
+
0
,
-
0x1
.
404308686
a800p
-
2
,
0x1
.
c42f3ed820b3ap
-
50
},
{
0x1
.
5
c00000000000p
+
0
,
-
0x1
.
3
a64c55694800p
-
2
,
0x1
.
0
b1c686519460p
-
45
},
{
0x1
.
5
a00000000000p
+
0
,
-
0x1
.
347
dd9a988000p
-
2
,
0x1
.
5594
dd4c58092p
-
45
},
{
0x1
.
5800000000000
p
+
0
,
-
0x1
.2e8
e2bae12000p
-
2
,
0x1
.
67
b1e99b72bd8p
-
45
},
{
0x1
.
5600000000000
p
+
0
,
-
0x1
.
2895
a13de8800p
-
2
,
0x1
.
5
ca14b6cfb03fp
-
46
},
{
0x1
.
5600000000000
p
+
0
,
-
0x1
.
2895
a13de8800p
-
2
,
0x1
.
5
ca14b6cfb03fp
-
46
},
{
0x1
.
5400000000000
p
+
0
,
-
0x1
.
22941
fbcf7800p
-
2
,
-
0x1
.
65
a242853da76p
-
46
},
{
0x1
.
5200000000000
p
+
0
,
-
0x1
.
1
c898c1699800p
-
2
,
-
0x1
.
fafbc68e75404p
-
46
},
{
0x1
.
5000000000000
p
+
0
,
-
0x1
.
1675
cababa800p
-
2
,
0x1
.
f1fc63382a8f0p
-
46
},
{
0x1
.4e00000000000
p
+
0
,
-
0x1
.
1058
bf9ae4800p
-
2
,
-
0x1
.
6
a8c4fd055a66p
-
45
},
{
0x1
.
4
c00000000000p
+
0
,
-
0x1
.
0
a324e2739000p
-
2
,
-
0x1
.
c6bee7ef4030ep
-
47
},
{
0x1
.
4
a00000000000p
+
0
,
-
0x1
.
04025
94
b4d000p
-
2
,
-
0x1
.
036
b89ef42d7fp
-
48
},
{
0x1
.
4
a00000000000p
+
0
,
-
0x1
.
04025
94
b4d000p
-
2
,
-
0x1
.
036
b89ef42d7fp
-
48
},
{
0x1
.
4800000000000
p
+
0
,
-
0x1
.
fb9186d5e4000p
-
3
,
0x1
.
d572aab993c87p
-
47
},
{
0x1
.
4600000000000
p
+
0
,
-
0x1
.
ef0adcbdc6000p
-
3
,
0x1
.
b26b79c86af24p
-
45
},
{
0x1
.
4400000000000
p
+
0
,
-
0x1
.
e27076e2af000p
-
3
,
-
0x1
.
72
f4f543fff10p
-
46
},
{
0x1
.
4200000000000
p
+
0
,
-
0x1
.
d5c216b4fc000p
-
3
,
0x1
.
1
ba91bbca681bp
-
45
},
{
0x1
.
4000000000000
p
+
0
,
-
0x1
.
c8ff7c79aa000p
-
3
,
0x1
.
7794
f689f8434p
-
45
},
{
0x1
.
4000000000000
p
+
0
,
-
0x1
.
c8ff7c79aa000p
-
3
,
0x1
.
7794
f689f8434p
-
45
},
{
0x1
.3e00000000000
p
+
0
,
-
0x1
.
bc286742d9000p
-
3
,
0x1
.
94
eb0318bb78fp
-
46
},
{
0x1
.
3
c00000000000p
+
0
,
-
0x1
.
af3c94e80c000p
-
3
,
0x1
.
a4e633fcd9066p
-
52
},
{
0x1
.
3
a00000000000p
+
0
,
-
0x1
.
a23bc1fe2b000p
-
3
,
-
0x1
.
58
c64dc46c1eap
-
45
},
{
0x1
.
3
a00000000000p
+
0
,
-
0x1
.
a23bc1fe2b000p
-
3
,
-
0x1
.
58
c64dc46c1eap
-
45
},
{
0x1
.
3800000000000
p
+
0
,
-
0x1
.
9525
a9cf45000p
-
3
,
-
0x1
.
ad1d904c1d4e3p
-
45
},
{
0x1
.
3600000000000
p
+
0
,
-
0x1
.
87
fa06520d000p
-
3
,
0x1
.
bbdbf7fdbfa09p
-
45
},
{
0x1
.
3400000000000
p
+
0
,
-
0x1
.
7
ab890210e000p
-
3
,
0x1
.
bdb9072534a58p
-
45
},
{
0x1
.
3400000000000
p
+
0
,
-
0x1
.
7
ab890210e000p
-
3
,
0x1
.
bdb9072534a58p
-
45
},
{
0x1
.
3200000000000
p
+
0
,
-
0x1
.
6
d60fe719d000p
-
3
,
-
0x1
.0e46
aa3b2e266p
-
46
},
{
0x1
.
3000000000000
p
+
0
,
-
0x1
.
5
ff3070a79000p
-
3
,
-
0x1
.
e9e439f105039p
-
46
},
{
0x1
.
3000000000000
p
+
0
,
-
0x1
.
5
ff3070a79000p
-
3
,
-
0x1
.
e9e439f105039p
-
46
},
{
0x1
.2e00000000000
p
+
0
,
-
0x1
.526e5
e3a1b000p
-
3
,
-
0x1
.
0
de8b90075b8fp
-
45
},
{
0x1
.
2
c00000000000p
+
0
,
-
0x1
.
44
d2b6ccb8000p
-
3
,
0x1
.
70
cc16135783cp
-
46
},
{
0x1
.
2
c00000000000p
+
0
,
-
0x1
.
44
d2b6ccb8000p
-
3
,
0x1
.
70
cc16135783cp
-
46
},
{
0x1
.
2
a00000000000p
+
0
,
-
0x1
.
371
fc201e9000p
-
3
,
0x1
.
178864
d27543ap
-
48
},
{
0x1
.
2800000000000
p
+
0
,
-
0x1
.
29552
f81ff000p
-
3
,
-
0x1
.
48
d301771c408p
-
45
},
{
0x1
.
2600000000000
p
+
0
,
-
0x1
.
1
b72ad52f6000p
-
3
,
-
0x1
.
e80a41811a396p
-
45
},
{
0x1
.
2600000000000
p
+
0
,
-
0x1
.
1
b72ad52f6000p
-
3
,
-
0x1
.
e80a41811a396p
-
45
},
{
0x1
.
2400000000000
p
+
0
,
-
0x1
.
0
d77e7cd09000p
-
3
,
0x1
.
a699688e85bf4p
-
47
},
{
0x1
.
2400000000000
p
+
0
,
-
0x1
.
0
d77e7cd09000p
-
3
,
0x1
.
a699688e85bf4p
-
47
},
{
0x1
.
2200000000000
p
+
0
,
-
0x1
.
fec9131dbe000p
-
4
,
-
0x1
.
575545
ca333f2p
-
45
},
{
0x1
.
2000000000000
p
+
0
,
-
0x1
.
e27076e2b0000p
-
4
,
0x1
.
a342c2af0003cp
-
45
},
{
0x1
.
2000000000000
p
+
0
,
-
0x1
.
e27076e2b0000p
-
4
,
0x1
.
a342c2af0003cp
-
45
},
{
0x1
.1e00000000000
p
+
0
,
-
0x1
.
c5e548f5bc000p
-
4
,
-
0x1
.
d0c57585fbe06p
-
46
},
{
0x1
.
1
c00000000000p
+
0
,
-
0x1
.
a926d3a4ae000p
-
4
,
0x1
.53935e85
baac8p
-
45
},
{
0x1
.
1
c00000000000p
+
0
,
-
0x1
.
a926d3a4ae000p
-
4
,
0x1
.53935e85
baac8p
-
45
},
{
0x1
.
1
a00000000000p
+
0
,
-
0x1
.
8
c345d631a000p
-
4
,
0x1
.
37
c294d2f5668p
-
46
},
{
0x1
.
1
a00000000000p
+
0
,
-
0x1
.
8
c345d631a000p
-
4
,
0x1
.
37
c294d2f5668p
-
46
},
{
0x1
.
1800000000000
p
+
0
,
-
0x1
.
6
f0d28ae56000p
-
4
,
-
0x1
.
69737
c93373dap
-
45
},
{
0x1
.
1600000000000
p
+
0
,
-
0x1
.
51
b073f062000p
-
4
,
0x1
.
f025b61c65e57p
-
46
},
{
0x1
.
1600000000000
p
+
0
,
-
0x1
.
51
b073f062000p
-
4
,
0x1
.
f025b61c65e57p
-
46
},
{
0x1
.
1400000000000
p
+
0
,
-
0x1
.
341
d7961be000p
-
4
,
0x1
.
c5edaccf913dfp
-
45
},
{
0x1
.
1400000000000
p
+
0
,
-
0x1
.
341
d7961be000p
-
4
,
0x1
.
c5edaccf913dfp
-
45
},
{
0x1
.
1200000000000
p
+
0
,
-
0x1
.
16536
eea38000p
-
4
,
0x1
.
47
c5e768fa309p
-
46
},
{
0x1
.
1000000000000
p
+
0
,
-
0x1
.
f0a30c0118000p
-
5
,
0x1
.
d599e83368e91p
-
45
},
{
0x1
.
1000000000000
p
+
0
,
-
0x1
.
f0a30c0118000p
-
5
,
0x1
.
d599e83368e91p
-
45
},
{
0x1
.0e00000000000
p
+
0
,
-
0x1
.
b42dd71198000p
-
5
,
0x1
.
c827ae5d6704cp
-
46
},
{
0x1
.0e00000000000
p
+
0
,
-
0x1
.
b42dd71198000p
-
5
,
0x1
.
c827ae5d6704cp
-
46
},
{
0x1
.
0
c00000000000p
+
0
,
-
0x1
.
77458
f632c000p
-
5
,
-
0x1
.
cfc4634f2a1eep
-
45
},
{
0x1
.
0
c00000000000p
+
0
,
-
0x1
.
77458
f632c000p
-
5
,
-
0x1
.
cfc4634f2a1eep
-
45
},
{
0x1
.
0
a00000000000p
+
0
,
-
0x1
.39e87
b9fec000p
-
5
,
0x1
.
502
b7f526feaap
-
48
},
{
0x1
.
0
a00000000000p
+
0
,
-
0x1
.39e87
b9fec000p
-
5
,
0x1
.
502
b7f526feaap
-
48
},
{
0x1
.
0800000000000
p
+
0
,
-
0x1
.
f829b0e780000p
-
6
,
-
0x1
.
980267
c7e09e4p
-
45
},
{
0x1
.
0800000000000
p
+
0
,
-
0x1
.
f829b0e780000p
-
6
,
-
0x1
.
980267
c7e09e4p
-
45
},
{
0x1
.
0600000000000
p
+
0
,
-
0x1
.
7
b91b07d58000p
-
6
,
-
0x1
.
88
d5493faa639p
-
45
},
{
0x1
.
0400000000000
p
+
0
,
-
0x1
.
fc0a8b0fc0000p
-
7
,
-
0x1
.
f1e7cf6d3a69cp
-
50
},
{
0x1
.
0400000000000
p
+
0
,
-
0x1
.
fc0a8b0fc0000p
-
7
,
-
0x1
.
f1e7cf6d3a69cp
-
50
},
{
0x1
.
0200000000000
p
+
0
,
-
0x1
.
fe02a6b100000p
-
8
,
-
0x1
.9e23
f0dda40e4p
-
46
},
{
0x1
.
0200000000000
p
+
0
,
-
0x1
.
fe02a6b100000p
-
8
,
-
0x1
.9e23
f0dda40e4p
-
46
},
{
0x1
.
0000000000000
p
+
0
,
0x0
.
0000000000000
p
+
0
,
0x0
.
0000000000000
p
+
0
},
{
0x1
.
0000000000000
p
+
0
,
0x0
.
0000000000000
p
+
0
,
0x0
.
0000000000000
p
+
0
},
{
0x1
.
fc00000000000p
-
1
,
0x1
.
0101575
890000
p
-
7
,
-
0x1
.
0
c76b999d2be8p
-
46
},
{
0x1
.
f800000000000p
-
1
,
0x1
.
020565
8938000
p
-
6
,
-
0x1
.
3
dc5b06e2f7d2p
-
45
},
{
0x1
.
f400000000000p
-
1
,
0x1
.
8492528
c90000p
-
6
,
-
0x1
.
aa0ba325a0c34p
-
45
},
{
0x1
.
f000000000000p
-
1
,
0x1
.
0415
d89e74000p
-
5
,
0x1
.
111
c05cf1d753p
-
47
},
{
0x1
.
ec00000000000p
-
1
,
0x1
.
466
aed42e0000p
-
5
,
-
0x1
.
c167375bdfd28p
-
45
},
{
0x1
.
e800000000000p
-
1
,
0x1
.
894
aa149fc000p
-
5
,
-
0x1
.
97995
d05a267dp
-
46
},
{
0x1
.
e400000000000p
-
1
,
0x1
.
ccb73cdddc000p
-
5
,
-
0x1
.
a68f247d82807p
-
46
},
{
0x1
.
e200000000000p
-
1
,
0x1
.
eea31c006c000p
-
5
,
-
0x1
.
e113e4fc93b7bp
-
47
},
{
0x1
.
de00000000000p
-
1
,
0x1
.
1973
bd1466000p
-
4
,
-
0x1
.
5325
d560d9e9bp
-
45
},
{
0x1
.
da00000000000p
-
1
,
0x1
.
3
bdf5a7d1e000p
-
4
,
0x1
.
cc85ea5db4ed7p
-
45
},
{
0x1
.
d600000000000p
-
1
,
0x1
.5e95
a4d97a000p
-
4
,
-
0x1
.
c69063c5d1d1ep
-
45
},
{
0x1
.
d400000000000p
-
1
,
0x1
.
700
d30aeac000p
-
4
,
0x1
.
c1e8da99ded32p
-
49
},
{
0x1
.
d000000000000p
-
1
,
0x1
.9335e5
d594000p
-
4
,
0x1
.
3115
c3abd47dap
-
45
},
{
0x1
.
cc00000000000p
-
1
,
0x1
.
b6ac88dad6000p
-
4
,
-
0x1
.
390802
bf768e5p
-
46
},
{
0x1
.
ca00000000000p
-
1
,
0x1
.
c885801bc4000p
-
4
,
0x1
.
646
d1c65aacd3p
-
45
},
{
0x1
.
c600000000000p
-
1
,
0x1
.
ec739830a2000p
-
4
,
-
0x1
.
dc068afe645e0p
-
45
},
{
0x1
.
c400000000000p
-
1
,
0x1
.
fe89139dbe000p
-
4
,
-
0x1
.
534
d64fa10afdp
-
45
},
{
0x1
.
c000000000000p
-
1
,
0x1
.1178e8227
e000p
-
3
,
0x1
.
1
ef78ce2d07f2p
-
45
},
{
0x1
.
be00000000000p
-
1
,
0x1
.
1
aa2b7e23f000p
-
3
,
0x1
.
ca78e44389934p
-
45
},
{
0x1
.
ba00000000000p
-
1
,
0x1
.
2
d1610c868000p
-
3
,
0x1
.
39
d6ccb81b4a1p
-
47
},
{
0x1
.
b800000000000p
-
1
,
0x1
.
365
fcb0159000p
-
3
,
0x1
.
62
fa8234b7289p
-
51
},
{
0x1
.
b400000000000p
-
1
,
0x1
.
4913
d8333b000p
-
3
,
0x1
.
5837954
fdb678p
-
45
},
{
0x1
.
b200000000000p
-
1
,
0x1
.527e5
e4a1b000p
-
3
,
0x1
.633e8
e5697dc7p
-
45
},
{
0x1
.
ae00000000000p
-
1
,
0x1
.
6574
ebe8c1000p
-
3
,
0x1
.
9
cf8b2c3c2e78p
-
46
},
{
0x1
.
ac00000000000p
-
1
,
0x1
.
6
f0128b757000p
-
3
,
-
0x1
.
5118
de59c21e1p
-
45
},
{
0x1
.
aa00000000000p
-
1
,
0x1
.
7898
d85445000p
-
3
,
-
0x1
.
c661070914305p
-
46
},
{
0x1
.
a600000000000p
-
1
,
0x1
.
8
beafeb390000p
-
3
,
-
0x1
.
73
d54aae92cd1p
-
47
},
{
0x1
.
a400000000000p
-
1
,
0x1
.
95
a5adcf70000p
-
3
,
0x1
.
7
f22858a0ff6fp
-
47
},
{
0x1
.
a000000000000p
-
1
,
0x1
.
a93ed3c8ae000p
-
3
,
-
0x1
.
8724350562169
p
-
45
},
{
0x1
.9e00000000000
p
-
1
,
0x1
.
b31d8575bd000p
-
3
,
-
0x1
.
c358d4eace1aap
-
47
},
{
0x1
.
9
c00000000000p
-
1
,
0x1
.
bd087383be000p
-
3
,
-
0x1
.
d4bc4595412b6p
-
45
},
{
0x1
.
9
a00000000000p
-
1
,
0x1
.
c6ffbc6f01000p
-
3
,
-
0x1
.
1
ec72c5962bd2p
-
48
},
{
0x1
.
9600000000000
p
-
1
,
0x1
.
db13db0d49000p
-
3
,
-
0x1
.
aff2af715b035p
-
45
},
{
0x1
.
9400000000000
p
-
1
,
0x1
.
e530effe71000p
-
3
,
0x1
.
212276041
f430p
-
51
},
{
0x1
.
9200000000000
p
-
1
,
0x1
.
ef5ade4dd0000p
-
3
,
-
0x1
.
a211565bb8e11p
-
51
},
{
0x1
.
9000000000000
p
-
1
,
0x1
.
f991c6cb3b000p
-
3
,
0x1
.
bcbecca0cdf30p
-
46
},
{
0x1
.
8
c00000000000p
-
1
,
0x1
.
0713
8604
d5800p
-
2
,
0x1
.
89
cdb16ed4e91p
-
48
},
{
0x1
.
8
a00000000000p
-
1
,
0x1
.
0
c42d67616000p
-
2
,
0x1
.
7188
b163ceae9p
-
45
},
{
0x1
.
8800000000000
p
-
1
,
0x1
.1178e8227
e800p
-
2
,
-
0x1
.
c210e63a5f01cp
-
45
},
{
0x1
.
8600000000000
p
-
1
,
0x1
.
16
b5ccbacf800p
-
2
,
0x1
.
b9acdf7a51681p
-
45
},
{
0x1
.
8400000000000
p
-
1
,
0x1
.
1
bf99635a6800p
-
2
,
0x1
.
ca6ed5147bdb7p
-
45
},
{
0x1
.
8200000000000
p
-
1
,
0x1
.
214456
d0eb800p
-
2
,
0x1
.
a87deba46baeap
-
47
},
{
0x1
.7e00000000000
p
-
1
,
0x1
.
2
bef07cdc9000p
-
2
,
0x1
.
a9cfa4a5004f4p
-
45
},
{
0x1
.
7
c00000000000p
-
1
,
0x1
.
314
f1e1d36000p
-
2
,
-
0x1
.8e27
ad3213cb8p
-
45
},
{
0x1
.
7
a00000000000p
-
1
,
0x1
.
36
b6776be1000p
-
2
,
0x1
.
16
ecdb0f177c8p
-
46
},
{
0x1
.
7800000000000
p
-
1
,
0x1
.
3
c25277333000p
-
2
,
0x1
.
83
b54b606bd5cp
-
46
},
{
0x1
.
7600000000000
p
-
1
,
0x1
.
419
b423d5e800p
-
2
,
0x1
.8e436
ec90e09dp
-
47
},
{
0x1
.
7400000000000
p
-
1
,
0x1
.
4718
dc271c800p
-
2
,
-
0x1
.
f27ce0967d675p
-
45
},
{
0x1
.
7200000000000
p
-
1
,
0x1
.
4
c9e09e173000p
-
2
,
-
0x1
.
e20891b0ad8a4p
-
45
},
{
0x1
.
7000000000000
p
-
1
,
0x1
.
522
ae0738a000p
-
2
,
0x1
.
ebe708164c759p
-
45
},
{
0x1
.6e00000000000
p
-
1
,
0x1
.
57
bf753c8d000p
-
2
,
0x1
.
fadedee5d40efp
-
46
},
{
0x1
.
6
c00000000000p
-
1
,
0x1
.
5
d5bddf596000p
-
2
,
-
0x1
.
a0b2a08a465dcp
-
47
},
};
static
const
double
A
[]
=
{
-
0x1
p
-
1
,
0x1
.
555555555556
p
-
2
*
-
2
,
-
0x1
.
0000000000006
p
-
2
*
-
2
,
0x1
.
999999959554
ep
-
3
*
4
,
-
0x1
.
555555529
a47ap
-
3
*
4
,
0x1
.
2495
b9b4845e9p
-
3
*
-
8
,
-
0x1
.
0002
b8b263fc3p
-
3
*
-
8
};
static
const
double
ln2hi
=
0x1
.62e42
fefa3800p
-
1
,
ln2lo
=
0x1
.
ef35793c76730p
-
45
;
double
z
,
r
,
y
,
invc
,
logc
,
logctail
,
kd
,
hi
,
t1
,
t2
,
lo
,
lo1
,
lo2
,
p
;
double
zhi
,
zlo
,
rhi
,
rlo
,
ar
,
ar2
,
ar3
,
lo3
,
lo4
,
arhi
,
arhi2
;
UINT64
iz
,
tmp
;
int
k
,
i
;
/* x = 2^k z; where z is in range [OFF,2*OFF) and exact.
The range is split into N subintervals.
The ith subinterval contains z and c is near its center. */
tmp
=
ix
-
0x3fe6955500000000ULL
;
i
=
(
tmp
>>
(
52
-
7
))
%
(
1
<<
7
);
k
=
(
INT64
)
tmp
>>
52
;
/* arithmetic shift */
iz
=
ix
-
(
tmp
&
0xfffULL
<<
52
);
z
=
*
(
double
*
)
&
iz
;
kd
=
k
;
/* log(x) = k*Ln2 + log(c) + log1p(z/c-1). */
invc
=
T
[
i
].
invc
;
logc
=
T
[
i
].
logc
;
logctail
=
T
[
i
].
logctail
;
/* Note: 1/c is j/N or j/N/2 where j is an integer in [N,2N) and
|z/c - 1| < 1/N, so r = z/c - 1 is exactly representible. */
/* Split z such that rhi, rlo and rhi*rhi are exact and |rlo| <= |r|. */
iz
=
(
iz
+
(
1ULL
<<
31
))
&
(
-
1ULL
<<
32
);
zhi
=
*
(
double
*
)
&
iz
;
zlo
=
z
-
zhi
;
rhi
=
zhi
*
invc
-
1
.
0
;
rlo
=
zlo
*
invc
;
r
=
rhi
+
rlo
;
/* k*Ln2 + log(c) + r. */
t1
=
kd
*
ln2hi
+
logc
;
t2
=
t1
+
r
;
lo1
=
kd
*
ln2lo
+
logctail
;
lo2
=
t1
-
t2
+
r
;
/* Evaluation is optimized assuming superscalar pipelined execution. */
ar
=
A
[
0
]
*
r
;
/* A[0] = -0.5. */
ar2
=
r
*
ar
;
ar3
=
r
*
ar2
;
/* k*Ln2 + log(c) + r + A[0]*r*r. */
arhi
=
A
[
0
]
*
rhi
;
arhi2
=
rhi
*
arhi
;
hi
=
t2
+
arhi2
;
lo3
=
rlo
*
(
ar
+
arhi
);
lo4
=
t2
-
hi
+
arhi2
;
/* p = log1p(r) - r - A[0]*r*r. */
p
=
(
ar3
*
(
A
[
1
]
+
r
*
A
[
2
]
+
ar2
*
(
A
[
3
]
+
r
*
A
[
4
]
+
ar2
*
(
A
[
5
]
+
r
*
A
[
6
]))));
lo
=
lo1
+
lo2
+
lo3
+
lo4
+
p
;
y
=
hi
+
lo
;
*
tail
=
hi
-
y
+
lo
;
return
y
;
}
/* Computes sign*exp(x+xtail) where |xtail| < 2^-8/N and |xtail| <= |x|.
The sign_bias argument is SIGN_BIAS or 0 and sets the sign to -1 or 1. */
static
double
pow_exp
(
double
argx
,
double
argy
,
double
x
,
double
xtail
,
UINT32
sign_bias
)
{
static
const
double
C
[]
=
{
0x1
.
ffffffffffdbdp
-
2
,
0x1
.
555555555543
cp
-
3
,
0x1
.
55555
cf172b91p
-
5
,
0x1
.
1111167
a4d017p
-
7
};
static
const
double
invln2N
=
0x1
.
71547652
b82fep0
*
(
1
<<
7
),
negln2hiN
=
-
0x1
.62e42
fefa0000p
-
8
,
negln2loN
=
-
0x1
.
cf79abc9e3b3ap
-
47
;
UINT32
abstop
;
UINT64
ki
,
idx
,
top
,
sbits
;
double
kd
,
z
,
r
,
r2
,
scale
,
tail
,
tmp
;
abstop
=
(
*
(
UINT64
*
)
&
x
>>
52
)
&
0x7ff
;
if
(
abstop
-
0x3c9
>=
0x408
-
0x3c9
)
{
if
(
abstop
-
0x3c9
>=
0x80000000
)
{
/* Avoid spurious underflow for tiny x. */
/* Note: 0 is common input. */
double
one
=
1
.
0
+
x
;
return
sign_bias
?
-
one
:
one
;
}
if
(
abstop
>=
0x409
)
{
/* Note: inf and nan are already handled. */
if
(
*
(
UINT64
*
)
&
x
>>
63
)
return
math_error
(
_UNDERFLOW
,
"pow"
,
argx
,
argy
,
(
sign_bias
?
-
DBL_MIN
:
DBL_MIN
)
*
DBL_MIN
);
return
math_error
(
_OVERFLOW
,
"pow"
,
argx
,
argy
,
(
sign_bias
?
-
DBL_MAX
:
DBL_MAX
)
*
DBL_MAX
);
}
/* Large x is special cased below. */
abstop
=
0
;
}
/* exp(x) = 2^(k/N) * exp(r), with exp(r) in [2^(-1/2N),2^(1/2N)]. */
/* x = ln2/N*k + r, with int k and r in [-ln2/2N, ln2/2N]. */
z
=
invln2N
*
x
;
kd
=
__round
(
z
);
ki
=
kd
;
r
=
x
+
kd
*
negln2hiN
+
kd
*
negln2loN
;
/* The code assumes 2^-200 < |xtail| < 2^-8/N. */
r
+=
xtail
;
/* 2^(k/N) ~= scale * (1 + tail). */
idx
=
2
*
(
ki
%
(
1
<<
7
));
top
=
(
ki
+
sign_bias
)
<<
(
52
-
7
);
tail
=
*
(
double
*
)
&
exp_T
[
idx
];
/* This is only a valid scale when -1023*N < k < 1024*N. */
sbits
=
exp_T
[
idx
+
1
]
+
top
;
/* exp(x) = 2^(k/N) * exp(r) ~= scale + scale * (tail + exp(r) - 1). */
/* Evaluation is optimized assuming superscalar pipelined execution. */
r2
=
r
*
r
;
/* Without fma the worst case error is 0.25/N ulp larger. */
/* Worst case error is less than 0.5+1.11/N+(abs poly error * 2^53) ulp. */
tmp
=
tail
+
r
+
r2
*
(
C
[
0
]
+
r
*
C
[
1
])
+
r2
*
r2
*
(
C
[
2
]
+
r
*
C
[
3
]);
if
(
abstop
==
0
)
{
/* Handle cases that may overflow or underflow when computing the result that
is scale*(1+TMP) without intermediate rounding. The bit representation of
scale is in SBITS, however it has a computed exponent that may have
overflown into the sign bit so that needs to be adjusted before using it as
a double. (int32_t)KI is the k used in the argument reduction and exponent
adjustment of scale, positive k here means the result may overflow and
negative k means the result may underflow. */
double
scale
,
y
;
if
((
ki
&
0x80000000
)
==
0
)
{
/* k > 0, the exponent of scale might have overflowed by <= 460. */
sbits
-=
1009ull
<<
52
;
scale
=
*
(
double
*
)
&
sbits
;
y
=
0x1
p1009
*
(
scale
+
scale
*
tmp
);
if
(
isinf
(
y
))
return
math_error
(
_OVERFLOW
,
"pow"
,
argx
,
argy
,
y
);
return
y
;
}
/* k < 0, need special care in the subnormal range. */
sbits
+=
1022ull
<<
52
;
/* Note: sbits is signed scale. */
scale
=
*
(
double
*
)
&
sbits
;
y
=
scale
+
scale
*
tmp
;
if
(
fabs
(
y
)
<
1
.
0
)
{
/* Round y to the right precision before scaling it into the subnormal
range to avoid double rounding that can cause 0.5+E/2 ulp error where
E is the worst-case ulp error outside the subnormal range. So this
is only useful if the goal is better than 1 ulp worst-case error. */
double
hi
,
lo
,
one
=
1
.
0
;
if
(
y
<
0
.
0
)
one
=
-
1
.
0
;
lo
=
scale
-
y
+
scale
*
tmp
;
hi
=
one
+
y
;
lo
=
one
-
hi
+
y
+
lo
;
y
=
hi
+
lo
-
one
;
/* Fix the sign of 0. */
if
(
y
==
0
.
0
)
{
sbits
&=
0x8000000000000000ULL
;
y
=
*
(
double
*
)
&
sbits
;
}
/* The underflow exception needs to be signaled explicitly. */
fp_barrier
(
fp_barrier
(
0x1
p
-
1022
)
*
0x1
p
-
1022
);
y
=
0x1
p
-
1022
*
y
;
return
math_error
(
_UNDERFLOW
,
"pow"
,
argx
,
argy
,
y
);
}
y
=
0x1
p
-
1022
*
y
;
return
y
;
}
scale
=
*
(
double
*
)
&
sbits
;
/* Note: tmp == 0 or |tmp| > 2^-200 and scale > 2^-739, so there
is no spurious underflow here even without fma. */
return
scale
+
scale
*
tmp
;
}
/* Returns 0 if not int, 1 if odd int, 2 if even int. The argument is
the bit representation of a non-zero finite floating-point value. */
static
inline
int
pow_checkint
(
UINT64
iy
)
{
int
e
=
iy
>>
52
&
0x7ff
;
if
(
e
<
0x3ff
)
return
0
;
if
(
e
>
0x3ff
+
52
)
return
2
;
if
(
iy
&
((
1ULL
<<
(
0x3ff
+
52
-
e
))
-
1
))
return
0
;
if
(
iy
&
(
1ULL
<<
(
0x3ff
+
52
-
e
)))
return
1
;
return
2
;
}
/*********************************************************************
* pow (MSVCRT.@)
*
* Copied from musl: src/math/pow.c
*/
double
CDECL
pow
(
double
x
,
double
y
)
{
double
z
=
unix_funcs
->
pow
(
x
,
y
);
if
(
x
<
0
&&
y
!=
floor
(
y
))
return
math_error
(
_DOMAIN
,
"pow"
,
x
,
y
,
z
);
if
(
!
x
&&
isfinite
(
y
)
&&
y
<
0
)
return
math_error
(
_SING
,
"pow"
,
x
,
y
,
z
);
if
(
isfinite
(
x
)
&&
isfinite
(
y
)
&&
!
isfinite
(
z
))
return
math_error
(
_OVERFLOW
,
"pow"
,
x
,
y
,
z
);
if
(
x
&&
isfinite
(
x
)
&&
isfinite
(
y
)
&&
!
z
)
return
math_error
(
_UNDERFLOW
,
"pow"
,
x
,
y
,
z
);
return
z
;
UINT32
sign_bias
=
0
;
UINT64
ix
,
iy
;
UINT32
topx
,
topy
;
double
lo
,
hi
,
ehi
,
elo
,
yhi
,
ylo
,
lhi
,
llo
;
ix
=
*
(
UINT64
*
)
&
x
;
iy
=
*
(
UINT64
*
)
&
y
;
topx
=
ix
>>
52
;
topy
=
iy
>>
52
;
if
(
topx
-
0x001
>=
0x7ff
-
0x001
||
(
topy
&
0x7ff
)
-
0x3be
>=
0x43e
-
0x3be
)
{
/* Note: if |y| > 1075 * ln2 * 2^53 ~= 0x1.749p62 then pow(x,y) = inf/0
and if |y| < 2^-54 / 1075 ~= 0x1.e7b6p-65 then pow(x,y) = +-1. */
/* Special cases: (x < 0x1p-126 or inf or nan) or
(|y| < 0x1p-65 or |y| >= 0x1p63 or nan). */
if
(
2
*
iy
-
1
>=
2
*
0x7ff0000000000000ULL
-
1
)
{
if
(
2
*
iy
==
0
)
return
1
.
0
;
if
(
ix
==
0x3ff0000000000000ULL
)
return
1
.
0
;
if
(
2
*
ix
>
2
*
0x7ff0000000000000ULL
||
2
*
iy
>
2
*
0x7ff0000000000000ULL
)
return
x
+
y
;
if
(
2
*
ix
==
2
*
0x3ff0000000000000ULL
)
return
1
.
0
;
if
((
2
*
ix
<
2
*
0x3ff0000000000000ULL
)
==
!
(
iy
>>
63
))
return
0
.
0
;
/* |x|<1 && y==inf or |x|>1 && y==-inf. */
return
y
*
y
;
}
if
(
2
*
ix
-
1
>=
2
*
0x7ff0000000000000ULL
-
1
)
{
double
x2
=
x
*
x
;
if
(
ix
>>
63
&&
pow_checkint
(
iy
)
==
1
)
x2
=
-
x2
;
if
(
iy
&
0x8000000000000000ULL
&&
x2
==
0
.
0
)
return
math_error
(
_SING
,
"pow"
,
x
,
y
,
1
/
x2
);
/* Without the barrier some versions of clang hoist the 1/x2 and
thus division by zero exception can be signaled spuriously. */
return
iy
>>
63
?
fp_barrier
(
1
/
x2
)
:
x2
;
}
/* Here x and y are non-zero finite. */
if
(
ix
>>
63
)
{
/* Finite x < 0. */
int
yint
=
pow_checkint
(
iy
);
if
(
yint
==
0
)
return
math_error
(
_DOMAIN
,
"pow"
,
x
,
y
,
0
/
(
x
-
x
));
if
(
yint
==
1
)
sign_bias
=
0x800
<<
7
;
ix
&=
0x7fffffffffffffff
;
topx
&=
0x7ff
;
}
if
((
topy
&
0x7ff
)
-
0x3be
>=
0x43e
-
0x3be
)
{
/* Note: sign_bias == 0 here because y is not odd. */
if
(
ix
==
0x3ff0000000000000ULL
)
return
1
.
0
;
if
((
topy
&
0x7ff
)
<
0x3be
)
{
/* |y| < 2^-65, x^y ~= 1 + y*log(x). */
return
ix
>
0x3ff0000000000000ULL
?
1
.
0
+
y
:
1
.
0
-
y
;
}
if
((
ix
>
0x3ff0000000000000ULL
)
==
(
topy
<
0x800
))
return
math_error
(
_OVERFLOW
,
"pow"
,
x
,
y
,
fp_barrier
(
DBL_MAX
)
*
DBL_MAX
);
return
math_error
(
_UNDERFLOW
,
"pow"
,
x
,
y
,
fp_barrier
(
DBL_MIN
)
*
DBL_MIN
);
}
if
(
topx
==
0
)
{
/* Normalize subnormal x so exponent becomes negative. */
x
*=
0x1
p52
;
ix
=
*
(
UINT64
*
)
&
x
;
ix
&=
0x7fffffffffffffff
;
ix
-=
52ULL
<<
52
;
}
}
hi
=
pow_log
(
ix
,
&
lo
);
iy
&=
-
1ULL
<<
27
;
yhi
=
*
(
double
*
)
&
iy
;
ylo
=
y
-
yhi
;
*
(
UINT64
*
)
&
lhi
=
*
(
UINT64
*
)
&
hi
&
-
1ULL
<<
27
;
llo
=
fp_barrier
(
hi
-
lhi
+
lo
);
ehi
=
yhi
*
lhi
;
elo
=
ylo
*
lhi
+
y
*
llo
;
/* |elo| < |ehi| * 2^-25. */
return
pow_exp
(
x
,
y
,
ehi
,
elo
,
sign_bias
);
}
/*********************************************************************
...
...
dlls/msvcrt/unixlib.c
deleted
100644 → 0
View file @
9d2de96d
/*
* MSVCRT Unix interface
*
* Copyright 2020 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include <stdarg.h>
#define __USE_ISOC9X 1
#define __USE_ISOC99 1
#include <math.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "winternl.h"
#include "unixlib.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msvcrt
);
/*********************************************************************
* pow
*/
static
double
CDECL
unix_pow
(
double
x
,
double
y
)
{
return
pow
(
x
,
y
);
}
static
const
struct
unix_funcs
funcs
=
{
unix_pow
,
};
NTSTATUS
CDECL
__wine_init_unix_lib
(
HMODULE
module
,
DWORD
reason
,
const
void
*
ptr_in
,
void
*
ptr_out
)
{
if
(
reason
!=
DLL_PROCESS_ATTACH
)
return
STATUS_SUCCESS
;
TRACE
(
"
\n
"
);
*
(
const
struct
unix_funcs
**
)
ptr_out
=
&
funcs
;
return
STATUS_SUCCESS
;
}
dlls/msvcrt/unixlib.h
deleted
100644 → 0
View file @
9d2de96d
/*
* MSVCRT Unix interface
*
* Copyright 2020 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __UNIXLIB_H
#define __UNIXLIB_H
struct
unix_funcs
{
double
(
CDECL
*
pow
)(
double
x
,
double
y
);
};
#endif
/* __UNIXLIB_H */
dlls/msvcrtd/Makefile.in
View file @
ff4d7edc
...
...
@@ -37,5 +37,4 @@ C_SRCS = \
thread.c
\
time.c
\
undname.c
\
unixlib.c
\
wcs.c
dlls/ucrtbase/Makefile.in
View file @
ff4d7edc
...
...
@@ -42,7 +42,6 @@ C_SRCS = \
thread.c
\
time.c
\
undname.c
\
unixlib.c
\
wcs.c
RC_SRCS
=
version.rc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment