diff src/video/SDL_blit.c @ 880:9ef41050100c

Date: Tue, 30 Mar 2004 21:26:47 -0600 From: Tyler Montbriand Subject: [SDL] Opteron MMX patches for SDL_blit.c and SDL_blit_A.c The inline MMX assembly in SDL_blit.c and SDL_blit_A.c compiles and runs fine unmodified under AMD Opteron. The inline assembly in SDL_yuv_mmx.c and SDL_blit_N.c unfortunately isn't directly compatible. I've included diffs from SDL_blit.c and SDL_blit_A.c that allow the MMX assembly to be compiled when USE_ASMBLIT, __x86_64__, and __GNUC__ are all defined. All I had to modify was typedefs, the inline assembly itself wasn't touched.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 11 Apr 2004 19:47:28 +0000
parents b8d311d90021
children 9301b429c99f
line wrap: on
line diff
--- a/src/video/SDL_blit.c	Thu Apr 08 21:13:14 2004 +0000
+++ b/src/video/SDL_blit.c	Sun Apr 11 19:47:28 2004 +0000
@@ -37,7 +37,11 @@
 #include "SDL_pixels_c.h"
 #include "SDL_memops.h"
 
-#if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
+#if (defined(i386) || defined(__x86_64__)) && defined(__GNUC__) && defined(USE_ASMBLIT)
+#define MMX_ASMBLIT
+#endif
+
+#if defined(MMX_ASMBLIT)
 #include "SDL_cpuinfo.h"
 #include "mmx.h"
 #endif
@@ -111,7 +115,7 @@
 	return(okay ? 0 : -1);
 }
 
-#if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
+#ifdef MMX_ASMBLIT
 void SDL_memcpyMMX(char* to,char* from,int len)
 {
 	int i;
@@ -165,7 +169,7 @@
 	dst = info->d_pixels;
 	srcskip = w+info->s_skip;
 	dstskip = w+info->d_skip;
-#if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
+#ifdef MMX_ASMBLIT
 	if(SDL_HasSSE())
 	{
 		while ( h-- ) {