This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
AVR __mulhi3 fix in 3.0 branch
- To: gcc-patches at gcc dot gnu dot org
- Subject: AVR __mulhi3 fix in 3.0 branch
- From: Marek Michalkiewicz <marekm at amelek dot gda dot pl>
- Date: Sat, 31 Mar 2001 19:08:58 +0200 (CEST)
I've just applied this to the 3.0 branch, already applied to 3.1.
2001-03-31 Marek Michalkiewicz <marekm@linux.org.pl>
* config/avr/libgcc.S (__mulhi3): Correct tests to exit the loop
when multiplier or multiplicand is zero.
Index: config/avr/libgcc.S
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/avr/libgcc.S,v
retrieving revision 1.11
diff -c -3 -p -r1.11 libgcc.S
*** libgcc.S 2001/01/21 07:08:46 1.11
--- libgcc.S 2001/03/31 16:33:13
*************** __mulhi3_skip1:
*** 137,148 ****
add r_arg2L,r_arg2L ; shift multiplicand
adc r_arg2H,r_arg2H
! cpc r_arg2L,__zero_reg__
breq __mulhi3_exit ; while multiplicand != 0
lsr r_arg1H ; gets LSB of multiplier
ror r_arg1L
! cpc r_arg1H,__zero_reg__
brne __mulhi3_loop ; exit if multiplier = 0
__mulhi3_exit:
mov r_arg1H,r_resH ; result to return register
--- 137,149 ----
add r_arg2L,r_arg2L ; shift multiplicand
adc r_arg2H,r_arg2H
! 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
! sbiw r_arg1L,0
brne __mulhi3_loop ; exit if multiplier = 0
__mulhi3_exit:
mov r_arg1H,r_resH ; result to return register