Browse Source

* handle movw in TCpuAsmOptimizer.RegInInstruction

git-svn-id: trunk@38491 -
florian 7 năm trước cách đây
mục cha
commit
9fc0f28ae4
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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
       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
               ((getsupreg(reg)=RS_R0) or (getsupreg(reg)=RS_R1)) then
         Result:=true
         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
       else
         Result:=inherited RegInInstruction(Reg, p1);
         Result:=inherited RegInInstruction(Reg, p1);
     end;
     end;