Преглед изворни кода

tiny optimization for clearing address regs

git-svn-id: trunk@26569 -
Károly Balogh пре 11 година
родитељ
комит
667ec17cae
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      compiler/m68k/cgcpu.pas

+ 5 - 1
compiler/m68k/cgcpu.pas

@@ -715,7 +715,11 @@ unit cgcpu;
       begin
         if isaddressregister(register) then
          begin
-           list.concat(taicpu.op_const_reg(A_MOVE,S_L,longint(a),register))
+           { an m68k manual I have recommends SUB Ax,Ax to be used instead of CLR for address regs }
+           if a = 0 then
+             list.concat(taicpu.op_reg_reg(A_SUB,S_L,register,register))
+           else
+             list.concat(taicpu.op_const_reg(A_MOVE,S_L,longint(a),register));
          end
         else
         if a = 0 then