[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] dev and mod may not be optimized
From: |
Gre7g Luterman |
Subject: |
Re: [avr-gcc-list] dev and mod may not be optimized |
Date: |
Tue, 11 Dec 2007 15:56:06 -0800 (PST) |
--- "Dmitry K." <address@hidden> wrote:
> Alas, the usage of div() function is more space and
> more time
> expansive. The reason is that div() uses an another
> function:
> __divmodhi4(), i.e. 16-bits.
>
> Compare two programs:
> prog1: 150 bytes, 238 clocks
> prog2: 212 bytes, 316 clocks
Well if size & speed are getting you down, try this:
http://pastie.textmate.org/127218
The calculation takes 22 bytes and executes in 40
clocks. As an assembly-language programmer, having
that extra MOV in the beginning annoys me, but hey, I
try not to break the asm rules.
Regardless, you'd be hard-pressed to get it much
smaller or faster.
HTH,
Gre7g
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
- [avr-gcc-list] dev and mod may not be optimized, Nathan Moore, 2007/12/11
- AW: [avr-gcc-list] dev and mod may not be optimized, Haase Bjoern (PT/EMM1), 2007/12/11
- Re: [avr-gcc-list] dev and mod may not be optimized, Albert Andras, 2007/12/11
- Re: [avr-gcc-list] dev and mod may not be optimized,
Gre7g Luterman <=
- Re: [avr-gcc-list] dev and mod may not be optimized, Paulo Marques, 2007/12/12
- Re: [avr-gcc-list] dev and mod may not be optimized, Paulo Marques, 2007/12/12
- Re: [avr-gcc-list] dev and mod may not be optimized, Gre7g Luterman, 2007/12/12
- Re: [avr-gcc-list] dev and mod may not be optimized, Paulo Marques, 2007/12/12
- Re: [avr-gcc-list] dev and mod may not be optimized, David Brown, 2007/12/12