comparison src/video/SDL_blit_A.c @ 720:f90d80d68071

N Sep 17 8791 Sam Lantinga Re: tks source released Date: Sun, 07 Sep 2003 02:51:58 +0200 From: Stephane Marchesin Subject: [SDL] Two little patches Compiling SDL with a recent gcc (gcc 3.3.1, 3.3 doesn't have this behaviour) gives some nasty warnings : SDL_blit_A.c: In function `BlitRGBtoRGBSurfaceAlpha128MMX': SDL_blit_A.c:223: warning: integer constant is too large for "long" type SDL_blit_A.c:225: warning: integer constant is too large for "long" type SDL_blit_A.c:227: warning: integer constant is too large for "long" type [...] The first attached patch (longlongfix.patch) tells gcc to really treat those constants as unsigned long long and not long. The second patch (nasinclude.patch) fixes an include problem I had while compiling nas audio : when the <audio/audiolib.h> file lies in /usr/X11R6/include, a -I/usr/X11R6/include option is needed or the file isn't found.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 21 Sep 2003 18:32:04 +0000
parents 5bb080d35049
children 22dbf364c017
comparison
equal deleted inserted replaced
719:269c97e24da6 720:f90d80d68071
218 int srcskip = info->s_skip >> 2; 218 int srcskip = info->s_skip >> 2;
219 Uint32 *dstp = (Uint32 *)info->d_pixels; 219 Uint32 *dstp = (Uint32 *)info->d_pixels;
220 int dstskip = info->d_skip >> 2; 220 int dstskip = info->d_skip >> 2;
221 Uint8 load[8]; 221 Uint8 load[8];
222 222
223 *(Uint64 *)load = 0x00fefefe00fefefe;/* alpha128 mask */ 223 *(Uint64 *)load = 0x00fefefe00fefefeULL;/* alpha128 mask */
224 movq_m2r(*load, mm4); /* alpha128 mask -> mm4 */ 224 movq_m2r(*load, mm4); /* alpha128 mask -> mm4 */
225 *(Uint64 *)load = 0x0001010100010101;/* !alpha128 mask */ 225 *(Uint64 *)load = 0x0001010100010101ULL;/* !alpha128 mask */
226 movq_m2r(*load, mm3); /* !alpha128 mask -> mm3 */ 226 movq_m2r(*load, mm3); /* !alpha128 mask -> mm3 */
227 *(Uint64 *)load = 0xFF000000FF000000;/* dst alpha mask */ 227 *(Uint64 *)load = 0xFF000000FF000000ULL;/* dst alpha mask */
228 movq_m2r(*load, mm7); /* dst alpha mask -> mm7 */ 228 movq_m2r(*load, mm7); /* dst alpha mask -> mm7 */
229 while(height--) { 229 while(height--) {
230 DUFFS_LOOP_DOUBLE2( 230 DUFFS_LOOP_DOUBLE2(
231 { 231 {
232 Uint32 s = *srcp++; 232 Uint32 s = *srcp++;
274 int dstskip = info->d_skip >> 2; 274 int dstskip = info->d_skip >> 2;
275 Uint8 load[8] = {alpha, alpha, alpha, alpha, 275 Uint8 load[8] = {alpha, alpha, alpha, alpha,
276 alpha, alpha, alpha, alpha}; 276 alpha, alpha, alpha, alpha};
277 277
278 movq_m2r(*load, mm4); /* alpha -> mm4 */ 278 movq_m2r(*load, mm4); /* alpha -> mm4 */
279 *(Uint64 *)load = 0x00FF00FF00FF00FF; 279 *(Uint64 *)load = 0x00FF00FF00FF00FFULL;
280 movq_m2r(*load, mm3); /* mask -> mm3 */ 280 movq_m2r(*load, mm3); /* mask -> mm3 */
281 pand_r2r(mm3, mm4); /* mm4 & mask -> 0A0A0A0A -> mm4 */ 281 pand_r2r(mm3, mm4); /* mm4 & mask -> 0A0A0A0A -> mm4 */
282 *(Uint64 *)load = 0xFF000000FF000000;/* dst alpha mask */ 282 *(Uint64 *)load = 0xFF000000FF000000ULL;/* dst alpha mask */
283 movq_m2r(*load, mm7); /* dst alpha mask -> mm7 */ 283 movq_m2r(*load, mm7); /* dst alpha mask -> mm7 */
284 284
285 while(height--) { 285 while(height--) {
286 DUFFS_LOOP_DOUBLE2({ 286 DUFFS_LOOP_DOUBLE2({
287 /* One Pixel Blend */ 287 /* One Pixel Blend */
358 Uint32 *dstp = (Uint32 *)info->d_pixels; 358 Uint32 *dstp = (Uint32 *)info->d_pixels;
359 int dstskip = info->d_skip >> 2; 359 int dstskip = info->d_skip >> 2;
360 Uint32 alpha = 0; 360 Uint32 alpha = 0;
361 Uint8 load[8]; 361 Uint8 load[8];
362 362
363 *(Uint64 *)load = 0x00FF00FF00FF00FF; 363 *(Uint64 *)load = 0x00FF00FF00FF00FFULL;
364 movq_m2r(*load, mm3); /* mask -> mm2 */ 364 movq_m2r(*load, mm3); /* mask -> mm2 */
365 *(Uint64 *)load = 0x00FF000000000000; 365 *(Uint64 *)load = 0x00FF000000000000ULL;
366 movq_m2r(*load, mm7); /* dst alpha mask -> mm2 */ 366 movq_m2r(*load, mm7); /* dst alpha mask -> mm2 */
367 *(Uint64 *)load = 0x00FFFFFF00FFFFFF; 367 *(Uint64 *)load = 0x00FFFFFF00FFFFFFULL;
368 movq_m2r(*load, mm0); /* alpha 255 mask -> mm0 */ 368 movq_m2r(*load, mm0); /* alpha 255 mask -> mm0 */
369 *(Uint64 *)load = 0xFF000000FF000000; 369 *(Uint64 *)load = 0xFF000000FF000000ULL;
370 movq_m2r(*load, mm6); /* alpha 255 !mask -> mm6 */ 370 movq_m2r(*load, mm6); /* alpha 255 !mask -> mm6 */
371 while(height--) { 371 while(height--) {
372 DUFFS_LOOP4({ 372 DUFFS_LOOP4({
373 alpha = *srcp; 373 alpha = *srcp;
374 alpha >>= 24; 374 alpha >>= 24;
790 movq_m2r(*load, mm0); /* alpha(0000000A) -> mm0 */ 790 movq_m2r(*load, mm0); /* alpha(0000000A) -> mm0 */
791 punpcklwd_r2r(mm0, mm0); /* 00000A0A -> mm0 */ 791 punpcklwd_r2r(mm0, mm0); /* 00000A0A -> mm0 */
792 punpcklwd_r2r(mm0, mm0); /* 0A0A0A0A -> mm0 */ 792 punpcklwd_r2r(mm0, mm0); /* 0A0A0A0A -> mm0 */
793 793
794 /* Setup the 565 color channel masks */ 794 /* Setup the 565 color channel masks */
795 *(Uint64 *)load = 0xF800F800F800F800; 795 *(Uint64 *)load = 0xF800F800F800F800ULL;
796 movq_m2r(*load, mm1); /* MASKRED -> mm1 */ 796 movq_m2r(*load, mm1); /* MASKRED -> mm1 */
797 *(Uint64 *)load = 0x07E007E007E007E0; 797 *(Uint64 *)load = 0x07E007E007E007E0ULL;
798 movq_m2r(*load, mm4); /* MASKGREEN -> mm4 */ 798 movq_m2r(*load, mm4); /* MASKGREEN -> mm4 */
799 *(Uint64 *)load = 0x001F001F001F001F; 799 *(Uint64 *)load = 0x001F001F001F001FULL;
800 movq_m2r(*load, mm7); /* MASKBLUE -> mm7 */ 800 movq_m2r(*load, mm7); /* MASKBLUE -> mm7 */
801 while(height--) { 801 while(height--) {
802 DUFFS_LOOP_QUATRO2( 802 DUFFS_LOOP_QUATRO2(
803 { 803 {
804 s = *srcp++; 804 s = *srcp++;
940 movq_m2r(*load, mm0); /* alpha(0000000A) -> mm0 */ 940 movq_m2r(*load, mm0); /* alpha(0000000A) -> mm0 */
941 punpcklwd_r2r(mm0, mm0); /* 00000A0A -> mm0 */ 941 punpcklwd_r2r(mm0, mm0); /* 00000A0A -> mm0 */
942 punpcklwd_r2r(mm0, mm0); /* 0A0A0A0A -> mm0 */ 942 punpcklwd_r2r(mm0, mm0); /* 0A0A0A0A -> mm0 */
943 943
944 /* Setup the 555 color channel masks */ 944 /* Setup the 555 color channel masks */
945 *(Uint64 *)load = 0x7C007C007C007C00; 945 *(Uint64 *)load = 0x7C007C007C007C00ULL;
946 movq_m2r(*load, mm1); /* MASKRED -> mm1 */ 946 movq_m2r(*load, mm1); /* MASKRED -> mm1 */
947 *(Uint64 *)load = 0x03E003E003E003E0; 947 *(Uint64 *)load = 0x03E003E003E003E0ULL;
948 movq_m2r(*load, mm4); /* MASKGREEN -> mm4 */ 948 movq_m2r(*load, mm4); /* MASKGREEN -> mm4 */
949 *(Uint64 *)load = 0x001F001F001F001F; 949 *(Uint64 *)load = 0x001F001F001F001FULL;
950 movq_m2r(*load, mm7); /* MASKBLUE -> mm7 */ 950 movq_m2r(*load, mm7); /* MASKBLUE -> mm7 */
951 while(height--) { 951 while(height--) {
952 DUFFS_LOOP_QUATRO2( 952 DUFFS_LOOP_QUATRO2(
953 { 953 {
954 s = *srcp++; 954 s = *srcp++;