Re: [AVR-Chat] Re: ASM vs. C
2009-01-15 by subscriptions@aeolusdevelopment.com
David Kelly Wrote >> Can't a modern compiler figure out that all this was unnecessary? > >No doubt it could. But why sweat it? > >IIRC it takes 4 or 5 cycles to to RTI, and and Joerg says at >http://www.nongnu.org/avr-libc/user-manual/group__asmdemo.html that >dispatch takes 4 cycles to setup and 2 to RJMP the vector. (Probably 3 >for > 64K AVRs). The generated code was 11 instructions vs 2. So the >"big" difference is 20 (6 for IRQ call, 10 instructions, 4 RTI) cycles >vs 11. > >Twice almost-zero is still almost zero. This is not a "substantial" >improvement as has been claimed. Not important for overall time maybe but there are situations where a halving the latency (which this difference would provide for this source) would be the difference between working with room to spare and failure. And there are other cases where that same difference is the difference between a smoothly running system and one that runs roughly due to excessive (or worse intermittently excessive) jitter. Robert -------------------------------------------------------------------- mail2web LIVE – Free email based on Microsoft® Exchange technology - http://link.mail2web.com/LIVE