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
21cbe74b
Commit
21cbe74b
authored
Apr 04, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use the log2()/log2f() implementation from the bundled musl library.
parent
714874ba
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
math.c
dlls/msvcrt/math.c
+0
-0
log2.c
libs/musl/src/math/log2.c
+8
-2
log2f.c
libs/musl/src/math/log2f.c
+8
-2
No files found.
dlls/msvcrt/math.c
View file @
21cbe74b
This diff is collapsed.
Click to expand it.
libs/musl/src/math/log2.c
View file @
21cbe74b
...
...
@@ -65,12 +65,18 @@ double __cdecl log2(double x)
}
if
(
predict_false
(
top
-
0x0010
>=
0x7ff0
-
0x0010
))
{
/* x < 0x1p-1022 or inf or nan. */
if
(
ix
*
2
==
0
)
if
(
ix
*
2
==
0
)
{
errno
=
ERANGE
;
return
__math_divzero
(
1
);
}
if
(
ix
==
asuint64
(
INFINITY
))
/* log(inf) == inf. */
return
x
;
if
((
top
&
0x8000
)
||
(
top
&
0x7ff0
)
==
0x7ff0
)
if
((
top
&
0x7ff0
)
==
0x7ff0
&&
(
ix
&
0xfffffffffffffULL
))
return
x
;
if
(
top
&
0x8000
)
{
errno
=
EDOM
;
return
__math_invalid
(
x
);
}
/* x is subnormal, normalize it. */
ix
=
asuint64
(
x
*
0x1
p52
);
ix
-=
52ULL
<<
52
;
...
...
libs/musl/src/math/log2f.c
View file @
21cbe74b
...
...
@@ -35,12 +35,18 @@ float __cdecl log2f(float x)
return
0
;
if
(
predict_false
(
ix
-
0x00800000
>=
0x7f800000
-
0x00800000
))
{
/* x < 0x1p-126 or inf or nan. */
if
(
ix
*
2
==
0
)
if
(
ix
*
2
==
0
)
{
errno
=
ERANGE
;
return
__math_divzerof
(
1
);
}
if
(
ix
==
0x7f800000
)
/* log2(inf) == inf. */
return
x
;
if
((
ix
&
0x80000000
)
||
ix
*
2
>=
0xff000000
)
if
(
ix
*
2
>
0xff000000
)
return
x
;
if
(
ix
&
0x80000000
)
{
errno
=
EDOM
;
return
__math_invalidf
(
x
);
}
/* x is subnormal, normalize it. */
ix
=
asuint
(
x
*
0x1
p23f
);
ix
-=
23
<<
23
;
...
...
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