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
cdcfba9a
Commit
cdcfba9a
authored
May 13, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
May 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcr120: Fix setting status word in fesetenv.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5864bc88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
math.c
dlls/msvcrt/math.c
+14
-7
No files found.
dlls/msvcrt/math.c
View file @
cdcfba9a
...
@@ -2399,12 +2399,13 @@ int CDECL fesetenv(const fenv_t *env)
...
@@ -2399,12 +2399,13 @@ int CDECL fesetenv(const fenv_t *env)
case
_RC_DOWN
:
fenv
.
control_word
|=
0x400
;
break
;
case
_RC_DOWN
:
fenv
.
control_word
|=
0x400
;
break
;
}
}
fenv
.
status_word
&=
~
0x3d
;
fenv
.
status_word
&=
~
0x3f
;
if
(
env
->
_Fe_stat
&
FE_INVALID
)
fenv
.
status_word
|=
0x1
;
if
(
env
->
_Fe_stat
&
_SW_INVALID
)
fenv
.
status_word
|=
0x1
;
if
(
env
->
_Fe_stat
&
FE_DIVBYZERO
)
fenv
.
status_word
|=
0x4
;
if
(
env
->
_Fe_stat
&
_SW_DENORMAL
)
fenv
.
status_word
|=
0x2
;
if
(
env
->
_Fe_stat
&
FE_OVERFLOW
)
fenv
.
status_word
|=
0x8
;
if
(
env
->
_Fe_stat
&
_SW_ZERODIVIDE
)
fenv
.
status_word
|=
0x4
;
if
(
env
->
_Fe_stat
&
FE_UNDERFLOW
)
fenv
.
status_word
|=
0x10
;
if
(
env
->
_Fe_stat
&
_SW_OVERFLOW
)
fenv
.
status_word
|=
0x8
;
if
(
env
->
_Fe_stat
&
FE_INEXACT
)
fenv
.
status_word
|=
0x20
;
if
(
env
->
_Fe_stat
&
_SW_UNDERFLOW
)
fenv
.
status_word
|=
0x10
;
if
(
env
->
_Fe_stat
&
_SW_INEXACT
)
fenv
.
status_word
|=
0x20
;
__asm__
__volatile__
(
"fldenv %0"
:
:
"m"
(
fenv
)
:
"st"
,
"st(1)"
,
__asm__
__volatile__
(
"fldenv %0"
:
:
"m"
(
fenv
)
:
"st"
,
"st(1)"
,
"st(2)"
,
"st(3)"
,
"st(4)"
,
"st(5)"
,
"st(6)"
,
"st(7)"
);
"st(2)"
,
"st(3)"
,
"st(4)"
,
"st(5)"
,
"st(6)"
,
"st(7)"
);
...
@@ -2413,7 +2414,7 @@ int CDECL fesetenv(const fenv_t *env)
...
@@ -2413,7 +2414,7 @@ int CDECL fesetenv(const fenv_t *env)
{
{
DWORD
fpword
;
DWORD
fpword
;
__asm__
__volatile__
(
"stmxcsr %0"
:
"=m"
(
fpword
)
);
__asm__
__volatile__
(
"stmxcsr %0"
:
"=m"
(
fpword
)
);
fpword
&=
~
0x7e
80
;
fpword
&=
~
0x7e
bf
;
if
(
env
->
_Fe_ctl
&
_EM_INVALID
)
fpword
|=
0x80
;
if
(
env
->
_Fe_ctl
&
_EM_INVALID
)
fpword
|=
0x80
;
if
(
env
->
_Fe_ctl
&
_EM_ZERODIVIDE
)
fpword
|=
0x200
;
if
(
env
->
_Fe_ctl
&
_EM_ZERODIVIDE
)
fpword
|=
0x200
;
if
(
env
->
_Fe_ctl
&
_EM_OVERFLOW
)
fpword
|=
0x400
;
if
(
env
->
_Fe_ctl
&
_EM_OVERFLOW
)
fpword
|=
0x400
;
...
@@ -2425,6 +2426,12 @@ int CDECL fesetenv(const fenv_t *env)
...
@@ -2425,6 +2426,12 @@ int CDECL fesetenv(const fenv_t *env)
case
_RC_UP
:
fpword
|=
0x4000
;
break
;
case
_RC_UP
:
fpword
|=
0x4000
;
break
;
case
_RC_DOWN
:
fpword
|=
0x2000
;
break
;
case
_RC_DOWN
:
fpword
|=
0x2000
;
break
;
}
}
if
(
env
->
_Fe_stat
&
_SW_INVALID
)
fpword
|=
0x1
;
if
(
env
->
_Fe_stat
&
_SW_DENORMAL
)
fpword
|=
0x2
;
if
(
env
->
_Fe_stat
&
_SW_ZERODIVIDE
)
fpword
|=
0x4
;
if
(
env
->
_Fe_stat
&
_SW_OVERFLOW
)
fpword
|=
0x8
;
if
(
env
->
_Fe_stat
&
_SW_UNDERFLOW
)
fpword
|=
0x10
;
if
(
env
->
_Fe_stat
&
_SW_INEXACT
)
fpword
|=
0x20
;
__asm__
__volatile__
(
"ldmxcsr %0"
:
:
"m"
(
fpword
)
);
__asm__
__volatile__
(
"ldmxcsr %0"
:
:
"m"
(
fpword
)
);
}
}
...
...
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