فهرست منبع

* AVR: take care of CPUAVR_HAS_MOVW in assembler routines

git-svn-id: trunk@44131 -
(cherry picked from commit 925979c6e47a9e665d804cb75b5a9b73a534b048)
florian 5 سال پیش
والد
کامیت
c9fce8b742
3فایلهای تغییر یافته به همراه12 افزوده شده و 12 حذف شده
  1. 2 2
      rtl/avr/avr.inc
  2. 3 3
      rtl/avr/divide.inc
  3. 7 7
      rtl/avr/math.inc

+ 2 - 2
rtl/avr/avr.inc

@@ -31,7 +31,7 @@ procedure fpc_cpuinit;{$ifdef SYSTEMINLINE}inline;{$endif}
   end;
 
 
-{$ifndef CPUAVR_16_REGS}
+{$if not(defined(CPUAVR_16_REGS)) and defined(CPUAVR_HAS_MOVW)}
 {$define FPC_SYSTEM_HAS_MOVE}
 procedure Move(const source;var dest;count:SizeInt);[public, alias: 'FPC_MOVE']; assembler; nostackframe;
 asm
@@ -71,7 +71,7 @@ asm
   pop r29
   pop r28
 end;
-{$endif CPUAVR_16_REGS}
+{$endif not(defined(CPUAVR_16_REGS)) and defined(CPUAVR_HAS_MOVW)}
 
 {$define FPC_SYSTEM_HAS_FILLCHAR}
 Procedure FillChar(var x;count:SizeInt;value:byte);

+ 3 - 3
rtl/avr/divide.inc

@@ -42,7 +42,7 @@ finish:
   mov R24, R22    // Move result from R22 to R24
 end;
 
-{$ifdef CPUAVR_16_REGS}
+{$if defined(CPUAVR_16_REGS) or not(defined(CPUAVR_HAS_MOVW))}
 function fpc_divmod_word(n, z: word): word; assembler; nostackframe;
 label
   div1, div2, div3, finish;
@@ -85,7 +85,7 @@ label
   div1, div2, div3, finish;
 asm
 end;
-{$else CPUAVR_16_REGS}
+{$else defined(CPUAVR_16_REGS) or not(defined(CPUAVR_HAS_MOVW))}
 // z in Ra, n in Rb, 0 in Rp
 function fpc_divmod_word(n, z: word): word; assembler; nostackframe;
 label
@@ -179,4 +179,4 @@ finish:
   pop R16
   pop R17
 end;
-{$endif CPUAVR_16_REGS}
+{$endif defined(CPUAVR_16_REGS) or not(defined(CPUAVR_HAS_MOVW))}

+ 7 - 7
rtl/avr/math.inc

@@ -110,7 +110,7 @@ asm
   rcall fpc_divmod_word
 {$endif CPUAVR_HAS_JMP_CALL}
 
-{$ifdef CPUAVR_16_REGS}
+{$if not(defined(CPUAVR_HAS_MOVW))}
   mov R24, R20
   mov R25, R21
 {$else CPUAVR_16_REGS}
@@ -150,12 +150,12 @@ asm
   rcall fpc_divmod_word
 {$endif CPUAVR_HAS_JMP_CALL}
 
-{$ifdef CPUAVR_16_REGS}
+{$if not(defined(CPUAVR_HAS_MOVW))}
   mov R24, R20
   mov R25, R21
-{$else CPUAVR_16_REGS}
+{$else not(defined(CPUAVR_HAS_MOVW))}
   movw R24, R20
-{$endif CPUAVR_16_REGS}
+{$endif not(defined(CPUAVR_HAS_MOVW))}
 end;
 
 {It is a compilerproc (systemh.inc), make an alias for internal use.}
@@ -194,15 +194,15 @@ asm
   rcall fpc_divmod_dword
 {$endif CPUAVR_HAS_JMP_CALL}
 
-{$ifdef CPUAVR_16_REGS}
+{$if not(defined(CPUAVR_HAS_MOVW))}
   mov R22, R18    // Move result from R18:R21 to R22:R25
   mov R23, R19    // Move result from R18:R21 to R22:R25
   mov R24, R20
   mov R25, R21
-{$else CPUAVR_16_REGS}
+{$else not(defined(CPUAVR_HAS_MOVW))}
   movw R22, R18    // Move result from R18:R21 to R22:R25
   movw R24, R20
-{$endif CPUAVR_16_REGS}
+{$endif not(defined(CPUAVR_HAS_MOVW))}
 end;
 
 {It is a compilerproc (systemh.inc), make an alias for internal use.}