comparison 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
comparison
equal deleted inserted replaced
879:2bacec7930b1 880:9ef41050100c
35 #include "SDL_blit.h" 35 #include "SDL_blit.h"
36 #include "SDL_RLEaccel_c.h" 36 #include "SDL_RLEaccel_c.h"
37 #include "SDL_pixels_c.h" 37 #include "SDL_pixels_c.h"
38 #include "SDL_memops.h" 38 #include "SDL_memops.h"
39 39
40 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) 40 #if (defined(i386) || defined(__x86_64__)) && defined(__GNUC__) && defined(USE_ASMBLIT)
41 #define MMX_ASMBLIT
42 #endif
43
44 #if defined(MMX_ASMBLIT)
41 #include "SDL_cpuinfo.h" 45 #include "SDL_cpuinfo.h"
42 #include "mmx.h" 46 #include "mmx.h"
43 #endif 47 #endif
44 48
45 /* The general purpose software blit routine */ 49 /* The general purpose software blit routine */
109 } 113 }
110 /* Blit is done! */ 114 /* Blit is done! */
111 return(okay ? 0 : -1); 115 return(okay ? 0 : -1);
112 } 116 }
113 117
114 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) 118 #ifdef MMX_ASMBLIT
115 void SDL_memcpyMMX(char* to,char* from,int len) 119 void SDL_memcpyMMX(char* to,char* from,int len)
116 { 120 {
117 int i; 121 int i;
118 122
119 for(i=0; i<len/8; i++) { 123 for(i=0; i<len/8; i++) {
163 h = info->d_height; 167 h = info->d_height;
164 src = info->s_pixels; 168 src = info->s_pixels;
165 dst = info->d_pixels; 169 dst = info->d_pixels;
166 srcskip = w+info->s_skip; 170 srcskip = w+info->s_skip;
167 dstskip = w+info->d_skip; 171 dstskip = w+info->d_skip;
168 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) 172 #ifdef MMX_ASMBLIT
169 if(SDL_HasSSE()) 173 if(SDL_HasSSE())
170 { 174 {
171 while ( h-- ) { 175 while ( h-- ) {
172 SDL_memcpySSE(dst, src, w); 176 SDL_memcpySSE(dst, src, w);
173 src += srcskip; 177 src += srcskip;