mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 22:49:23 +02:00
+ Allow replace spilling for "opcode register,const" and "opcode const,register"
git-svn-id: trunk@7183 -
This commit is contained in:
parent
abfa85563f
commit
f3660976bc
@ -111,6 +111,11 @@ implementation
|
||||
|
||||
|
||||
function trgx86.do_spill_replace(list:TAsmList;instr:taicpu;orgreg:tsuperregister;const spilltemp:treference):boolean;
|
||||
|
||||
{Decide wether a "replace" spill is possible, i.e. wether we can replace a register
|
||||
in an instruction by a memory reference. For example, in "mov ireg26d,0", the imaginary
|
||||
register ireg26d can be replaced by a memory reference.}
|
||||
|
||||
var
|
||||
replaceoper : longint;
|
||||
begin
|
||||
@ -146,7 +151,26 @@ implementation
|
||||
(get_alias(getsupreg(oper[1]^.reg))=orgreg) then
|
||||
replaceoper:=1
|
||||
else
|
||||
internalerror(200410106);
|
||||
internalerror(200704281);
|
||||
end;
|
||||
if (oper[0]^.typ=top_reg) and
|
||||
(oper[1]^.typ=top_const) then
|
||||
begin
|
||||
if (getregtype(oper[0]^.reg)=regtype) and
|
||||
(get_alias(getsupreg(oper[0]^.reg))=orgreg) then
|
||||
replaceoper:=0
|
||||
else
|
||||
internalerror(200704282);
|
||||
end;
|
||||
if (oper[0]^.typ=top_const) and
|
||||
(oper[1]^.typ=top_reg) then
|
||||
begin
|
||||
if (getregtype(oper[1]^.reg)=regtype) and
|
||||
(get_alias(getsupreg(oper[1]^.reg))=orgreg) then
|
||||
replaceoper:=1
|
||||
else
|
||||
internalerror(200704283);
|
||||
end;
|
||||
case replaceoper of
|
||||
0 :
|
||||
begin
|
||||
@ -212,7 +236,6 @@ implementation
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ Replace register with spill reference }
|
||||
if replaceoper<>-1 then
|
||||
|
Loading…
Reference in New Issue
Block a user