comparison src/video/SDL_RLEaccel.c @ 879:2bacec7930b1

Date: Wed, 31 Mar 2004 09:15:57 -0600 From: Tyler Montbriand Subject: [SDL] Opteron MMX patches for SDL_RLEaccel.c The inline MMX assembly in SDL_RLEaccel.c compiles unmodified if the typedefs are adjusted to accept __x86_64__. The diff from SDL-1.2.7 is attached.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 08 Apr 2004 21:13:14 +0000
parents b8d311d90021
children 9ef41050100c
comparison
equal deleted inserted replaced
878:c7ca0f3cbca2 879:2bacec7930b1
100 #include "SDL_sysvideo.h" 100 #include "SDL_sysvideo.h"
101 #include "SDL_blit.h" 101 #include "SDL_blit.h"
102 #include "SDL_memops.h" 102 #include "SDL_memops.h"
103 #include "SDL_RLEaccel_c.h" 103 #include "SDL_RLEaccel_c.h"
104 104
105 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) 105 #if defined(i386) || defined(__x86_64__)
106 #define MMX_CAPABLE
107 #endif
108
109 #if defined(MMX_CAPABLE) && defined(__GNUC__) && defined(USE_ASMBLIT)
106 #include "mmx.h" 110 #include "mmx.h"
107 #include "SDL_cpuinfo.h" 111 #include "SDL_cpuinfo.h"
108 #endif 112 #endif
109 113
110 #ifndef MAX 114 #ifndef MAX
128 */ 132 */
129 133
130 #define OPAQUE_BLIT(to, from, length, bpp, alpha) \ 134 #define OPAQUE_BLIT(to, from, length, bpp, alpha) \
131 PIXEL_COPY(to, from, length, bpp) 135 PIXEL_COPY(to, from, length, bpp)
132 136
133 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) 137 #if defined(MMX_CAPABLE) && defined(__GNUC__) && defined(USE_ASMBLIT)
134 138
135 #define ALPHA_BLIT32_888MMX(to, from, length, bpp, alpha) \ 139 #define ALPHA_BLIT32_888MMX(to, from, length, bpp, alpha) \
136 do { \ 140 do { \
137 Uint32 *srcp = (Uint32 *)(from); \ 141 Uint32 *srcp = (Uint32 *)(from); \
138 Uint32 *dstp = (Uint32 *)(to); \ 142 Uint32 *dstp = (Uint32 *)(to); \
509 src += bpp; \ 513 src += bpp; \
510 dst += bpp; \ 514 dst += bpp; \
511 } \ 515 } \
512 } while(0) 516 } while(0)
513 517
514 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) 518 #if defined(MMX_CAPABLE) && defined(__GNUC__) && defined(USE_ASMBLIT)
515 519
516 #define ALPHA_BLIT32_888_50MMX(to, from, length, bpp, alpha) \ 520 #define ALPHA_BLIT32_888_50MMX(to, from, length, bpp, alpha) \
517 do { \ 521 do { \
518 Uint32 *srcp = (Uint32 *)(from); \ 522 Uint32 *srcp = (Uint32 *)(from); \
519 Uint32 *dstp = (Uint32 *)(to); \ 523 Uint32 *dstp = (Uint32 *)(to); \
622 ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xf7de) 626 ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xf7de)
623 627
624 #define ALPHA_BLIT16_555_50(to, from, length, bpp, alpha) \ 628 #define ALPHA_BLIT16_555_50(to, from, length, bpp, alpha) \
625 ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xfbde) 629 ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xfbde)
626 630
627 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) 631 #if defined(MMX_CAPABLE) && defined(__GNUC__) && defined(USE_ASMBLIT)
628 632
629 #define CHOOSE_BLIT(blitter, alpha, fmt) \ 633 #define CHOOSE_BLIT(blitter, alpha, fmt) \
630 do { \ 634 do { \
631 if(alpha == 255) { \ 635 if(alpha == 255) { \
632 switch(fmt->BytesPerPixel) { \ 636 switch(fmt->BytesPerPixel) { \