1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-04 14:11:53 +00:00

16-byte align fix for SSE

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@568 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi_esp 2001-04-21 21:49:28 +00:00
parent 282a34b0ea
commit b128050fac

View File

@ -29,6 +29,25 @@ inline static void * fast_memcpy(void * to, const void * from, unsigned len)
void *p;
int i;
#ifdef HAVE_SSE /* Only P3 (may be Cyrix3) */
// printf("fastmemcpy_pre(0x%X,0x%X,0x%X)\n",to,from,len);
// Align dest to 16-byte boundary:
if((unsigned int)to&15){
int len2=16-((unsigned int)to&15);
if(len>len2){
len-=len2;
__asm__ __volatile__(
"rep ; movsb\n"
:"=D" (to), "=S" (from)
: "D" (to), "S" (from),"c" (len2)
: "memory");
}
}
// printf("fastmemcpy(0x%X,0x%X,0x%X)\n",to,from,len);
#endif
if(len >= 0x200) /* 512-byte blocks */
{
p = to;