>> You don't want to waste a lot of time in simple accessors if  
>> they are called frequently enough

Really? Sure - a few opcodes ... but in the grand scheme of things... 

For example the function target_write_memory() - with "-O2" is exactly these 
instructions

        pushl   %ebp
        movl    %esp, %ebp
        movl    8(%ebp), %edx
        popl    %ebp
        movl    (%edx), %ecx
        movl    64(%ecx), %ecx
        jmp     *%ecx

(A) 7 instructions, operating at 1ghz.

(B) if they are called "frequently enough" they live in the cache and are 
faster!

(C) And because the code is "more common/reused" - identical 7 instruction 
sequences in multiple places do not cause other identical 7 instruction 
sequences (at another address) to leave the cache

The same argument can, to a degree, be made *against* 'static inline' functions 
in headers.

-Duane.



_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to