Explorar o código

* handle movw in TCpuAsmOptimizer.RegInInstruction

git-svn-id: trunk@38491 -
florian %!s(int64=7) %!d(string=hai) anos
pai
achega
9fc0f28ae4
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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;