avr-gcc-list
[Top][All Lists]
Advanced

[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 in


From: Marek Michalkiewicz
Subject: Re: [avr-gcc-list] Bug found in __mulhi3 - was Is this possibly a bug in avr-gcc ?
Date: Tue, 27 Mar 2001 21:22:28 +0200 (CEST)

> 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 ;).
"ror" was supposed to set the Z flag correctly...  Denis?

Marek

--- libgcc.S.orig       Sun Jan 21 14:07:52 2001
+++ libgcc.S    Tue Mar 27 21:16:27 2001
@@ -142,6 +142,7 @@
 
        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:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]