changeset 354:7de9e48c83a5

memcpy() moved mmx.h -> fastmemcpy.h
author arpi_esp
date Wed, 11 Apr 2001 19:41:38 +0000
parents 8cbc038b0547
children 70833462dee9
files libvo/mmx.h libvo/vo_3dfx.c libvo/vo_fbdev.c libvo/vo_fsdga.c libvo/vo_odivx.c libvo/vo_sdl.c libvo/vo_syncfb.c libvo/vo_x11.c libvo/vo_xv.c
diffstat 9 files changed, 8 insertions(+), 107 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/mmx.h	Wed Apr 11 19:25:18 2001 +0000
+++ b/libvo/mmx.h	Wed Apr 11 19:41:38 2001 +0000
@@ -27,104 +27,6 @@
 #ifndef _MMX_H
 #define _MMX_H
 
-/*
- This part of code was taken by from Linux-2.4.3 and slightly modified
-for MMX2 instruction set. I have done it since linux uses page aligned
-blocks but mplayer uses weakly ordered data and original sources can not
-speedup their. Only using prefetch and movntq together have effect! 
-If you have questions please contact with me: Nick Kurshev: nickols_k@mail.ru.
-*/
-
-#ifndef HAVE_MMX2
-//static inline void * __memcpy(void * to, const void * from, unsigned n)
-inline static void * memcpy(void * to, const void * from, unsigned n)
-{
-int d0, d1, d2;
-__asm__ __volatile__(
-	"rep ; movsl\n\t"
-	"testb $2,%b4\n\t"
-	"je 1f\n\t"
-	"movsw\n"
-	"1:\ttestb $1,%b4\n\t"
-	"je 2f\n\t"
-	"movsb\n"
-	"2:"
-	: "=&c" (d0), "=&D" (d1), "=&S" (d2)
-	:"0" (n/4), "q" (n),"1" ((long) to),"2" ((long) from)
-	: "memory");
-return (to);
-}
-#else
-//inline static void *__memcpy_mmx2(void *to, const void *from, unsigned len)
-inline static void * memcpy(void * to, const void * from, unsigned n)
-{
-	void *p;
-	int i;
-
-        if(len >= 0x200) /* 512-byte blocks */
-	{
-  	  p = to;
-	  i = len >> 6; /* len/64 */
-	__asm__ __volatile__ (
-		"1: prefetch (%0)\n"		/* This set is 28 bytes */
-		"   prefetch 64(%0)\n"
-		"   prefetch 128(%0)\n"
-		"   prefetch 192(%0)\n"
-		"   prefetch 256(%0)\n"
-		"2:  \n"
-		".section .fixup, \"ax\"\n"
-		"3: movw $0x1AEB, 1b\n"	/* jmp on 26 bytes */
-		"   jmp 2b\n"
-		".previous\n"
-		".section __ex_table,\"a\"\n"
-		"	.align 4\n"
-		"	.long 1b, 3b\n"
-		".previous"
-		: : "r" (from) );
-		
-	
-	for(; i>0; i--)
-	{
-		__asm__ __volatile__ (
-		"1:  prefetch 320(%0)\n"
-		"2:  movq (%0), %%mm0\n"
-		"  movq 8(%0), %%mm1\n"
-		"  movq 16(%0), %%mm2\n"
-		"  movq 24(%0), %%mm3\n"
-		"  movntq %%mm0, (%1)\n"
-		"  movntq %%mm1, 8(%1)\n"
-		"  movntq %%mm2, 16(%1)\n"
-		"  movntq %%mm3, 24(%1)\n"
-		"  movq 32(%0), %%mm0\n"
-		"  movq 40(%0), %%mm1\n"
-		"  movq 48(%0), %%mm2\n"
-		"  movq 56(%0), %%mm3\n"
-		"  movntq %%mm0, 32(%1)\n"
-		"  movntq %%mm1, 40(%1)\n"
-		"  movntq %%mm2, 48(%1)\n"
-		"  movntq %%mm3, 56(%1)\n"
-		".section .fixup, \"ax\"\n"
-		"3: movw $0x05EB, 1b\n"	/* jmp on 5 bytes */
-		"   jmp 2b\n"
-		".previous\n"
-		".section __ex_table,\"a\"\n"
-		"	.align 4\n"
-		"	.long 1b, 3b\n"
-		".previous"
-		: : "r" (from), "r" (to) : "memory");
-		from+=64;
-		to+=64;
-	}
-	        __asm__ __volatile__ ("emms":::"memory");
-	}
-	/*
-	 *	Now do the tail of the block
-	 */
-	__memcpy(to, from, len&63);
-	return p;
-}
-#endif
-
 
 /*	Warning:  at this writing, the version of GAS packaged
 	with most Linux distributions does not handle the
--- a/libvo/vo_3dfx.c	Wed Apr 11 19:25:18 2001 +0000
+++ b/libvo/vo_3dfx.c	Wed Apr 11 19:41:38 2001 +0000
@@ -49,7 +49,7 @@
 
 #include "drivers/3dfx.h"
 
-#include "mmx.h"
+#include "fastmemcpy.h"
 
 static vo_info_t vo_info = 
 {
--- a/libvo/vo_fbdev.c	Wed Apr 11 19:25:18 2001 +0000
+++ b/libvo/vo_fbdev.c	Wed Apr 11 19:41:38 2001 +0000
@@ -24,7 +24,7 @@
 #include "yuv2rgb.h"
 extern void rgb15to16_mmx(char *s0, char *d0, int count);
 
-#include "mmx.h"
+#include "fastmemcpy.h"
 
 LIBVO_EXTERN(fbdev)
 
--- a/libvo/vo_fsdga.c	Wed Apr 11 19:25:18 2001 +0000
+++ b/libvo/vo_fsdga.c	Wed Apr 11 19:41:38 2001 +0000
@@ -22,6 +22,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+//#include "fastmemcpy.h"
 
 #include "linux/keycodes.h"
 #include "config.h"
@@ -64,8 +65,6 @@
 static Display  *vo_dga_dpy;
 
 
-#include "mmx.h"
-
 #if defined (HAVE_SSE) || defined (HAVE_3DNOW)
 #define movntq "movntq" // use this for processors that have SSE or 3Dnow
 #else
--- a/libvo/vo_odivx.c	Wed Apr 11 19:25:18 2001 +0000
+++ b/libvo/vo_odivx.c	Wed Apr 11 19:41:38 2001 +0000
@@ -19,7 +19,7 @@
 
 #include "../encore/encore.h"
 
-#include "mmx.h"
+#include "fastmemcpy.h"
 
 static vo_info_t vo_info = 
 {
--- a/libvo/vo_sdl.c	Wed Apr 11 19:25:18 2001 +0000
+++ b/libvo/vo_sdl.c	Wed Apr 11 19:41:38 2001 +0000
@@ -73,8 +73,8 @@
 #include "video_out.h"
 #include "video_out_internal.h"
 
+#include "fastmemcpy.h"
 
-#include "mmx.h"
 LIBVO_EXTERN(sdl)
 
 //#include "log.h"
--- a/libvo/vo_syncfb.c	Wed Apr 11 19:25:18 2001 +0000
+++ b/libvo/vo_syncfb.c	Wed Apr 11 19:41:38 2001 +0000
@@ -43,7 +43,7 @@
 
 #include "drivers/syncfb/syncfb.h"
 
-#include "mmx.h"
+#include "fastmemcpy.h"
 
 static vo_info_t vo_info =
 {
--- a/libvo/vo_x11.c	Wed Apr 11 19:25:18 2001 +0000
+++ b/libvo/vo_x11.c	Wed Apr 11 19:41:38 2001 +0000
@@ -36,7 +36,7 @@
 
 #include "x11_common.h"
 
-#include "mmx.h"
+#include "fastmemcpy.h"
 
 static vo_info_t vo_info =
 {
--- a/libvo/vo_xv.c	Wed Apr 11 19:25:18 2001 +0000
+++ b/libvo/vo_xv.c	Wed Apr 11 19:41:38 2001 +0000
@@ -28,7 +28,7 @@
 
 #include "x11_common.h"
 
-#include "mmx.h"
+#include "fastmemcpy.h"
 
 static vo_info_t vo_info =
 {