??? 03/07/09 19:16 Read: times |
#163210 - Actually, I found the for loop faster. Responding to: ???'s previous message |
I read you comments and tried the while loop.
The ARM Real View compiler was fastest with using the loop counter. Comparing the end pointer involved two LOADs. So my best effort was 43 us. But the "revised" problem was to do a single value in 60ns. There are obviously several Compiler vendors out there, and several different ASM codes will be generated. The Keil CA compiler does not compete at all. I regard this as fairly academic anyway. I just look at a compiler as a translation tool. Functionality is more important than raw efficiency. It is seldom that this matters. Obviously I would side with Richard if it comes to squeezing the last nanosecond out of an application. Assembler will ensure the exact instruction sequence. However as a general rule, a program should be equally functional irrespective of the Compiler and hopefully the platform that it runs on. It appears that Richard's trick is to sniff the external address bus with some external hardware. A clever idea, but not exactly cricket. ( at least in terms of a language specification ) As I implied in a previous post, this is a side-effect. If you were to ask me, I would prefer an AUXRAM operation to not place stuff on an external bus. After all AUXRAM is an internal resource, and why should we waste ports on an internal operation? Again, I should qualify my comments by saying that I am neither a 8051 or ARM expert. David. |