This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: mempcpy performance.


> OndÅej BÃlka wrote:
> Bit off topic,
> 
> I have on my todo list fix that, by on architectures without assembly
> change definition to
> 
> #define mempcpy(dest, src, n) (memcpy (dest, src, n) + n)
> 
> which would remove extra call and possibly allow extra compiler
> optimizations.

This would need to use an extern inline function, but yes that is the right way to do it if there is no assembler implementation. 

A similar thing needs to be done with bcopy and bzero - they currently don't get expanded inline at all due to missing the __asm__ "__bzero" redirection. Interestingly GCC expands __builtin_bzero into memset when inlining is not possible (although it returns the address of bzero if you use it as function symbol). 

Wilco




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]