comparison include/SDL_stdinc.h @ 3946:259aaca0fb0c SDL-1.2

Use system memset/memcpy on Mac OS X, since Apple hand-tunes these for each processor they ship (and thus, it's likely to beat our code on PowerPC and Intel and whatever variants or new archs show up later).
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 03 Jun 2007 06:52:06 +0000
parents 6a62cbdd65f5
children e85e65aec22f
comparison
equal deleted inserted replaced
3945:14bec334705f 3946:259aaca0fb0c
232 #define SDL_memset memset 232 #define SDL_memset memset
233 #else 233 #else
234 extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len); 234 extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len);
235 #endif 235 #endif
236 236
237 #if defined(__GNUC__) && defined(i386) 237 /* We can count on memset existing on Mac OS X and being well-tuned. */
238 #if defined(__MACH__) && defined(__APPLE__)
239 #define SDL_memset4(dst, val, len) memset(dst, val, (len)*4)
240 #elif defined(__GNUC__) && defined(i386)
238 #define SDL_memset4(dst, val, len) \ 241 #define SDL_memset4(dst, val, len) \
239 do { \ 242 do { \
240 int u0, u1, u2; \ 243 int u0, u1, u2; \
241 __asm__ __volatile__ ( \ 244 __asm__ __volatile__ ( \
242 "cld\n\t" \ 245 "cld\n\t" \
261 } while ( --_n ); \ 264 } while ( --_n ); \
262 } \ 265 } \
263 } while(0) 266 } while(0)
264 #endif 267 #endif
265 268
266 #if defined(__GNUC__) && defined(i386) 269 /* We can count on memcpy existing on Mac OS X and being well-tuned. */
270 #if defined(__MACH__) && defined(__APPLE__)
271 #define SDL_memcpy(dst, src, len) memcpy(dst, src, len)
272 #elif defined(__GNUC__) && defined(i386)
267 #define SDL_memcpy(dst, src, len) \ 273 #define SDL_memcpy(dst, src, len) \
268 do { \ 274 do { \
269 int u0, u1, u2; \ 275 int u0, u1, u2; \
270 __asm__ __volatile__ ( \ 276 __asm__ __volatile__ ( \
271 "cld\n\t" \ 277 "cld\n\t" \
290 #else 296 #else
291 extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len); 297 extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
292 #endif 298 #endif
293 #endif 299 #endif
294 300
295 #if defined(__GNUC__) && defined(i386) 301 /* We can count on memcpy existing on Mac OS X and being well-tuned. */
302 #if defined(__MACH__) && defined(__APPLE__)
303 #define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4)
304 #elif defined(__GNUC__) && defined(i386)
296 #define SDL_memcpy4(dst, src, len) \ 305 #define SDL_memcpy4(dst, src, len) \
297 do { \ 306 do { \
298 int ecx, edi, esi; \ 307 int ecx, edi, esi; \
299 __asm__ __volatile__ ( \ 308 __asm__ __volatile__ ( \
300 "cld\n\t" \ 309 "cld\n\t" \