lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] SMEMCPY()


From: Kieran Mansley
Subject: Re: [lwip-devel] SMEMCPY()
Date: Sun, 12 Jun 2011 10:08:58 +0100

On 11 Jun 2011, at 23:48, Leon Woestenberg wrote:

> 
> SMEMCPY() is not documented well. I think it is intended for small
> copies. Let's say small is <64 bytes.

I think the exact optimum value of small will depend on the platform. I would 
guess it is less than 64 bytes on many.

> My GCC does not inline memcpy() using -O2 for a 6 byte MAC address.
> 
>    5d66:       4658            mov     r0, fp
>    5d68:       4651            mov     r1, sl
>    5d6a:       2206            movs    r2, #6
>    5d6c:       f018 fe5a       bl      1ea24 <memcpy>
> 
> Should be implement a byte-copy macro for SMEMCPY() in opt.h, instead
> of calling memcpy()?

I would think that the optimum implementation of SMEMCPY will depend on the 
platform; I'd be happy to provide a byte-copy version in opt.h instead of 
calling memcpy, but there are two downsides: (i) it would be less obvious that 
the platform should be implementing this to get best effect (although this 
could be solved with documentation; and (ii) I'm not sure that a generic byte 
copy would actually be that different to memcpy.

> Who did performance measurements on this, before converting our code over?

I can't remember off the top of my head.  Such things are normally discussed on 
the mailing lists, so a quick check there from around the time of commit would 
show what was done.

Kieran


reply via email to

[Prev in Thread] Current Thread [Next in Thread]