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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] dev and mod may not be optimized


From: Eric Pasquier
Subject: Re: [avr-gcc-list] dev and mod may not be optimized
Date: Tue, 11 Dec 2007 17:43:38 +0100

Just a correction : div() take 2 parameters :
 
div_t t;
t=div(c, 10);
a=t.quot;
b=t.rem;
 
 
Eric.
----- Original Message -----
Sent: Tuesday, December 11, 2007 4:16 PM
Subject: Re: [avr-gcc-list] dev and mod may not be optimized

----- Original Message -----
From: "Nathan Moore" <address@hidden>
> unsigned char a, b, c;
> c = some_input_function();
> LABEL:
> a = c/10;
> b = c%10;
> ...
>
> *****************************************
> LABEL:
> mov r24,r18
> ldi r22,lo8(10)
> call __udivmodqi4
> mov r19,r24
> .LM436:
> mov r24,r18
>  call __udivmodqi4
>
> If I'm understanding __udivmodqi4 it produces the results of both of
> these with one call. 
Acording to:
 
you could do:
 
div_t t;
t=div(c/10);
a=t.quot;
b=t.rem;
????
 
 
Andras


_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

reply via email to

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