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