diff options
Diffstat (limited to 'src/blitter/32bpp_anim_sse4.cpp')
-rw-r--r-- | src/blitter/32bpp_anim_sse4.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/blitter/32bpp_anim_sse4.cpp b/src/blitter/32bpp_anim_sse4.cpp index dc10ae364..1775f66e7 100644 --- a/src/blitter/32bpp_anim_sse4.cpp +++ b/src/blitter/32bpp_anim_sse4.cpp @@ -290,14 +290,7 @@ bmcr_alpha_blend_single: for (uint x = (uint) bp->width / 2; x > 0; x--) { __m128i srcABCD = _mm_loadl_epi64((const __m128i*) src); __m128i dstABCD = _mm_loadl_epi64((__m128i*) dst); - __m128i srcAB = _mm_unpacklo_epi8(srcABCD, _mm_setzero_si128()); - __m128i dstAB = _mm_unpacklo_epi8(dstABCD, _mm_setzero_si128()); - __m128i alphaAB = _mm_shuffle_epi8(srcAB, a_cm); - alphaAB = _mm_srli_epi16(alphaAB, 2); // Reduce to 64 levels of shades so the max value fits in 16 bits. - __m128i nom = _mm_sub_epi16(tr_nom_base, alphaAB); - dstAB = _mm_mullo_epi16(dstAB, nom); - dstAB = _mm_srli_epi16(dstAB, 8); - dstAB = _mm_packus_epi16(dstAB, dstAB); + DARKEN_2(); _mm_storel_epi64((__m128i *) dst, dstAB); src += 2; dst += 2; @@ -308,14 +301,7 @@ bmcr_alpha_blend_single: if (bp->width & 1) { __m128i srcABCD = _mm_cvtsi32_si128(src->data); __m128i dstABCD = _mm_cvtsi32_si128(dst->data); - __m128i srcAB = _mm_unpacklo_epi8(srcABCD, _mm_setzero_si128()); - __m128i dstAB = _mm_unpacklo_epi8(dstABCD, _mm_setzero_si128()); - __m128i alphaAB = _mm_shuffle_epi8(srcAB, a_cm); - alphaAB = _mm_srli_epi16(alphaAB, 2); - __m128i nom = _mm_sub_epi16(tr_nom_base, alphaAB); - dstAB = _mm_mullo_epi16(dstAB, nom); - dstAB = _mm_srli_epi16(dstAB, 8); - dstAB = _mm_packus_epi16(dstAB, dstAB); + DARKEN_2(); dst->data = _mm_cvtsi128_si32(dstAB); if (src[0].a) anim[0] = 0; } |