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
25990422
Commit
25990422
authored
Aug 02, 2022
by
Brendan Shanks
Committed by
Alexandre Julliard
Aug 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wow64: Copy floating point and extended registers in copy_context_64to32.
parent
f937ad5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
1 deletion
+54
-1
cpu.c
dlls/wow64cpu/cpu.c
+54
-1
No files found.
dlls/wow64cpu/cpu.c
View file @
25990422
...
...
@@ -53,6 +53,51 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved )
return
TRUE
;
}
/***********************************************************************
* fpux_to_fpu
*
* Build a standard i386 FPU context from an extended one.
*/
static
void
fpux_to_fpu
(
I386_FLOATING_SAVE_AREA
*
fpu
,
const
XMM_SAVE_AREA32
*
fpux
)
{
unsigned
int
i
,
tag
,
stack_top
;
fpu
->
ControlWord
=
fpux
->
ControlWord
;
fpu
->
StatusWord
=
fpux
->
StatusWord
;
fpu
->
ErrorOffset
=
fpux
->
ErrorOffset
;
fpu
->
ErrorSelector
=
fpux
->
ErrorSelector
|
(
fpux
->
ErrorOpcode
<<
16
);
fpu
->
DataOffset
=
fpux
->
DataOffset
;
fpu
->
DataSelector
=
fpux
->
DataSelector
;
fpu
->
Cr0NpxState
=
fpux
->
StatusWord
|
0xffff0000
;
stack_top
=
(
fpux
->
StatusWord
>>
11
)
&
7
;
fpu
->
TagWord
=
0xffff0000
;
for
(
i
=
0
;
i
<
8
;
i
++
)
{
memcpy
(
&
fpu
->
RegisterArea
[
10
*
i
],
&
fpux
->
FloatRegisters
[
i
],
10
);
if
(
!
(
fpux
->
TagWord
&
(
1
<<
i
)))
tag
=
3
;
/* empty */
else
{
const
M128A
*
reg
=
&
fpux
->
FloatRegisters
[(
i
-
stack_top
)
&
7
];
if
((
reg
->
High
&
0x7fff
)
==
0x7fff
)
/* exponent all ones */
{
tag
=
2
;
/* special */
}
else
if
(
!
(
reg
->
High
&
0x7fff
))
/* exponent all zeroes */
{
if
(
reg
->
Low
)
tag
=
2
;
/* special */
else
tag
=
1
;
/* zero */
}
else
{
if
(
reg
->
Low
>>
63
)
tag
=
0
;
/* valid */
else
tag
=
2
;
/* special */
}
}
fpu
->
TagWord
|=
tag
<<
(
2
*
i
);
}
}
/**********************************************************************
* copy_context_64to32
*
...
...
@@ -97,7 +142,15 @@ static void copy_context_64to32( I386_CONTEXT *ctx32, DWORD flags, AMD64_CONTEXT
ctx32
->
Dr6
=
ctx64
->
Dr6
;
ctx32
->
Dr7
=
ctx64
->
Dr7
;
}
/* FIXME: floating point + xstate */
if
(
flags
&
CONTEXT_I386_FLOATING_POINT
)
{
fpux_to_fpu
(
&
ctx32
->
FloatSave
,
&
ctx64
->
FltSave
);
}
if
(
flags
&
CONTEXT_I386_EXTENDED_REGISTERS
)
{
*
(
XSAVE_FORMAT
*
)
ctx32
->
ExtendedRegisters
=
ctx64
->
FltSave
;
}
/* FIXME: xstate */
}
...
...
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