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
78fc19d6
Commit
78fc19d6
authored
May 20, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
May 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Import _logbf implementation from musl.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6758acbb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
30 deletions
+29
-30
math.c
dlls/msvcrt/math.c
+29
-20
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 @
78fc19d6
...
...
@@ -275,15 +275,38 @@ float CDECL _nextafterf( float x, float y )
return
y
;
}
/* Copied from musl: src/math/ilogbf.c */
static
int
__ilogbf
(
float
x
)
{
union
{
float
f
;
UINT32
i
;
}
u
=
{
x
};
int
e
=
u
.
i
>>
23
&
0xff
;
if
(
!
e
)
{
u
.
i
<<=
9
;
if
(
u
.
i
==
0
)
return
FP_ILOGB0
;
/* subnormal x */
for
(
e
=
-
0x7f
;
u
.
i
>>
31
==
0
;
e
--
,
u
.
i
<<=
1
);
return
e
;
}
if
(
e
==
0xff
)
return
u
.
i
<<
9
?
FP_ILOGBNAN
:
INT_MAX
;
return
e
-
0x7f
;
}
/*********************************************************************
* _logbf (MSVCRT.@)
*
* Copied from musl: src/math/logbf.c
*/
float
CDECL
_logbf
(
float
num
)
float
CDECL
_logbf
(
float
x
)
{
float
ret
=
unix_funcs
->
logbf
(
num
);
if
(
isnan
(
num
))
return
math_error
(
_DOMAIN
,
"_logbf"
,
num
,
0
,
ret
);
if
(
!
num
)
return
math_error
(
_SING
,
"_logbf"
,
num
,
0
,
ret
);
return
ret
;
if
(
!
isfinite
(
x
))
return
x
*
x
;
if
(
x
==
0
)
{
*
_errno
()
=
ERANGE
;
return
-
1
/
(
x
*
x
);
}
return
__ilogbf
(
x
);
}
#endif
...
...
@@ -6178,23 +6201,9 @@ int CDECL ilogb(double x)
/*********************************************************************
* ilogbf (MSVCR120.@)
*
* Copied from musl: src/math/ilogbf.c
*/
int
CDECL
ilogbf
(
float
x
)
{
union
{
float
f
;
UINT32
i
;
}
u
=
{
x
};
int
e
=
u
.
i
>>
23
&
0xff
;
if
(
!
e
)
{
u
.
i
<<=
9
;
if
(
u
.
i
==
0
)
return
FP_ILOGB0
;
/* subnormal x */
for
(
e
=
-
0x7f
;
u
.
i
>>
31
==
0
;
e
--
,
u
.
i
<<=
1
);
return
e
;
}
if
(
e
==
0xff
)
return
u
.
i
<<
9
?
FP_ILOGBNAN
:
INT_MAX
;
return
e
-
0x7f
;
return
__ilogbf
(
x
);
}
#endif
/* _MSVCR_VER>=120 */
dlls/msvcrt/unixlib.c
View file @
78fc19d6
...
...
@@ -388,14 +388,6 @@ static float CDECL unix_log2f(float x)
}
/*********************************************************************
* logbf
*/
static
float
CDECL
unix_logbf
(
float
x
)
{
return
logbf
(
x
);
}
/*********************************************************************
* pow
*/
static
double
CDECL
unix_pow
(
double
x
,
double
y
)
...
...
@@ -536,7 +528,6 @@ static const struct unix_funcs funcs =
unix_log1pf
,
unix_log2
,
unix_log2f
,
unix_logbf
,
unix_pow
,
unix_powf
,
unix_sin
,
...
...
dlls/msvcrt/unixlib.h
View file @
78fc19d6
...
...
@@ -56,7 +56,6 @@ struct unix_funcs
float
(
CDECL
*
log1pf
)(
float
x
);
double
(
CDECL
*
log2
)(
double
x
);
float
(
CDECL
*
log2f
)(
float
x
);
float
(
CDECL
*
logbf
)(
float
x
);
double
(
CDECL
*
pow
)(
double
x
,
double
y
);
float
(
CDECL
*
powf
)(
float
x
,
float
y
);
double
(
CDECL
*
sin
)(
double
x
);
...
...
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