+ replace 'ld orgreg,const' with 'ld spilltemp,const' in trgcpu.do_spill_replace

git-svn-id: branches/z80@44536 -
This commit is contained in:
nickysn 2020-04-03 19:47:47 +00:00
parent fe3f4a7447
commit a58bab4318

View File

@ -183,6 +183,17 @@ unit rgcpu;
opcode:=A_LD;
result:=true;
end;
end
{ Replace 'ld orgreg,const' with 'ld spilltemp,const' }
else if (opcode=A_LD) and (ops=2) and (oper[1]^.typ=top_const) and (oper[0]^.typ=top_reg) then
begin
if (getregtype(oper[0]^.reg)=regtype) and
(get_alias(getsupreg(oper[0]^.reg))=orgreg) then
begin
instr.loadref(0,spilltemp);
opcode:=A_LD;
result:=true;
end;
end;
end;
end;