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
d1ba9a30
Commit
d1ba9a30
authored
Apr 03, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use the ilogb()/ilogbf() implementation from the bundled musl library.
parent
52621691
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
59 deletions
+2
-59
math.c
dlls/msvcrt/math.c
+2
-53
ilogb.c
libs/musl/src/math/ilogb.c
+0
-3
ilogbf.c
libs/musl/src/math/ilogbf.c
+0
-3
No files found.
dlls/msvcrt/math.c
View file @
d1ba9a30
...
...
@@ -259,24 +259,6 @@ 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.@)
*
...
...
@@ -290,7 +272,7 @@ float CDECL _logbf(float x)
*
_errno
()
=
ERANGE
;
return
-
1
/
(
x
*
x
);
}
return
__
ilogbf
(
x
);
return
ilogbf
(
x
);
}
#endif
...
...
@@ -4522,24 +4504,6 @@ __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.@)
*
...
...
@@ -4551,7 +4515,7 @@ double CDECL _logb(double x)
return
x
*
x
;
if
(
x
==
0
)
return
math_error
(
_SING
,
"_logb"
,
x
,
0
,
-
1
/
(
x
*
x
));
return
__
ilogb
(
x
);
return
ilogb
(
x
);
}
/*********************************************************************
...
...
@@ -9866,19 +9830,4 @@ double CDECL MSVCR120_creal(_Dcomplex z)
return
z
.
_Val
[
0
];
}
/*********************************************************************
* ilogb (MSVCR120.@)
*/
int
CDECL
ilogb
(
double
x
)
{
return
__ilogb
(
x
);
}
/*********************************************************************
* ilogbf (MSVCR120.@)
*/
int
CDECL
ilogbf
(
float
x
)
{
return
__ilogbf
(
x
);
}
#endif
/* _MSVCR_VER>=120 */
libs/musl/src/math/ilogb.c
View file @
d1ba9a30
...
...
@@ -3,7 +3,6 @@
int
__cdecl
ilogb
(
double
x
)
{
#pragma STDC FENV_ACCESS ON
union
{
double
f
;
uint64_t
i
;}
u
=
{
x
};
uint64_t
i
=
u
.
i
;
int
e
=
i
>>
52
&
0x7ff
;
...
...
@@ -11,7 +10,6 @@ int __cdecl ilogb(double x)
if
(
!
e
)
{
i
<<=
12
;
if
(
i
==
0
)
{
FORCE_EVAL
(
0
/
0
.
0
f
);
return
FP_ILOGB0
;
}
/* subnormal x */
...
...
@@ -19,7 +17,6 @@ int __cdecl ilogb(double x)
return
e
;
}
if
(
e
==
0x7ff
)
{
FORCE_EVAL
(
0
/
0
.
0
f
);
return
i
<<
12
?
FP_ILOGBNAN
:
INT_MAX
;
}
return
e
-
0x3ff
;
...
...
libs/musl/src/math/ilogbf.c
View file @
d1ba9a30
...
...
@@ -3,7 +3,6 @@
int
__cdecl
ilogbf
(
float
x
)
{
#pragma STDC FENV_ACCESS ON
union
{
float
f
;
uint32_t
i
;}
u
=
{
x
};
uint32_t
i
=
u
.
i
;
int
e
=
i
>>
23
&
0xff
;
...
...
@@ -11,7 +10,6 @@ int __cdecl ilogbf(float x)
if
(
!
e
)
{
i
<<=
9
;
if
(
i
==
0
)
{
FORCE_EVAL
(
0
/
0
.
0
f
);
return
FP_ILOGB0
;
}
/* subnormal x */
...
...
@@ -19,7 +17,6 @@ int __cdecl ilogbf(float x)
return
e
;
}
if
(
e
==
0xff
)
{
FORCE_EVAL
(
0
/
0
.
0
f
);
return
i
<<
9
?
FP_ILOGBNAN
:
INT_MAX
;
}
return
e
-
0x7f
;
...
...
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