libgcc.S (__mulhi3): Correct tests to exit the loop when multiplier or multiplicand...
authorMarek Michalkiewicz <marekm@linux.org.pl>
Wed, 28 Mar 2001 17:11:28 +0000 (19:11 +0200)
committerMarek Michalkiewicz <marekm@gcc.gnu.org>
Wed, 28 Mar 2001 17:11:28 +0000 (17:11 +0000)
* config/avr/libgcc.S (__mulhi3): Correct tests to exit the loop
when multiplier or multiplicand is zero.

From-SVN: r40933

gcc/ChangeLog
gcc/config/avr/libgcc.S

index 8c76b2e0c858187ab9f2e400c01313195f8ca21a..2b2ae64d548fc8e9d711dc49928f746304716233 100644 (file)
@@ -1,3 +1,8 @@
+2001-03-28  Marek Michalkiewicz  <marekm@linux.org.pl>
+
+       * config/avr/libgcc.S (__mulhi3): Correct tests to exit the loop
+       when multiplier or multiplicand is zero.
+
 2001-03-28  Bernd Schmidt  <bernds@redhat.com>
 
        * cselib.c (hash_rtx): Don't do tail recursion elimination by hand.
index cdf2c3f4ee1f0f7374f97858c9f29e24bc33aa32..b438954b757f61db921c4a29ee5f0793e2fb17d3 100644 (file)
@@ -137,11 +137,13 @@ __mulhi3_skip1:
        add     r_arg2L,r_arg2L ; shift multiplicand
        adc     r_arg2H,r_arg2H
 
-       cpc     r_arg2L,__zero_reg__
+       cp      r_arg2L,__zero_reg__
+       cpc     r_arg2H,__zero_reg__
        breq    __mulhi3_exit   ; while multiplicand != 0
 
        lsr     r_arg1H         ; gets LSB of multiplier
        ror     r_arg1L
+       cp      r_arg1L,__zero_reg__
        cpc     r_arg1H,__zero_reg__
        brne    __mulhi3_loop   ; exit if multiplier = 0
 __mulhi3_exit: