Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ff033db6
Commit
ff033db6
authored
May 25, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
May 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Import atanh implementation from musl.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ed49a95d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
26 deletions
+23
-26
configure
configure
+0
-1
configure.ac
configure.ac
+0
-1
math.c
dlls/msvcrt/math.c
+23
-6
unixlib.c
dlls/msvcrt/unixlib.c
+0
-14
unixlib.h
dlls/msvcrt/unixlib.h
+0
-1
config.h.in
include/config.h.in
+0
-3
No files found.
configure
View file @
ff033db6
...
...
@@ -19616,7 +19616,6 @@ $as_echo "#define HAVE_ISNAN 1" >>confdefs.h
fi
for
ac_func
in
\
atanh
\
exp2
\
exp2f
\
expm1
\
...
...
configure.ac
View file @
ff033db6
...
...
@@ -2656,7 +2656,6 @@ then
fi
AC_CHECK_FUNCS(\
atanh \
exp2 \
exp2f \
expm1 \
...
...
dlls/msvcrt/math.c
View file @
ff033db6
...
...
@@ -6668,21 +6668,38 @@ float CDECL acoshf(float x)
/*********************************************************************
* atanh (MSVCR120.@)
*
* Copied from musl: src/math/atanh.c
*/
double
CDECL
atanh
(
double
x
)
{
double
ret
;
UINT64
ux
=
*
(
UINT64
*
)
&
x
;
int
e
=
ux
>>
52
&
0x7ff
;
int
s
=
ux
>>
63
;
if
(
x
>
1
||
x
<
-
1
)
{
/* |x| */
ux
&=
(
UINT64
)
-
1
/
2
;
x
=
*
(
double
*
)
&
ux
;
if
(
x
>
1
)
{
*
_errno
()
=
EDOM
;
/* on Linux atanh returns -NAN in this case */
feraiseexcept
(
FE_INVALID
);
return
NAN
;
}
ret
=
unix_funcs
->
atanh
(
x
);
if
(
!
isfinite
(
ret
))
*
_errno
()
=
ERANGE
;
return
ret
;
if
(
e
<
0x3ff
-
1
)
{
if
(
e
<
0x3ff
-
32
)
{
fp_barrier
(
x
+
0x1
p120f
);
if
(
e
==
0
)
/* handle underflow */
fp_barrier
(
x
*
x
);
}
else
{
/* |x| < 0.5, up to 1.7ulp error */
x
=
0
.
5
*
log1p
(
2
*
x
+
2
*
x
*
x
/
(
1
-
x
));
}
}
else
{
/* avoid overflow */
x
=
0
.
5
*
log1p
(
2
*
(
x
/
(
1
-
x
)));
if
(
isinf
(
x
))
*
_errno
()
=
ERANGE
;
}
return
s
?
-
x
:
x
;
}
/*********************************************************************
...
...
dlls/msvcrt/unixlib.c
View file @
ff033db6
...
...
@@ -43,19 +43,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
msvcrt
);
/*********************************************************************
* atanh
*/
static
double
CDECL
unix_atanh
(
double
x
)
{
#ifdef HAVE_ATANH
return
atanh
(
x
);
#else
if
(
-
1e-6
<
x
&&
x
<
1e-6
)
return
x
+
x
*
x
*
x
/
3
;
else
return
(
log
(
1
+
x
)
-
log
(
1
-
x
))
/
2
;
#endif
}
/*********************************************************************
* cosh
*/
static
double
CDECL
unix_cosh
(
double
x
)
...
...
@@ -381,7 +368,6 @@ static float CDECL unix_tgammaf(float x)
static
const
struct
unix_funcs
funcs
=
{
unix_atanh
,
unix_cosh
,
unix_coshf
,
unix_exp
,
...
...
dlls/msvcrt/unixlib.h
View file @
ff033db6
...
...
@@ -23,7 +23,6 @@
struct
unix_funcs
{
double
(
CDECL
*
atanh
)(
double
x
);
double
(
CDECL
*
cosh
)(
double
x
);
float
(
CDECL
*
coshf
)(
float
x
);
double
(
CDECL
*
exp
)(
double
x
);
...
...
include/config.h.in
View file @
ff033db6
...
...
@@ -31,9 +31,6 @@
/* Define to 1 if you have the <asm/user.h> header file. */
#undef HAVE_ASM_USER_H
/* Define to 1 if you have the `atanh' function. */
#undef HAVE_ATANH
/* Define to 1 if you have the <AudioToolbox/AudioConverter.h> header file. */
#undef HAVE_AUDIOTOOLBOX_AUDIOCONVERTER_H
...
...
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