Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | __attribute__((visibility("default"))) void qt_convert_rgb888_to_rgb32_ssse3(quint32 *dst, const uchar *src, int len) | - |
10 | { | - |
11 | quint32 *const end = dst + len; | - |
12 | | - |
13 | | - |
14 | | - |
15 | const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast<quintptr>(dst) >> 2) & 0x3)) & 0x3; | - |
16 | const int prologLength = qMin(len, offsetToAlignOn16Bytes); | - |
17 | | - |
18 | for (int i = 0; i < prologLength; ++i) { evaluated: i < prologLength yes Evaluation Count:4692 | yes Evaluation Count:9505 |
| 4692-9505 |
19 | *dst++ = qRgb(src[0], src[1], src[2]); | - |
20 | src += 3; | - |
21 | } executed: } Execution Count:4692 | 4692 |
22 | | - |
23 | | - |
24 | const __m128i shuffleMask = _mm_set_epi8(0xff, 9, 10, 11, 0xff, 6, 7, 8, 0xff, 3, 4, 5, 0xff, 0, 1, 2); | - |
25 | | - |
26 | | - |
27 | const __m128i shuffleMaskEnd = _mm_set_epi8(0xff, 13, 14, 15, 0xff, 10, 11, 12, 0xff, 7, 8, 9, 0xff, 4, 5, 6); | - |
28 | | - |
29 | | - |
30 | const __m128i alphaMask = _mm_set1_epi32(0xff000000); | - |
31 | | - |
32 | __m128i *inVectorPtr = (__m128i *)src; | - |
33 | __m128i *dstVectorPtr = (__m128i *)dst; | - |
34 | | - |
35 | const int simdRoundCount = (len - prologLength) / 16; | - |
36 | for (int i = 0; i < simdRoundCount; ++i) { evaluated: i < simdRoundCount yes Evaluation Count:106780 | yes Evaluation Count:9505 |
| 9505-106780 |
37 | __m128i firstSrcVector = _mm_lddqu_si128(inVectorPtr); | - |
38 | __m128i outputVector = _mm_shuffle_epi8(firstSrcVector, shuffleMask); | - |
39 | _mm_store_si128(dstVectorPtr, _mm_or_si128(outputVector, alphaMask)); | - |
40 | ++inVectorPtr; | - |
41 | ++dstVectorPtr; | - |
42 | | - |
43 | | - |
44 | | - |
45 | __m128i secondSrcVector = _mm_lddqu_si128(inVectorPtr); | - |
46 | __m128i srcVector = _mm_alignr_epi8(secondSrcVector, firstSrcVector, 12); | - |
47 | outputVector = _mm_shuffle_epi8(srcVector, shuffleMask); | - |
48 | _mm_store_si128(dstVectorPtr, _mm_or_si128(outputVector, alphaMask)); | - |
49 | ++inVectorPtr; | - |
50 | ++dstVectorPtr; | - |
51 | firstSrcVector = secondSrcVector; | - |
52 | | - |
53 | | - |
54 | secondSrcVector = _mm_lddqu_si128(inVectorPtr); | - |
55 | srcVector = _mm_alignr_epi8(secondSrcVector, firstSrcVector, 8); | - |
56 | outputVector = _mm_shuffle_epi8(srcVector, shuffleMask); | - |
57 | _mm_store_si128(dstVectorPtr, _mm_or_si128(outputVector, alphaMask)); | - |
58 | ++inVectorPtr; | - |
59 | ++dstVectorPtr; | - |
60 | | - |
61 | | - |
62 | | - |
63 | outputVector = _mm_shuffle_epi8(secondSrcVector, shuffleMaskEnd); | - |
64 | _mm_store_si128(dstVectorPtr, _mm_or_si128(outputVector, alphaMask)); | - |
65 | ++dstVectorPtr; | - |
66 | } executed: } Execution Count:106780 | 106780 |
67 | src = (uchar *)inVectorPtr; | - |
68 | dst = (quint32 *)dstVectorPtr; | - |
69 | | - |
70 | while (dst != end) { evaluated: dst != end yes Evaluation Count:31271 | yes Evaluation Count:9505 |
| 9505-31271 |
71 | *dst++ = qRgb(src[0], src[1], src[2]); | - |
72 | src += 3; | - |
73 | } executed: } Execution Count:31271 | 31271 |
74 | } executed: } Execution Count:9505 | 9505 |
75 | | - |
76 | void convert_RGB888_to_RGB32_ssse3(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags) | - |
77 | { | - |
78 | qt_noop(); | - |
79 | qt_noop(); | - |
80 | qt_noop(); | - |
81 | qt_noop(); | - |
82 | | - |
83 | const uchar *src_data = (uchar *) src->data; | - |
84 | quint32 *dest_data = (quint32 *) dest->data; | - |
85 | | - |
86 | for (int i = 0; i < src->height; ++i) { evaluated: i < src->height yes Evaluation Count:451 | yes Evaluation Count:9 |
| 9-451 |
87 | qt_convert_rgb888_to_rgb32_ssse3(dest_data, src_data, src->width); | - |
88 | src_data += src->bytes_per_line; | - |
89 | dest_data = (quint32 *)((uchar*)dest_data + dest->bytes_per_line); | - |
90 | } executed: } Execution Count:451 | 451 |
91 | } executed: } Execution Count:9 | 9 |
92 | | - |
93 | | - |
94 | | - |
| | |