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
6758acbb
Commit
6758acbb
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 _logb implementation from musl.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dff85646
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
30 deletions
+27
-30
math.c
dlls/msvcrt/math.c
+27
-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 @
6758acbb
...
...
@@ -1897,15 +1897,36 @@ __int64 CDECL _abs64( __int64 n )
return
n
>=
0
?
n
:
-
n
;
}
/* Copied from musl: src/math/ilogb.c */
static
int
__ilogb
(
double
x
)
{
union
{
double
f
;
UINT64
i
;
}
u
=
{
x
};
int
e
=
u
.
i
>>
52
&
0x7ff
;
if
(
!
e
)
{
u
.
i
<<=
12
;
if
(
u
.
i
==
0
)
return
FP_ILOGB0
;
/* subnormal x */
for
(
e
=
-
0x3ff
;
u
.
i
>>
63
==
0
;
e
--
,
u
.
i
<<=
1
);
return
e
;
}
if
(
e
==
0x7ff
)
return
u
.
i
<<
12
?
FP_ILOGBNAN
:
INT_MAX
;
return
e
-
0x3ff
;
}
/*********************************************************************
* _logb (MSVCRT.@)
*
* Copied from musl: src/math/logb.c
*/
double
CDECL
_logb
(
double
num
)
double
CDECL
_logb
(
double
x
)
{
double
ret
=
unix_funcs
->
logb
(
num
);
if
(
isnan
(
num
))
return
math_error
(
_DOMAIN
,
"_logb"
,
num
,
0
,
ret
);
if
(
!
num
)
return
math_error
(
_SING
,
"_logb"
,
num
,
0
,
ret
);
return
ret
;
if
(
!
isfinite
(
x
))
return
x
*
x
;
if
(
x
==
0
)
return
math_error
(
_SING
,
"_logb"
,
x
,
0
,
-
1
/
(
x
*
x
));
return
__ilogb
(
x
);
}
/*********************************************************************
...
...
@@ -6149,24 +6170,10 @@ double CDECL MSVCR120_creal(_Dcomplex z)
/*********************************************************************
* ilogb (MSVCR120.@)
*
* Copied from musl: src/math/ilogb.c
*/
int
CDECL
ilogb
(
double
x
)
{
union
{
double
f
;
UINT64
i
;
}
u
=
{
x
};
int
e
=
u
.
i
>>
52
&
0x7ff
;
if
(
!
e
)
{
u
.
i
<<=
12
;
if
(
u
.
i
==
0
)
return
FP_ILOGB0
;
/* subnormal x */
for
(
e
=
-
0x3ff
;
u
.
i
>>
63
==
0
;
e
--
,
u
.
i
<<=
1
);
return
e
;
}
if
(
e
==
0x7ff
)
return
u
.
i
<<
12
?
FP_ILOGBNAN
:
INT_MAX
;
return
e
-
0x3ff
;
return
__ilogb
(
x
);
}
/*********************************************************************
...
...
dlls/msvcrt/unixlib.c
View file @
6758acbb
...
...
@@ -388,14 +388,6 @@ static float CDECL unix_log2f(float x)
}
/*********************************************************************
* logb
*/
static
double
CDECL
unix_logb
(
double
x
)
{
return
logb
(
x
);
}
/*********************************************************************
* logbf
*/
static
float
CDECL
unix_logbf
(
float
x
)
...
...
@@ -544,7 +536,6 @@ static const struct unix_funcs funcs =
unix_log1pf
,
unix_log2
,
unix_log2f
,
unix_logb
,
unix_logbf
,
unix_pow
,
unix_powf
,
...
...
dlls/msvcrt/unixlib.h
View file @
6758acbb
...
...
@@ -56,7 +56,6 @@ struct unix_funcs
float
(
CDECL
*
log1pf
)(
float
x
);
double
(
CDECL
*
log2
)(
double
x
);
float
(
CDECL
*
log2f
)(
float
x
);
double
(
CDECL
*
logb
)(
double
x
);
float
(
CDECL
*
logbf
)(
float
x
);
double
(
CDECL
*
pow
)(
double
x
,
double
y
);
float
(
CDECL
*
powf
)(
float
x
,
float
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