comparison src/video/SDL_surface.c @ 2251:292bee385630

SSE and MMX intrinsics work with Visual Studio now...
author Sam Lantinga <slouken@libsdl.org>
date Thu, 16 Aug 2007 06:37:22 +0000
parents 5a58b57b6724
children 6d99edd791bf
comparison
equal deleted inserted replaced
2250:e1d228456537 2251:292bee385630
510 } 510 }
511 511
512 #ifdef __SSE__ 512 #ifdef __SSE__
513 /* *INDENT-OFF* */ 513 /* *INDENT-OFF* */
514 514
515 #ifdef _MSC_VER
516 #define SSE_BEGIN \
517 __m128 c128; \
518 c128.m128_u32[0] = color; \
519 c128.m128_u32[1] = color; \
520 c128.m128_u32[2] = color; \
521 c128.m128_u32[3] = color;
522 #else
515 #define SSE_BEGIN \ 523 #define SSE_BEGIN \
516 DECLARE_ALIGNED(Uint32, cccc[4], 16); \ 524 DECLARE_ALIGNED(Uint32, cccc[4], 16); \
517 cccc[0] = color; \ 525 cccc[0] = color; \
518 cccc[1] = color; \ 526 cccc[1] = color; \
519 cccc[2] = color; \ 527 cccc[2] = color; \
520 cccc[3] = color; \ 528 cccc[3] = color; \
521 __m128 c128 = *(__m128 *)cccc; 529 __m128 c128 = *(__m128 *)cccc;
530 #endif
522 531
523 #define SSE_WORK \ 532 #define SSE_WORK \
524 for (i = n / 64; i--;) { \ 533 for (i = n / 64; i--;) { \
525 _mm_stream_ps((float *)(p+0), c128); \ 534 _mm_stream_ps((float *)(p+0), c128); \
526 _mm_stream_ps((float *)(p+16), c128); \ 535 _mm_stream_ps((float *)(p+16), c128); \