Don't use movs in memcpy as it causes performance loss.
This commit is contained in:
parent
d04592acf0
commit
6a44dcae04
|
@ -91,6 +91,7 @@ extern "C" void* memcpy(void* restrict dstptr, const void* restrict srcptr,
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t numcopies = length / sizeof(unsigned long);
|
size_t numcopies = length / sizeof(unsigned long);
|
||||||
|
#if 0
|
||||||
#if defined(__x86_64__) || defined(__i386__)
|
#if defined(__x86_64__) || defined(__i386__)
|
||||||
unsigned long zeroed_numcopies;
|
unsigned long zeroed_numcopies;
|
||||||
#if defined(__x86_64__)
|
#if defined(__x86_64__)
|
||||||
|
@ -102,6 +103,7 @@ extern "C" void* memcpy(void* restrict dstptr, const void* restrict srcptr,
|
||||||
: "c"(numcopies), "S"(srcul), "D"(dstul)
|
: "c"(numcopies), "S"(srcul), "D"(dstul)
|
||||||
: "memory");
|
: "memory");
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
for ( size_t i = 0; i < numcopies; i++ )
|
for ( size_t i = 0; i < numcopies; i++ )
|
||||||
*dstul++ = *srcul++;
|
*dstul++ = *srcul++;
|
||||||
|
|
Loading…
Reference in New Issue