diff options
author | arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-04-21 21:49:28 +0000 |
---|---|---|
committer | arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-04-21 21:49:28 +0000 |
commit | b128050fac2089746cc3c826a71002da3b23d7b4 (patch) | |
tree | 3a9ea51cd34f468bda9b92f550e901eba68d129b /libvo | |
parent | 282a34b0ea3f2dccc18ad32530f4a3bf046b1fd7 (diff) | |
download | mpv-b128050fac2089746cc3c826a71002da3b23d7b4.tar.bz2 mpv-b128050fac2089746cc3c826a71002da3b23d7b4.tar.xz |
16-byte align fix for SSE
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@568 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/fastmemcpy.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libvo/fastmemcpy.h b/libvo/fastmemcpy.h index 09c40bc12f..543d46166e 100644 --- a/libvo/fastmemcpy.h +++ b/libvo/fastmemcpy.h @@ -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; |