瀏覽代碼

* handle movw in TCpuAsmOptimizer.RegInInstruction

git-svn-id: trunk@38491 -
florian 7 年之前
父節點
當前提交
9fc0f28ae4
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      compiler/avr/aoptcpu.pas

+ 4 - 0
compiler/avr/aoptcpu.pas

@@ -144,6 +144,10 @@ Implementation
       If (p1.typ = ait_instruction) and (taicpu(p1).opcode in [A_MUL,A_MULS,A_FMUL,A_FMULS,A_FMULSU]) and
               ((getsupreg(reg)=RS_R0) or (getsupreg(reg)=RS_R1)) then
         Result:=true
+      else if (p1.typ = ait_instruction) and (taicpu(p1).opcode=A_MOVW) and
+        ((TRegister(ord(taicpu(p1).oper[0]^.reg)+1)=reg) or (TRegister(ord(taicpu(p1).oper[1]^.reg)+1)=reg) or
+         (taicpu(p1).oper[0]^.reg=reg) or (taicpu(p1).oper[1]^.reg=reg)) then
+        Result:=true
       else
         Result:=inherited RegInInstruction(Reg, p1);
     end;