summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qdrawingprimitive_sse2_p.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-04-13 16:06:57 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-04-16 19:24:06 +0000
commit964ccc58534aac436529007000d1c38d76c88834 (patch)
treed452d03dabe7c109527987b9f9385de5374c1b12 /src/gui/painting/qdrawingprimitive_sse2_p.h
parent365c63e7b177701c0bf80a7cb138b7559b92f350 (diff)
Remove separate SSE4 unpremultiply function
Merges the SSE4 specific unpremultiply with the normal version, and adds a SSE2 fallback. There was no reason to split the two since compile time options will ensure the right version is inlined. Also adds short-cut for 0 and 255 values. Change-Id: Ie5aa262f6964219fd3062d4a498f697cf79a4595 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/painting/qdrawingprimitive_sse2_p.h')
-rw-r--r--src/gui/painting/qdrawingprimitive_sse2_p.h21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/gui/painting/qdrawingprimitive_sse2_p.h b/src/gui/painting/qdrawingprimitive_sse2_p.h
index 4d0790a502..fbee06e157 100644
--- a/src/gui/painting/qdrawingprimitive_sse2_p.h
+++ b/src/gui/painting/qdrawingprimitive_sse2_p.h
@@ -236,25 +236,4 @@ QT_END_NAMESPACE
#endif // __SSE2__
-QT_BEGIN_NAMESPACE
-#if QT_COMPILER_SUPPORTS_HERE(SSE4_1)
-QT_FUNCTION_TARGET(SSE4_1)
-inline QRgb qUnpremultiply_sse4(QRgb p)
-{
- const uint alpha = qAlpha(p);
- const uint invAlpha = qt_inv_premul_factor[alpha];
- const __m128i via = _mm_set1_epi32(invAlpha);
- const __m128i vr = _mm_set1_epi32(0x8000);
- __m128i vl = _mm_cvtepu8_epi32(_mm_cvtsi32_si128(p));
- vl = _mm_mullo_epi32(vl, via);
- vl = _mm_add_epi32(vl, vr);
- vl = _mm_srai_epi32(vl, 16);
- vl = _mm_insert_epi32(vl, alpha, 3);
- vl = _mm_packus_epi32(vl, _mm_setzero_si128());
- vl = _mm_packus_epi16(vl, _mm_setzero_si128());
- return _mm_cvtsi128_si32(vl);
-}
-#endif
-QT_END_NAMESPACE
-
#endif // QDRAWINGPRIMITIVE_SSE2_P_H