On Mon, Feb 7, 2011 at 9:50 AM, Marc Pignat <marc.pig...@hevs.ch> wrote:
> On Monday 07 February 2011 09:09:36 Øyvind Harboe wrote:
>> What impact would it have to make this an
>> inline fn?
>>
> ...
>>
> Inlined or not, this function could be faster.
>
> Even with inlining and constant propagation, I don't think gcc is smart enough
> to replace "buf_set_buf(_src, 0, dst, 0, 64);" by "memcpy(_src, dst, 8);"

Sure it is! Just set up an if() statement that it can
optimize and execute memcpy() in that case!

With -O3 it can do a lot of constant propagation and
figure out that an if() is always taken, especially if
the args to if() are constant.


-- 
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 87 40 27

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to