Commit b1e7c0eb authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

MMX memcpy: set clobber list

parent 878d5212
...@@ -153,6 +153,11 @@ __asm__ __volatile__(\ ...@@ -153,6 +153,11 @@ __asm__ __volatile__(\
#define MIN_LEN 0x40 /* 64-byte blocks */ #define MIN_LEN 0x40 /* 64-byte blocks */
#endif #endif
#ifdef HAVE_SSE
VLC_SSE
#else
VLC_MMX
#endif
static void * fast_memcpy(void * to, const void * from, size_t len) static void * fast_memcpy(void * to, const void * from, size_t len)
{ {
void *retval; void *retval;
...@@ -218,7 +223,7 @@ static void * fast_memcpy(void * to, const void * from, size_t len) ...@@ -218,7 +223,7 @@ static void * fast_memcpy(void * to, const void * from, size_t len)
"movntps %%xmm1, 16(%1)\n" "movntps %%xmm1, 16(%1)\n"
"movntps %%xmm2, 32(%1)\n" "movntps %%xmm2, 32(%1)\n"
"movntps %%xmm3, 48(%1)\n" "movntps %%xmm3, 48(%1)\n"
:: "r" (from), "r" (to) : "memory"); :: "r" (from), "r" (to) : "memory", "xmm0", "xmm1", "xmm2", "xmm3");
((const unsigned char *)from)+=64; ((const unsigned char *)from)+=64;
((unsigned char *)to)+=64; ((unsigned char *)to)+=64;
} }
...@@ -240,7 +245,7 @@ static void * fast_memcpy(void * to, const void * from, size_t len) ...@@ -240,7 +245,7 @@ static void * fast_memcpy(void * to, const void * from, size_t len)
"movntps %%xmm1, 16(%1)\n" "movntps %%xmm1, 16(%1)\n"
"movntps %%xmm2, 32(%1)\n" "movntps %%xmm2, 32(%1)\n"
"movntps %%xmm3, 48(%1)\n" "movntps %%xmm3, 48(%1)\n"
:: "r" (from), "r" (to) : "memory"); :: "r" (from), "r" (to) : "memory", "xmm0", "xmm1", "xmm2", "xmm3");
((const unsigned char *)from)+=64; ((const unsigned char *)from)+=64;
((unsigned char *)to)+=64; ((unsigned char *)to)+=64;
} }
...@@ -268,7 +273,8 @@ static void * fast_memcpy(void * to, const void * from, size_t len) ...@@ -268,7 +273,8 @@ static void * fast_memcpy(void * to, const void * from, size_t len)
MOVNTQ" %%mm5, 40(%1)\n" MOVNTQ" %%mm5, 40(%1)\n"
MOVNTQ" %%mm6, 48(%1)\n" MOVNTQ" %%mm6, 48(%1)\n"
MOVNTQ" %%mm7, 56(%1)\n" MOVNTQ" %%mm7, 56(%1)\n"
:: "r" (from), "r" (to) : "memory"); :: "r" (from), "r" (to) : "memory", "mm0", "mm1", "mm2", "mm3",
"mm4", "mm5", "mm6", "mm7");
from = (const void *) (((const unsigned char *)from)+64); from = (const void *) (((const unsigned char *)from)+64);
to = (void *) (((unsigned char *)to)+64); to = (void *) (((unsigned char *)to)+64);
} }
...@@ -333,7 +339,8 @@ static void * fast_memcpy(void * to, const void * from, size_t len) ...@@ -333,7 +339,8 @@ static void * fast_memcpy(void * to, const void * from, size_t len)
" jae 1b \n\t" " jae 1b \n\t"
: "+r" (from), "+r" (to), "+r" (i) : "+r" (from), "+r" (to), "+r" (i)
: "r" (BLOCK_SIZE), "i" (BLOCK_SIZE/64), "i" (CONFUSION_FACTOR) : "r" (BLOCK_SIZE), "i" (BLOCK_SIZE/64), "i" (CONFUSION_FACTOR)
: "%eax", "%ebx" : "%eax", "%ebx", "mm0", "mm1", "mm2", "mm3",
"mm4", "mm5", "mm6", "mm7"
); );
#endif #endif
...@@ -359,7 +366,8 @@ static void * fast_memcpy(void * to, const void * from, size_t len) ...@@ -359,7 +366,8 @@ static void * fast_memcpy(void * to, const void * from, size_t len)
MOVNTQ" %%mm5, 40(%1)\n" MOVNTQ" %%mm5, 40(%1)\n"
MOVNTQ" %%mm6, 48(%1)\n" MOVNTQ" %%mm6, 48(%1)\n"
MOVNTQ" %%mm7, 56(%1)\n" MOVNTQ" %%mm7, 56(%1)\n"
:: "r" (from), "r" (to) : "memory"); :: "r" (from), "r" (to) : "memory", "mm0", "mm1", "mm2", "mm3",
"mm4", "mm5", "mm6", "mm7");
from = (const void *) (((const unsigned char *)from)+64); from = (const void *) (((const unsigned char *)from)+64);
to = (void *) (((unsigned char *)to)+64); to = (void *) (((unsigned char *)to)+64);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment