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
e5d667de
Commit
e5d667de
authored
May 17, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
May 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Import cbrt implementation from musl.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
09bcc133
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
20 deletions
+41
-20
configure
configure
+0
-1
configure.ac
configure.ac
+0
-1
math.c
dlls/msvcrt/math.c
+41
-1
unixlib.c
dlls/msvcrt/unixlib.c
+0
-13
unixlib.h
dlls/msvcrt/unixlib.h
+0
-1
config.h.in
include/config.h.in
+0
-3
No files found.
configure
View file @
e5d667de
...
...
@@ -19622,7 +19622,6 @@ for ac_func in \
asinhf
\
atanh
\
atanhf
\
cbrt
\
erf
\
erfc
\
erfcf
\
...
...
configure.ac
View file @
e5d667de
...
...
@@ -2662,7 +2662,6 @@ AC_CHECK_FUNCS(\
asinhf \
atanh \
atanhf \
cbrt \
erf \
erfc \
erfcf \
...
...
dlls/msvcrt/math.c
View file @
e5d667de
...
...
@@ -4497,10 +4497,50 @@ short CDECL _dclass(double x)
/*********************************************************************
* cbrt (MSVCR120.@)
*
* Copied from musl: src/math/cbrt.c
*/
double
CDECL
cbrt
(
double
x
)
{
return
unix_funcs
->
cbrt
(
x
);
static
const
UINT32
B1
=
715094163
,
B2
=
696219795
;
static
const
double
P0
=
1
.
87595182427177009643
,
P1
=
-
1
.
88497979543377169875
,
P2
=
1
.
621429720105354466140
,
P3
=
-
0
.
758397934778766047437
,
P4
=
0
.
145996192886612446982
;
union
{
double
f
;
UINT64
i
;}
u
=
{
x
};
double
r
,
s
,
t
,
w
;
UINT32
hx
=
u
.
i
>>
32
&
0x7fffffff
;
if
(
hx
>=
0x7ff00000
)
/* cbrt(NaN,INF) is itself */
return
x
+
x
;
if
(
hx
<
0x00100000
)
{
/* zero or subnormal? */
u
.
f
=
x
*
0x1
p54
;
hx
=
u
.
i
>>
32
&
0x7fffffff
;
if
(
hx
==
0
)
return
x
;
hx
=
hx
/
3
+
B2
;
}
else
hx
=
hx
/
3
+
B1
;
u
.
i
&=
1ULL
<<
63
;
u
.
i
|=
(
UINT64
)
hx
<<
32
;
t
=
u
.
f
;
r
=
(
t
*
t
)
*
(
t
/
x
);
t
=
t
*
((
P0
+
r
*
(
P1
+
r
*
P2
))
+
((
r
*
r
)
*
r
)
*
(
P3
+
r
*
P4
));
u
.
f
=
t
;
u
.
i
=
(
u
.
i
+
0x80000000
)
&
0xffffffffc0000000ULL
;
t
=
u
.
f
;
s
=
t
*
t
;
r
=
x
/
s
;
w
=
t
+
t
;
r
=
(
r
-
t
)
/
(
w
+
r
);
t
=
t
+
t
*
r
;
return
t
;
}
/*********************************************************************
...
...
dlls/msvcrt/unixlib.c
View file @
e5d667de
...
...
@@ -122,18 +122,6 @@ static float CDECL unix_atanhf(float x)
}
/*********************************************************************
* cbrt
*/
static
double
CDECL
unix_cbrt
(
double
x
)
{
#ifdef HAVE_CBRT
return
cbrt
(
x
);
#else
return
x
<
0
?
-
pow
(
-
x
,
1
.
0
/
3
.
0
)
:
pow
(
x
,
1
.
0
/
3
.
0
);
#endif
}
/*********************************************************************
* ceil
*/
static
double
CDECL
unix_ceil
(
double
x
)
...
...
@@ -725,7 +713,6 @@ static const struct unix_funcs funcs =
unix_asinhf
,
unix_atanh
,
unix_atanhf
,
unix_cbrt
,
unix_ceil
,
unix_ceilf
,
unix_cos
,
...
...
dlls/msvcrt/unixlib.h
View file @
e5d667de
...
...
@@ -29,7 +29,6 @@ struct unix_funcs
float
(
CDECL
*
asinhf
)(
float
x
);
double
(
CDECL
*
atanh
)(
double
x
);
float
(
CDECL
*
atanhf
)(
float
x
);
double
(
CDECL
*
cbrt
)(
double
x
);
double
(
CDECL
*
ceil
)(
double
x
);
float
(
CDECL
*
ceilf
)(
float
x
);
double
(
CDECL
*
cos
)(
double
x
);
...
...
include/config.h.in
View file @
e5d667de
...
...
@@ -67,9 +67,6 @@
/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
#undef HAVE_CARBON_CARBON_H
/* Define to 1 if you have the `cbrt' function. */
#undef HAVE_CBRT
/* Define to 1 if you have the `clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME
...
...
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