From 925979c6e47a9e665d804cb75b5a9b73a534b048 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 8 Feb 2020 22:05:20 +0000 Subject: [PATCH] * AVR: take care of CPUAVR_HAS_MOVW in assembler routines git-svn-id: trunk@44131 - --- rtl/avr/avr.inc | 4 ++-- rtl/avr/divide.inc | 6 +++--- rtl/avr/math.inc | 14 +++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rtl/avr/avr.inc b/rtl/avr/avr.inc index 484b09fc64..8f8aac1e21 100644 --- a/rtl/avr/avr.inc +++ b/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); diff --git a/rtl/avr/divide.inc b/rtl/avr/divide.inc index afecfdc421..3a03f3ca2f 100644 --- a/rtl/avr/divide.inc +++ b/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))} diff --git a/rtl/avr/math.inc b/rtl/avr/math.inc index 9f1a113fca..2ebe5f77ef 100644 --- a/rtl/avr/math.inc +++ b/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.}