[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Bug found in __mulhi3 - was Is this possibly a bug i
From: |
Denis Chertykov |
Subject: |
Re: [avr-gcc-list] Bug found in __mulhi3 - was Is this possibly a bug in avr-gcc ? |
Date: |
28 Mar 2001 22:25:33 +0400 |
Marek Michalkiewicz <address@hidden> writes:
> > ie, the function is performing 0x201 * 0x18
> >
> > The returned value is 0x18 instead of 0x3018 and is therefore incorrect.
>
> The patch below fixes it for me, but I don't know why ;).
I'm also can't understand why.
> "ror" was supposed to set the Z flag correctly... Denis?
IMHO: yes.
May be problem in `brne' or `cpc' ?
> lsr r_arg1H ; gets LSB of multiplier
> ror r_arg1L
> ! sbiw r_arg1L,0 <<-------------------------------- better
> brne __mulhi3_loop ; exit if multiplier = 0
> __mulhi3_exit: