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
23008a0f
Commit
23008a0f
authored
Nov 16, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Reimplement _dclass() using musl code.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
52dc0ccf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
20 deletions
+17
-20
math.c
dlls/msvcrt/math.c
+17
-20
No files found.
dlls/msvcrt/math.c
View file @
23008a0f
...
...
@@ -3678,35 +3678,32 @@ LDOUBLE CDECL MSVCR120_truncl(LDOUBLE x)
/*********************************************************************
* _dclass (MSVCR120.@)
*
* Copied from musl: src/math/__fpclassify.c
*/
short
CDECL
MSVCR120__dclass
(
double
x
)
{
switch
(
MSVCRT__fpclass
(
x
))
{
case
MSVCRT__FPCLASS_QNAN
:
case
MSVCRT__FPCLASS_SNAN
:
return
MSVCRT_FP_NAN
;
case
MSVCRT__FPCLASS_NINF
:
case
MSVCRT__FPCLASS_PINF
:
return
MSVCRT_FP_INFINITE
;
case
MSVCRT__FPCLASS_ND
:
case
MSVCRT__FPCLASS_PD
:
return
MSVCRT_FP_SUBNORMAL
;
case
MSVCRT__FPCLASS_NN
:
case
MSVCRT__FPCLASS_PN
:
default:
return
MSVCRT_FP_NORMAL
;
case
MSVCRT__FPCLASS_NZ
:
case
MSVCRT__FPCLASS_PZ
:
return
MSVCRT_FP_ZERO
;
}
union
{
double
f
;
UINT64
i
;
}
u
=
{
x
};
int
e
=
u
.
i
>>
52
&
0x7ff
;
if
(
!
e
)
return
u
.
i
<<
1
?
MSVCRT_FP_SUBNORMAL
:
MSVCRT_FP_ZERO
;
if
(
e
==
0x7ff
)
return
(
u
.
i
<<
12
)
?
MSVCRT_FP_NAN
:
MSVCRT_FP_INFINITE
;
return
MSVCRT_FP_NORMAL
;
}
/*********************************************************************
* _fdclass (MSVCR120.@)
*
* Copied from musl: src/math/__fpclassifyf.c
*/
short
CDECL
MSVCR120__fdclass
(
float
x
)
{
return
MSVCR120__dclass
(
x
);
union
{
float
f
;
UINT32
i
;
}
u
=
{
x
};
int
e
=
u
.
i
>>
23
&
0xff
;
if
(
!
e
)
return
u
.
i
<<
1
?
MSVCRT_FP_SUBNORMAL
:
MSVCRT_FP_ZERO
;
if
(
e
==
0xff
)
return
u
.
i
<<
9
?
MSVCRT_FP_NAN
:
MSVCRT_FP_INFINITE
;
return
MSVCRT_FP_NORMAL
;
}
/*********************************************************************
...
...
@@ -3730,7 +3727,7 @@ short CDECL MSVCR120__dtest(double *x)
*/
short
CDECL
MSVCR120__fdtest
(
float
*
x
)
{
return
MSVCR120__dclass
(
*
x
);
return
MSVCR120__
f
dclass
(
*
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