Mercurial > sdl-ios-xcode
comparison src/video/SDL_blit_A.c @ 3931:d65b4a73c991 SDL-1.2
BlitRGBtoRGBPixelAlphaMMX() is putting the wrong value into a register.
Thanks to Alex Volkov for following up on this.
Fixes Bugzilla #390.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Wed, 04 Apr 2007 09:32:29 +0000 |
parents | af4d584e0edb |
children | 5fbd763b1c88 |
comparison
equal
deleted
inserted
replaced
3930:79a4c9017550 | 3931:d65b4a73c991 |
---|---|
367 movq_r2r(mm7, mm0); /* 00FFFFFF -> mm0 */ | 367 movq_r2r(mm7, mm0); /* 00FFFFFF -> mm0 */ |
368 packsswb_r2r(mm6, mm0); /* 00000FFF -> mm0 (channel mask) */ | 368 packsswb_r2r(mm6, mm0); /* 00000FFF -> mm0 (channel mask) */ |
369 packsswb_r2r(mm6, mm3); /* 0000FFFF -> mm3 */ | 369 packsswb_r2r(mm6, mm3); /* 0000FFFF -> mm3 */ |
370 pxor_r2r(mm0, mm3); /* 0000F000 -> mm3 (~channel mask) */ | 370 pxor_r2r(mm0, mm3); /* 0000F000 -> mm3 (~channel mask) */ |
371 /* get alpha channel shift */ | 371 /* get alpha channel shift */ |
372 movd_m2r(sf->Ashift, mm5); /* Ashift -> mm5 */ | 372 __asm__ __volatile__ ( |
373 "movd %0, %%mm5" | |
374 : : "rm" ((Uint32) sf->Ashift) ); /* Ashift -> mm5 */ | |
373 | 375 |
374 while(height--) { | 376 while(height--) { |
375 DUFFS_LOOP4({ | 377 DUFFS_LOOP4({ |
376 Uint32 alpha = *srcp & amask; | 378 Uint32 alpha = *srcp & amask; |
377 /* FIXME: Here we special-case opaque alpha since the | 379 /* FIXME: Here we special-case opaque alpha since the |
1564 int srcskip = info->s_skip >> 2; | 1566 int srcskip = info->s_skip >> 2; |
1565 Uint32 *dstp = (Uint32 *)info->d_pixels; | 1567 Uint32 *dstp = (Uint32 *)info->d_pixels; |
1566 int dstskip = info->d_skip >> 2; | 1568 int dstskip = info->d_skip >> 2; |
1567 SDL_PixelFormat* sf = info->src; | 1569 SDL_PixelFormat* sf = info->src; |
1568 Uint32 amask = sf->Amask; | 1570 Uint32 amask = sf->Amask; |
1569 Uint32 ashift = sf->Ashift; | |
1570 | 1571 |
1571 __asm__ ( | 1572 __asm__ ( |
1572 /* make mm6 all zeros. */ | 1573 /* make mm6 all zeros. */ |
1573 "pxor %%mm6, %%mm6\n" | 1574 "pxor %%mm6, %%mm6\n" |
1574 | 1575 |
1586 "pxor %%mm4, %%mm3\n\t" /* 0000F000 -> mm3 (~channel mask) */ | 1587 "pxor %%mm4, %%mm3\n\t" /* 0000F000 -> mm3 (~channel mask) */ |
1587 | 1588 |
1588 /* get alpha channel shift */ | 1589 /* get alpha channel shift */ |
1589 "movd %1, %%mm5\n\t" /* Ashift -> mm5 */ | 1590 "movd %1, %%mm5\n\t" /* Ashift -> mm5 */ |
1590 | 1591 |
1591 : /* nothing */ : "m" (amask), "m" (ashift) ); | 1592 : /* nothing */ : "rm" (amask), "rm" ((Uint32) sf->Ashift) ); |
1592 | 1593 |
1593 while(height--) { | 1594 while(height--) { |
1594 | 1595 |
1595 DUFFS_LOOP4({ | 1596 DUFFS_LOOP4({ |
1596 Uint32 alpha; | 1597 Uint32 alpha; |