Re: [BK+PATCH] remove __constant_memcpy

From: Timothy Miller (miller@techsource.com)
Date: Fri Apr 18 2003 - 09:31:20 EST


Jeff Garzik wrote:

[snip]

>- case 20:
>- *(unsigned long *)to = *(const unsigned long *)from;
>- *(1+(unsigned long *)to) = *(1+(const unsigned long *)from);
>- *(2+(unsigned long *)to) = *(2+(const unsigned long *)from);
>- *(3+(unsigned long *)to) = *(3+(const unsigned long *)from);
>- *(4+(unsigned long *)to) = *(4+(const unsigned long *)from);
>- return to;
>- }
>+ if (n <= 128)
>+ return __builtin_memcpy(to, from, n);
>+
> #define COMMON(x) \
> __asm__ __volatile__( \
> "rep ; movsl" \
>
>

Ignorant questions since I haven't been following the discussion: Does
this work with unaligned copies? Does it work well? What's better,
letting the CPU do realignment, or writing the code to do bit shifts so
that both reads and writes are aligned?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Apr 23 2003 - 22:00:23 EST