mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 02:49:21 +02:00
* swap fpu stack correctly when moving data into xmm registers
git-svn-id: trunk@45637 -
This commit is contained in:
parent
20f6514d97
commit
b2ed667a86
@ -875,14 +875,14 @@ unit nx86add;
|
|||||||
|
|
||||||
pass_left_right;
|
pass_left_right;
|
||||||
{ fpu operands are always in reversed order on the stack }
|
{ fpu operands are always in reversed order on the stack }
|
||||||
if (left.location.loc=LOC_FPUREGISTER) and (right.location.loc=LOC_FPUREGISTER) then
|
if (left.location.loc in [LOC_FPUREGISTER,LOC_CFPUREGISTER]) and (right.location.loc in [LOC_FPUREGISTER,LOC_CFPUREGISTER]) then
|
||||||
toggleflag(nf_swapped);
|
toggleflag(nf_swapped);
|
||||||
|
|
||||||
if (nf_swapped in flags) then
|
if (nf_swapped in flags) then
|
||||||
{ can't use swapleftright if both are on the fpu stack, since then }
|
{ can't use swapleftright if both are on the fpu stack, since then }
|
||||||
{ both are "R_ST" -> nothing would change -> manually switch }
|
{ both are "R_ST" -> nothing would change -> manually switch }
|
||||||
if (left.location.loc = LOC_FPUREGISTER) and
|
if (left.location.loc in [LOC_FPUREGISTER,LOC_CFPUREGISTER]) and
|
||||||
(right.location.loc = LOC_FPUREGISTER) then
|
(right.location.loc in [LOC_FPUREGISTER,LOC_CFPUREGISTER]) then
|
||||||
emit_none(A_FXCH,S_NO)
|
emit_none(A_FXCH,S_NO)
|
||||||
else
|
else
|
||||||
swapleftright;
|
swapleftright;
|
||||||
@ -1018,14 +1018,14 @@ unit nx86add;
|
|||||||
|
|
||||||
pass_left_right;
|
pass_left_right;
|
||||||
{ fpu operands are always in reversed order on the stack }
|
{ fpu operands are always in reversed order on the stack }
|
||||||
if (left.location.loc=LOC_FPUREGISTER) and (right.location.loc=LOC_FPUREGISTER) then
|
if (left.location.loc in [LOC_FPUREGISTER,LOC_CFPUREGISTER]) and (right.location.loc in [LOC_FPUREGISTER,LOC_CFPUREGISTER]) then
|
||||||
toggleflag(nf_swapped);
|
toggleflag(nf_swapped);
|
||||||
|
|
||||||
if (nf_swapped in flags) then
|
if (nf_swapped in flags) then
|
||||||
{ can't use swapleftright if both are on the fpu stack, since then }
|
{ can't use swapleftright if both are on the fpu stack, since then }
|
||||||
{ both are "R_ST" -> nothing would change -> manually switch }
|
{ both are "R_ST" -> nothing would change -> manually switch }
|
||||||
if (left.location.loc = LOC_FPUREGISTER) and
|
if (left.location.loc in [LOC_FPUREGISTER,LOC_CFPUREGISTER]) and
|
||||||
(right.location.loc = LOC_FPUREGISTER) then
|
(right.location.loc in [LOC_FPUREGISTER,LOC_CFPUREGISTER]) then
|
||||||
emit_none(A_FXCH,S_NO)
|
emit_none(A_FXCH,S_NO)
|
||||||
else
|
else
|
||||||
swapleftright;
|
swapleftright;
|
||||||
@ -1191,6 +1191,10 @@ unit nx86add;
|
|||||||
internalerror(200402222);
|
internalerror(200402222);
|
||||||
pass_left_right;
|
pass_left_right;
|
||||||
|
|
||||||
|
{ fpu operands are always in reversed order on the stack }
|
||||||
|
if (left.location.loc in [LOC_FPUREGISTER,LOC_CFPUREGISTER]) and (right.location.loc in [LOC_FPUREGISTER,LOC_CFPUREGISTER]) then
|
||||||
|
toggleflag(nf_swapped);
|
||||||
|
|
||||||
location_reset(location,LOC_FLAGS,OS_NO);
|
location_reset(location,LOC_FLAGS,OS_NO);
|
||||||
|
|
||||||
{ Direct move fpu->mm register is not possible, so force any fpu operands to
|
{ Direct move fpu->mm register is not possible, so force any fpu operands to
|
||||||
|
Loading…
Reference in New Issue
Block a user