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
4ffb1199
Commit
4ffb1199
authored
Mar 31, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use the atanh()/atanhf() implementation from the bundled musl library.
parent
e2924faf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
61 deletions
+22
-61
msvcr120.spec
dlls/msvcr120/msvcr120.spec
+3
-3
math.c
dlls/msvcrt/math.c
+9
-52
ucrtbase.spec
dlls/ucrtbase/ucrtbase.spec
+6
-6
atanh.c
libs/musl/src/math/atanh.c
+2
-0
atanhf.c
libs/musl/src/math/atanhf.c
+2
-0
No files found.
dlls/msvcr120/msvcr120.spec
View file @
4ffb1199
...
...
@@ -2026,9 +2026,9 @@
@ cdecl -arch=!i386 atanf(float)
@ cdecl atan2(double double)
@ cdecl -arch=!i386 atan2f(float float)
@ cdecl atanh(double)
@ cdecl atanhf(float)
@ cdecl atanhl(double) atanh
@ cdecl atanh(double)
MSVCRT_atanh
@ cdecl atanhf(float)
MSVCRT_atanhf
@ cdecl atanhl(double)
MSVCRT_
atanh
@ cdecl -private atexit(ptr) MSVCRT_atexit # not imported to avoid conflicts with Mingw
@ cdecl atof(str)
@ cdecl atoi(str)
...
...
dlls/msvcrt/math.c
View file @
4ffb1199
...
...
@@ -78,7 +78,7 @@ void msvcrt_init_math( void *module )
}
/* Copied from musl: src/internal/libm.h */
#if
!defined(__i386__) || _MSVCR_VER>=120
#if
ndef __i386__
static
inline
float
fp_barrierf
(
float
x
)
{
volatile
float
y
=
x
;
...
...
@@ -3377,73 +3377,30 @@ float CDECL MSVCRT_acoshf(float x)
/*********************************************************************
* atanh (MSVCR120.@)
*
* Copied from musl: src/math/atanh.c
*/
double
CDECL
atanh
(
double
x
)
double
CDECL
MSVCRT_
atanh
(
double
x
)
{
UINT64
ux
=
*
(
UINT64
*
)
&
x
;
int
e
=
ux
>>
52
&
0x7ff
;
int
s
=
ux
>>
63
;
/* |x| */
ux
&=
(
UINT64
)
-
1
/
2
;
x
=
*
(
double
*
)
&
ux
;
if
(
x
>
1
)
{
if
(
fabs
(
x
)
>
1
)
{
*
_errno
()
=
EDOM
;
feraiseexcept
(
FE_INVALID
);
return
NAN
;
}
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
;
return
atanh
(
x
);
}
/*********************************************************************
* atanhf (MSVCR120.@)
*
* Copied from musl: src/math/atanhf.c
*/
float
CDECL
atanhf
(
float
x
)
float
CDECL
MSVCRT_
atanhf
(
float
x
)
{
UINT32
ux
=
*
(
UINT32
*
)
&
x
;
int
s
=
ux
>>
31
;
/* |x| */
ux
&=
0x7fffffff
;
x
=
*
(
float
*
)
&
ux
;
if
(
x
>
1
)
{
if
(
fabs
(
x
)
>
1
)
{
*
_errno
()
=
EDOM
;
feraiseexcept
(
FE_INVALID
);
return
NAN
;
}
if
(
ux
<
0x3f800000
-
(
1
<<
23
))
{
if
(
ux
<
0x3f800000
-
(
32
<<
23
))
{
fp_barrierf
(
x
+
0x1
p120f
);
if
(
ux
<
(
1
<<
23
))
/* handle underflow */
fp_barrierf
(
x
*
x
);
}
else
{
/* |x| < 0.5, up to 1.7ulp error */
x
=
0
.
5
f
*
log1pf
(
2
*
x
+
2
*
x
*
x
/
(
1
-
x
));
}
}
else
{
/* avoid overflow */
x
=
0
.
5
f
*
log1pf
(
2
*
(
x
/
(
1
-
x
)));
if
(
isinf
(
x
))
*
_errno
()
=
ERANGE
;
}
return
s
?
-
x
:
x
;
return
atanhf
(
x
);
}
#endif
/* _MSVCR_VER>=120 */
...
...
dlls/ucrtbase/ucrtbase.spec
View file @
4ffb1199
...
...
@@ -1576,9 +1576,9 @@
@ cdecl _o_atan2(double double) atan2
@ cdecl -arch=!i386 _o_atan2f(float float) atan2f
@ cdecl -arch=!i386 _o_atanf(float) atanf
@ cdecl _o_atanh(double) atanh
@ cdecl _o_atanhf(float) atanhf
@ cdecl _o_atanhl(double) atanh
@ cdecl _o_atanh(double)
MSVCRT_
atanh
@ cdecl _o_atanhf(float)
MSVCRT_
atanhf
@ cdecl _o_atanhl(double)
MSVCRT_
atanh
@ cdecl _o_atof(str) atof
@ cdecl _o_atoi(str) atoi
@ cdecl _o_atol(str) atol
...
...
@@ -2170,9 +2170,9 @@
@ cdecl atan2(double double)
@ cdecl -arch=!i386 atan2f(float float)
@ cdecl -arch=!i386 atanf(float)
@ cdecl atanh(double)
@ cdecl atanhf(float)
@ cdecl atanhl(double) atanh
@ cdecl atanh(double)
MSVCRT_atanh
@ cdecl atanhf(float)
MSVCRT_atanhf
@ cdecl atanhl(double)
MSVCRT_
atanh
@ cdecl atof(str)
@ cdecl atoi(str)
@ cdecl atol(str)
...
...
libs/musl/src/math/atanh.c
View file @
4ffb1199
...
...
@@ -14,6 +14,7 @@ double __cdecl atanh(double x)
if
(
e
<
0x3ff
-
1
)
{
if
(
e
<
0x3ff
-
32
)
{
fp_barrier
(
y
+
0x1
p120f
);
/* handle underflow */
if
(
e
==
0
)
FORCE_EVAL
((
float
)
y
);
...
...
@@ -24,6 +25,7 @@ double __cdecl atanh(double x)
}
else
{
/* avoid overflow */
y
=
0
.
5
*
log1p
(
2
*
(
y
/
(
1
-
y
)));
if
(
isinf
(
y
))
errno
=
ERANGE
;
}
return
s
?
-
y
:
y
;
}
libs/musl/src/math/atanhf.c
View file @
4ffb1199
...
...
@@ -13,6 +13,7 @@ float __cdecl atanhf(float x)
if
(
u
.
i
<
0x3f800000
-
(
1
<<
23
))
{
if
(
u
.
i
<
0x3f800000
-
(
32
<<
23
))
{
fp_barrierf
(
y
+
0x1
p120f
);
/* handle underflow */
if
(
u
.
i
<
(
1
<<
23
))
FORCE_EVAL
((
float
)(
y
*
y
));
...
...
@@ -23,6 +24,7 @@ float __cdecl atanhf(float x)
}
else
{
/* avoid overflow */
y
=
0
.
5
f
*
log1pf
(
2
*
(
y
/
(
1
-
y
)));
if
(
isinf
(
y
))
errno
=
ERANGE
;
}
return
s
?
-
y
:
y
;
}
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