changeset 2833:1b6c207c0410

Enable MMX stuff I don't know why Michael Niedermayer disabled it but: my benchmarks of 25 frames for TIMER+SUBTITLE (measured by RDTSC): Non-MMX stuff: total=306142159 MMX stuff: total=159534150
author nick
date Sun, 11 Nov 2001 14:42:10 +0000
parents 99d169b25fbf
children b7d3b450f8fd
files libvo/osd.c libvo/osd_template.c
diffstat 2 files changed, 14 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/osd.c	Sun Nov 11 14:41:19 2001 +0000
+++ b/libvo/osd.c	Sun Nov 11 14:42:10 2001 +0000
@@ -7,6 +7,8 @@
 #include "config.h"
 #include "osd.h"
 #include "../mmx_defs.h"
+//#define ENABLE_PROFILE
+#include "../my_profile.h"
 
 void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
     int y;
@@ -76,25 +78,13 @@
     return;
 }
 
-#ifdef PROFILE_ME
-static inline unsigned long long int read_tsc( void )
-{
-  unsigned long long int retval;
-  __asm __volatile ("rdtsc":"=A"(retval)::"memory");
-  return retval;
-}
-#endif
-
 void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
     int y;
-#ifdef PROFILE_ME
-unsigned long long v1,v2;
-v1 = read_tsc();
-#endif
+PROFILE_START();
     for(y=0;y<h;y++){
         register int x;
 #ifdef ARCH_X86
-#ifdef HAVE_MMX2
+#ifdef HAVE_MMX
 	asm volatile(
 		"pxor %%mm7, %%mm7		\n\t"
 		"xorl %%eax, %%eax		\n\t"
@@ -121,7 +111,7 @@
 		"punpcklbw %%mm2, %%mm2		\n\t" // src AABBCCDD
 		"punpcklbw %%mm2, %%mm2		\n\t" // src AAAABBBB
 		"paddb %%mm2, %%mm0		\n\t"
-		MOVNTQ" %%mm0, (%0, %%eax, 4)	\n\t"
+		"movq %%mm0, (%0, %%eax, 4)	\n\t"
 		"addl $2, %%eax			\n\t"
 		"cmpl %3, %%eax			\n\t"
 		" jb 1b				\n\t"
@@ -175,14 +165,10 @@
         srca+=srcstride;
         dstbase+=dststride;
     }
-#ifdef HAVE_MMX2
-	asm volatile(SFENCE:::"memory");
+#ifdef HAVE_MMX
 	asm volatile(EMMS:::"memory");
 #endif
-#ifdef PROFILE_ME
-v2 = read_tsc();
-printf("rd_tsc: %llu\n\t",v2-v1);
-#endif
+PROFILE_END("vo_draw_alpha_rgb32");
     return;
 }
 
--- a/libvo/osd_template.c	Sun Nov 11 14:41:19 2001 +0000
+++ b/libvo/osd_template.c	Sun Nov 11 14:42:10 2001 +0000
@@ -7,6 +7,8 @@
 #include "config.h"
 #include "osd.h"
 #include "../mmx_defs.h"
+//#define ENABLE_PROFILE
+#include "../my_profile.h"
 
 void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
     int y;
@@ -76,25 +78,13 @@
     return;
 }
 
-#ifdef PROFILE_ME
-static inline unsigned long long int read_tsc( void )
-{
-  unsigned long long int retval;
-  __asm __volatile ("rdtsc":"=A"(retval)::"memory");
-  return retval;
-}
-#endif
-
 void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
     int y;
-#ifdef PROFILE_ME
-unsigned long long v1,v2;
-v1 = read_tsc();
-#endif
+PROFILE_START();
     for(y=0;y<h;y++){
         register int x;
 #ifdef ARCH_X86
-#ifdef HAVE_MMX2
+#ifdef HAVE_MMX
 	asm volatile(
 		"pxor %%mm7, %%mm7		\n\t"
 		"xorl %%eax, %%eax		\n\t"
@@ -121,7 +111,7 @@
 		"punpcklbw %%mm2, %%mm2		\n\t" // src AABBCCDD
 		"punpcklbw %%mm2, %%mm2		\n\t" // src AAAABBBB
 		"paddb %%mm2, %%mm0		\n\t"
-		MOVNTQ" %%mm0, (%0, %%eax, 4)	\n\t"
+		"movq %%mm0, (%0, %%eax, 4)	\n\t"
 		"addl $2, %%eax			\n\t"
 		"cmpl %3, %%eax			\n\t"
 		" jb 1b				\n\t"
@@ -175,14 +165,10 @@
         srca+=srcstride;
         dstbase+=dststride;
     }
-#ifdef HAVE_MMX2
-	asm volatile(SFENCE:::"memory");
+#ifdef HAVE_MMX
 	asm volatile(EMMS:::"memory");
 #endif
-#ifdef PROFILE_ME
-v2 = read_tsc();
-printf("rd_tsc: %llu\n\t",v2-v1);
-#endif
+PROFILE_END("vo_draw_alpha_rgb32");
     return;
 }