comparison src/video/SDL_blit_A.c @ 2074:9e6dc39f48b6

Merged r2913:2914 from SDL-1.2 branch into trunk: alpha blit GCC MMX asm fix.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 21 Nov 2006 23:24:33 +0000
parents eb5aedc79992
children fffea8d6bf92
comparison
equal deleted inserted replaced
2073:790726541708 2074:9e6dc39f48b6
1630 int srcskip = info->s_skip >> 2; 1630 int srcskip = info->s_skip >> 2;
1631 Uint32 *dstp = (Uint32 *) info->d_pixels; 1631 Uint32 *dstp = (Uint32 *) info->d_pixels;
1632 int dstskip = info->d_skip >> 2; 1632 int dstskip = info->d_skip >> 2;
1633 SDL_PixelFormat *sf = info->src; 1633 SDL_PixelFormat *sf = info->src;
1634 Uint32 amask = sf->Amask; 1634 Uint32 amask = sf->Amask;
1635 Uint32 ashift = sf->Ashift;
1635 1636
1636 __asm__( 1637 __asm__(
1637 /* make mm6 all zeros. */ 1638 /* make mm6 all zeros. */
1638 "pxor %%mm6, %%mm6\n" 1639 "pxor %%mm6, %%mm6\n"
1639 /* Make a mask to preserve the alpha. */ 1640 /* Make a mask to preserve the alpha. */
1647 "packsswb %%mm6, %%mm4\n\t" /* 00000FFF -> mm4 (channel mask) */ 1648 "packsswb %%mm6, %%mm4\n\t" /* 00000FFF -> mm4 (channel mask) */
1648 "packsswb %%mm6, %%mm3\n\t" /* 0000FFFF -> mm3 */ 1649 "packsswb %%mm6, %%mm3\n\t" /* 0000FFFF -> mm3 */
1649 "pxor %%mm4, %%mm3\n\t" /* 0000F000 -> mm3 (~channel mask) */ 1650 "pxor %%mm4, %%mm3\n\t" /* 0000F000 -> mm3 (~channel mask) */
1650 /* get alpha channel shift */ 1651 /* get alpha channel shift */
1651 "movd %1, %%mm5\n\t" /* Ashift -> mm5 */ 1652 "movd %1, %%mm5\n\t" /* Ashift -> mm5 */
1652 : /* nothing */ : "m"(sf->Amask), "m"(sf->Ashift)); 1653 : /* nothing */ : "m"(amask), "m"(ashift));
1653 1654
1654 while (height--) { 1655 while (height--) {
1655 1656
1656 /* *INDENT-OFF* */ 1657 /* *INDENT-OFF* */
1657 DUFFS_LOOP4({ 1658 DUFFS_LOOP4({