comparison src/video/SDL_memops.h @ 1:cf2af46e9e2a

Changes since SDL 1.2.0 release
author Sam Lantinga <slouken@lokigames.com>
date Thu, 26 Apr 2001 16:50:19 +0000
parents 74212992fb08
children e8157fcb3114
comparison
equal deleted inserted replaced
0:74212992fb08 1:cf2af46e9e2a
51 : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ 51 : "=&c" (u0), "=&D" (u1), "=&S" (u2) \
52 : "0" ((unsigned)(len)/4), "q" (len), "1" (dst),"2" (src) \ 52 : "0" ((unsigned)(len)/4), "q" (len), "1" (dst),"2" (src) \
53 : "memory" ); \ 53 : "memory" ); \
54 } while(0) 54 } while(0)
55 55
56 #define SDL_memcpy4(dst, src, len) \
57 do { \
58 int ecx, edi, esi; \
59 __asm__ __volatile__ ( \
60 "cld\n\t" \
61 "rep ; movsl" \
62 : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \
63 : "0" ((unsigned)(len)), "1" (dst), "2" (src) \
64 : "memory" ); \
65 } while(0)
66
56 #define SDL_revcpy(dst, src, len) \ 67 #define SDL_revcpy(dst, src, len) \
57 do { \ 68 do { \
58 int u0, u1, u2; \ 69 int u0, u1, u2; \
59 char *dstp = (char *)(dst); \ 70 char *dstp = (char *)(dst); \
60 char *srcp = (char *)(src); \ 71 char *srcp = (char *)(src); \
102 113
103 /* If there are no optimized versions, define the normal versions */ 114 /* If there are no optimized versions, define the normal versions */
104 #ifndef SDL_memcpy 115 #ifndef SDL_memcpy
105 #define SDL_memcpy(dst, src, len) memcpy(dst, src, len) 116 #define SDL_memcpy(dst, src, len) memcpy(dst, src, len)
106 #endif 117 #endif
118
119 #ifndef SDL_memcpy4
120 #define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len) << 2)
121 #endif
122
107 #ifndef SDL_revcpy 123 #ifndef SDL_revcpy
108 #define SDL_revcpy(dst, src, len) memmove(dst, src, len) 124 #define SDL_revcpy(dst, src, len) memmove(dst, src, len)
109 #endif 125 #endif
126
110 #ifndef SDL_memset4 127 #ifndef SDL_memset4
111 #define SDL_memset4(dst, val, len) \ 128 #define SDL_memset4(dst, val, len) \
112 do { \ 129 do { \
113 unsigned _count = (len); \ 130 unsigned _count = (len); \
114 unsigned _n = (_count + 3) / 4; \ 131 unsigned _n = (_count + 3) / 4; \