Browse Source

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

git-svn-id: branches/z80@44536 -
nickysn 5 năm trước cách đây
mục cha
commit
a58bab4318
1 tập tin đã thay đổi với 11 bổ sung0 xóa
  1. 11 0
      compiler/z80/rgcpu.pas

+ 11 - 0
compiler/z80/rgcpu.pas

@@ -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;