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
b29096cc
Commit
b29096cc
authored
Jun 04, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Import log10f implementation from musl.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cef75b3b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
14 deletions
+56
-14
math.c
dlls/msvcrt/math.c
+56
-4
unixlib.c
dlls/msvcrt/unixlib.c
+0
-9
unixlib.h
dlls/msvcrt/unixlib.h
+0
-1
No files found.
dlls/msvcrt/math.c
View file @
b29096cc
...
...
@@ -1295,10 +1295,62 @@ float CDECL logf( float x )
*/
float
CDECL
log10f
(
float
x
)
{
float
ret
=
unix_funcs
->
log10f
(
x
);
if
(
x
<
0
.
0
)
return
math_error
(
_DOMAIN
,
"log10f"
,
x
,
0
,
ret
);
if
(
x
==
0
.
0
)
return
math_error
(
_SING
,
"log10f"
,
x
,
0
,
ret
);
return
ret
;
static
const
float
ivln10hi
=
4.3432617188e-01
,
ivln10lo
=
-
3.1689971365e-05
,
log10_2hi
=
3.0102920532e-01
,
log10_2lo
=
7.9034151668e-07
,
Lg1
=
0xaaaaaa
.
0
p
-
24
,
Lg2
=
0xccce13
.
0
p
-
25
,
Lg3
=
0x91e9ee
.
0
p
-
25
,
Lg4
=
0xf89e26
.
0
p
-
26
;
union
{
float
f
;
UINT32
i
;}
u
=
{
x
};
float
hfsq
,
f
,
s
,
z
,
R
,
w
,
t1
,
t2
,
dk
,
hi
,
lo
;
UINT32
ix
;
int
k
;
ix
=
u
.
i
;
k
=
0
;
if
(
ix
<
0x00800000
||
ix
>>
31
)
{
/* x < 2**-126 */
if
(
ix
<<
1
==
0
)
return
math_error
(
_SING
,
"log10f"
,
x
,
0
,
-
1
/
(
x
*
x
));
if
((
ix
&
~
(
1u
<<
31
))
>
0x7f800000
)
return
x
;
if
(
ix
>>
31
)
return
math_error
(
_DOMAIN
,
"log10f"
,
x
,
0
,
(
x
-
x
)
/
(
x
-
x
));
/* subnormal number, scale up x */
k
-=
25
;
x
*=
0x1
p25f
;
u
.
f
=
x
;
ix
=
u
.
i
;
}
else
if
(
ix
>=
0x7f800000
)
{
return
x
;
}
else
if
(
ix
==
0x3f800000
)
return
0
;
/* reduce x into [sqrt(2)/2, sqrt(2)] */
ix
+=
0x3f800000
-
0x3f3504f3
;
k
+=
(
int
)(
ix
>>
23
)
-
0x7f
;
ix
=
(
ix
&
0x007fffff
)
+
0x3f3504f3
;
u
.
i
=
ix
;
x
=
u
.
f
;
f
=
x
-
1
.
0
f
;
s
=
f
/
(
2
.
0
f
+
f
);
z
=
s
*
s
;
w
=
z
*
z
;
t1
=
w
*
(
Lg2
+
w
*
Lg4
);
t2
=
z
*
(
Lg1
+
w
*
Lg3
);
R
=
t2
+
t1
;
hfsq
=
0
.
5
f
*
f
*
f
;
hi
=
f
-
hfsq
;
u
.
f
=
hi
;
u
.
i
&=
0xfffff000
;
hi
=
u
.
f
;
lo
=
f
-
hi
-
hfsq
+
s
*
(
hfsq
+
R
);
dk
=
k
;
return
dk
*
log10_2lo
+
(
lo
+
hi
)
*
ivln10lo
+
lo
*
ivln10hi
+
hi
*
ivln10hi
+
dk
*
log10_2hi
;
}
/*********************************************************************
...
...
dlls/msvcrt/unixlib.c
View file @
b29096cc
...
...
@@ -121,14 +121,6 @@ static float CDECL unix_lgammaf(float x)
}
/*********************************************************************
* log10f
*/
static
float
CDECL
unix_log10f
(
float
x
)
{
return
log10f
(
x
);
}
/*********************************************************************
* log2
*/
static
double
CDECL
unix_log2
(
double
x
)
...
...
@@ -203,7 +195,6 @@ static const struct unix_funcs funcs =
unix_fmaf
,
unix_lgamma
,
unix_lgammaf
,
unix_log10f
,
unix_log2
,
unix_log2f
,
unix_pow
,
...
...
dlls/msvcrt/unixlib.h
View file @
b29096cc
...
...
@@ -30,7 +30,6 @@ struct unix_funcs
float
(
CDECL
*
fmaf
)(
float
x
,
float
y
,
float
z
);
double
(
CDECL
*
lgamma
)(
double
x
);
float
(
CDECL
*
lgammaf
)(
float
x
);
float
(
CDECL
*
log10f
)(
float
x
);
double
(
CDECL
*
log2
)(
double
x
);
float
(
CDECL
*
log2f
)(
float
x
);
double
(
CDECL
*
pow
)(
double
x
,
double
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