/src/qtbase/src/gui/painting/qrgba64_p.h
Line | Count | Source |
1 | | // Copyright (C) 2020 The Qt Company Ltd. |
2 | | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | | // Qt-Security score:significant reason:default |
4 | | |
5 | | #ifndef QRGBA64_P_H |
6 | | #define QRGBA64_P_H |
7 | | |
8 | | // |
9 | | // W A R N I N G |
10 | | // ------------- |
11 | | // |
12 | | // This file is not part of the Qt API. It exists purely as an |
13 | | // implementation detail. This header file may change from version to |
14 | | // version without notice, or even be removed. |
15 | | // |
16 | | // We mean it. |
17 | | // |
18 | | |
19 | | #include "qrgba64.h" |
20 | | #include "qdrawhelper_p.h" |
21 | | |
22 | | #include <QtCore/private/qsimd_p.h> |
23 | | #include <QtGui/private/qtguiglobal_p.h> |
24 | | |
25 | | QT_BEGIN_NAMESPACE |
26 | | |
27 | | inline QRgba64 combineAlpha256(QRgba64 rgba64, uint alpha256) |
28 | 307k | { |
29 | 307k | return QRgba64::fromRgba64(rgba64.red(), rgba64.green(), rgba64.blue(), (rgba64.alpha() * alpha256) >> 8); |
30 | 307k | } |
31 | | |
32 | | #if defined(__SSE2__) |
33 | | static inline __m128i Q_DECL_VECTORCALL multiplyAlpha65535(__m128i rgba64, __m128i va) |
34 | 0 | { |
35 | 0 | __m128i vs = rgba64; |
36 | 0 | vs = _mm_unpacklo_epi16(_mm_mullo_epi16(vs, va), _mm_mulhi_epu16(vs, va)); |
37 | 0 | vs = _mm_add_epi32(vs, _mm_srli_epi32(vs, 16)); |
38 | 0 | vs = _mm_add_epi32(vs, _mm_set1_epi32(0x8000)); |
39 | 0 | vs = _mm_srai_epi32(vs, 16); |
40 | 0 | vs = _mm_packs_epi32(vs, vs); |
41 | 0 | return vs; |
42 | 0 | } Unexecuted instantiation: qimagescale.cpp:multiplyAlpha65535(long long __vector(2), long long __vector(2)) Unexecuted instantiation: qpaintengine_raster.cpp:multiplyAlpha65535(long long __vector(2), long long __vector(2)) Unexecuted instantiation: qpixellayout.cpp:multiplyAlpha65535(long long __vector(2), long long __vector(2)) Unexecuted instantiation: qdrawhelper_ssse3.cpp:multiplyAlpha65535(long long __vector(2), long long __vector(2)) Unexecuted instantiation: qdrawhelper_sse4.cpp:multiplyAlpha65535(long long __vector(2), long long __vector(2)) Unexecuted instantiation: qdrawhelper.cpp:multiplyAlpha65535(long long __vector(2), long long __vector(2)) Unexecuted instantiation: qcompositionfunctions.cpp:multiplyAlpha65535(long long __vector(2), long long __vector(2)) Unexecuted instantiation: qcosmeticstroker.cpp:multiplyAlpha65535(long long __vector(2), long long __vector(2)) Unexecuted instantiation: qdrawhelper_sse2.cpp:multiplyAlpha65535(long long __vector(2), long long __vector(2)) Unexecuted instantiation: qdrawhelper_avx2.cpp:multiplyAlpha65535(long long __vector(2), long long __vector(2)) |
43 | | static inline __m128i Q_DECL_VECTORCALL multiplyAlpha65535(__m128i rgba64, uint alpha65535) |
44 | 0 | { |
45 | 0 | const __m128i va = _mm_shufflelo_epi16(_mm_cvtsi32_si128(alpha65535), _MM_SHUFFLE(0, 0, 0, 0)); |
46 | 0 | return multiplyAlpha65535(rgba64, va); |
47 | 0 | } Unexecuted instantiation: qimagescale.cpp:multiplyAlpha65535(long long __vector(2), unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:multiplyAlpha65535(long long __vector(2), unsigned int) Unexecuted instantiation: qpixellayout.cpp:multiplyAlpha65535(long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:multiplyAlpha65535(long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:multiplyAlpha65535(long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper.cpp:multiplyAlpha65535(long long __vector(2), unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:multiplyAlpha65535(long long __vector(2), unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:multiplyAlpha65535(long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:multiplyAlpha65535(long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:multiplyAlpha65535(long long __vector(2), unsigned int) |
48 | | #elif defined(__ARM_NEON__) |
49 | | static inline uint16x4_t multiplyAlpha65535(uint16x4_t rgba64, uint16x4_t alpha65535) |
50 | | { |
51 | | uint32x4_t vs32 = vmull_u16(rgba64, alpha65535); // vs = vs * alpha |
52 | | vs32 = vsraq_n_u32(vs32, vs32, 16); // vs = vs + (vs >> 16) |
53 | | return vrshrn_n_u32(vs32, 16); // vs = (vs + 0x8000) >> 16 |
54 | | } |
55 | | static inline uint16x4_t multiplyAlpha65535(uint16x4_t rgba64, uint alpha65535) |
56 | | { |
57 | | uint32x4_t vs32 = vmull_n_u16(rgba64, alpha65535); // vs = vs * alpha |
58 | | vs32 = vsraq_n_u32(vs32, vs32, 16); // vs = vs + (vs >> 16) |
59 | | return vrshrn_n_u32(vs32, 16); // vs = (vs + 0x8000) >> 16 |
60 | | } |
61 | | #elif defined(__loongarch_sx) |
62 | | static inline __m128i Q_DECL_VECTORCALL multiplyAlpha65535(__m128i rgba64, __m128i va) |
63 | | { |
64 | | __m128i vs = rgba64; |
65 | | vs = __lsx_vilvl_h(__lsx_vmuh_hu(vs, va), __lsx_vmul_h(vs, va)); |
66 | | vs = __lsx_vadd_w(vs, __lsx_vsrli_w(vs, 16)); |
67 | | vs = __lsx_vadd_w(vs, __lsx_vreplgr2vr_w(0x8000)); |
68 | | vs = __lsx_vsrai_w(vs, 16); |
69 | | vs = __lsx_vpickev_h(__lsx_vsat_w(vs, 15), __lsx_vsat_w(vs, 15)); |
70 | | return vs; |
71 | | } |
72 | | static inline __m128i Q_DECL_VECTORCALL multiplyAlpha65535(__m128i rgba64, uint alpha65535) |
73 | | { |
74 | | const __m128i shuffleMask = (__m128i)(v8i16){0, 0, 0, 0, 4, 5, 6, 7}; |
75 | | const __m128i va = __lsx_vshuf_h(shuffleMask, __lsx_vldi(0), |
76 | | __lsx_vinsgr2vr_w(__lsx_vldi(0), alpha65535, 0)); |
77 | | return multiplyAlpha65535(rgba64, va); |
78 | | } |
79 | | #endif |
80 | | |
81 | | static inline QRgba64 multiplyAlpha65535(QRgba64 rgba64, uint alpha65535) |
82 | 0 | { |
83 | 0 | #if defined(__SSE2__) |
84 | 0 | const __m128i v = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&rgba64)); |
85 | 0 | const __m128i vr = multiplyAlpha65535(v, alpha65535); |
86 | 0 | QRgba64 r; |
87 | 0 | _mm_storel_epi64(reinterpret_cast<__m128i *>(&r), vr); |
88 | 0 | return r; |
89 | | #elif defined(__ARM_NEON__) |
90 | | const uint16x4_t v = vreinterpret_u16_u64(vld1_u64(reinterpret_cast<const uint64_t *>(&rgba64))); |
91 | | const uint16x4_t vr = multiplyAlpha65535(v, alpha65535); |
92 | | QRgba64 r; |
93 | | vst1_u64(reinterpret_cast<uint64_t *>(&r), vreinterpret_u64_u16(vr)); |
94 | | return r; |
95 | | #elif defined(__loongarch_sx) |
96 | | const __m128i v = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&rgba64), 0); |
97 | | const __m128i vr = multiplyAlpha65535(v, alpha65535); |
98 | | QRgba64 r; |
99 | | __lsx_vstelm_d(vr, reinterpret_cast<__m128i *>(&r), 0, 0); |
100 | | return r; |
101 | | #else |
102 | | return QRgba64::fromRgba64(qt_div_65535(rgba64.red() * alpha65535), |
103 | | qt_div_65535(rgba64.green() * alpha65535), |
104 | | qt_div_65535(rgba64.blue() * alpha65535), |
105 | | qt_div_65535(rgba64.alpha() * alpha65535)); |
106 | | #endif |
107 | 0 | } Unexecuted instantiation: qimagescale.cpp:multiplyAlpha65535(QRgba64, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:multiplyAlpha65535(QRgba64, unsigned int) Unexecuted instantiation: qpixellayout.cpp:multiplyAlpha65535(QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:multiplyAlpha65535(QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:multiplyAlpha65535(QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper.cpp:multiplyAlpha65535(QRgba64, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:multiplyAlpha65535(QRgba64, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:multiplyAlpha65535(QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:multiplyAlpha65535(QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:multiplyAlpha65535(QRgba64, unsigned int) |
108 | | |
109 | | #if defined(__SSE2__) || defined(__ARM_NEON__) || defined(__loongarch_sx) |
110 | | template<typename T> |
111 | | static inline T Q_DECL_VECTORCALL multiplyAlpha255(T rgba64, uint alpha255) |
112 | 0 | { |
113 | 0 | return multiplyAlpha65535(rgba64, alpha255 * 257); |
114 | 0 | } Unexecuted instantiation: qimagescale.cpp:long long __vector(2) multiplyAlpha255<long long __vector(2)>(long long __vector(2), unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:long long __vector(2) multiplyAlpha255<long long __vector(2)>(long long __vector(2), unsigned int) Unexecuted instantiation: qpixellayout.cpp:long long __vector(2) multiplyAlpha255<long long __vector(2)>(long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:long long __vector(2) multiplyAlpha255<long long __vector(2)>(long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:long long __vector(2) multiplyAlpha255<long long __vector(2)>(long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper.cpp:long long __vector(2) multiplyAlpha255<long long __vector(2)>(long long __vector(2), unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:long long __vector(2) multiplyAlpha255<long long __vector(2)>(long long __vector(2), unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:QRgba64 multiplyAlpha255<QRgba64>(QRgba64, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:long long __vector(2) multiplyAlpha255<long long __vector(2)>(long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:long long __vector(2) multiplyAlpha255<long long __vector(2)>(long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:long long __vector(2) multiplyAlpha255<long long __vector(2)>(long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:QRgba64 multiplyAlpha255<QRgba64>(QRgba64, unsigned int) |
115 | | #else |
116 | | template<typename T> |
117 | | static inline T multiplyAlpha255(T rgba64, uint alpha255) |
118 | | { |
119 | | return QRgba64::fromRgba64(qt_div_255(rgba64.red() * alpha255), |
120 | | qt_div_255(rgba64.green() * alpha255), |
121 | | qt_div_255(rgba64.blue() * alpha255), |
122 | | qt_div_255(rgba64.alpha() * alpha255)); |
123 | | } |
124 | | #endif |
125 | | |
126 | | #if defined __SSE2__ |
127 | | static inline __m128i Q_DECL_VECTORCALL interpolate255(__m128i x, uint alpha1, __m128i y, uint alpha2) |
128 | 0 | { |
129 | 0 | return _mm_add_epi16(multiplyAlpha255(x, alpha1), multiplyAlpha255(y, alpha2)); |
130 | 0 | } Unexecuted instantiation: qimagescale.cpp:interpolate255(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:interpolate255(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qpixellayout.cpp:interpolate255(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:interpolate255(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:interpolate255(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper.cpp:interpolate255(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:interpolate255(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:interpolate255(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:interpolate255(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:interpolate255(long long __vector(2), unsigned int, long long __vector(2), unsigned int) |
131 | | #endif |
132 | | |
133 | | #if defined __ARM_NEON__ |
134 | | inline uint16x4_t interpolate255(uint16x4_t x, uint alpha1, uint16x4_t y, uint alpha2) |
135 | | { |
136 | | return vadd_u16(multiplyAlpha255(x, alpha1), multiplyAlpha255(y, alpha2)); |
137 | | } |
138 | | #endif |
139 | | |
140 | | #if defined __loongarch_sx |
141 | | static inline __m128i Q_DECL_VECTORCALL |
142 | | interpolate255(__m128i x, uint alpha1, __m128i y, uint alpha2) |
143 | | { |
144 | | return __lsx_vadd_h(multiplyAlpha255(x, alpha1), multiplyAlpha255(y, alpha2)); |
145 | | } |
146 | | #endif |
147 | | |
148 | | static inline QRgba64 interpolate255(QRgba64 x, uint alpha1, QRgba64 y, uint alpha2) |
149 | 0 | { |
150 | 0 | #if defined(__SSE2__) |
151 | 0 | const __m128i vx = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&x)); |
152 | 0 | const __m128i vy = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&y)); |
153 | 0 | const __m128i vr = interpolate255(vx, alpha1, vy, alpha2); |
154 | 0 | QRgba64 r; |
155 | 0 | _mm_storel_epi64(reinterpret_cast<__m128i *>(&r), vr); |
156 | 0 | return r; |
157 | | #elif defined(__ARM_NEON__) |
158 | | const uint16x4_t vx = vreinterpret_u16_u64(vld1_u64(reinterpret_cast<const uint64_t *>(&x))); |
159 | | const uint16x4_t vy = vreinterpret_u16_u64(vld1_u64(reinterpret_cast<const uint64_t *>(&y))); |
160 | | const uint16x4_t vr = interpolate255(vx, alpha1, vy, alpha2); |
161 | | QRgba64 r; |
162 | | vst1_u64(reinterpret_cast<uint64_t *>(&r), vreinterpret_u64_u16(vr)); |
163 | | return r; |
164 | | #elif defined(__loongarch_sx) |
165 | | const __m128i vx = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&x), 0); |
166 | | const __m128i vy = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&y), 0); |
167 | | const __m128i vr = interpolate255(vx, alpha1, vy, alpha2); |
168 | | QRgba64 r; |
169 | | __lsx_vstelm_d(vr, reinterpret_cast<__m128i *>(&r), 0, 0); |
170 | | return r; |
171 | | #else |
172 | | return QRgba64::fromRgba64(multiplyAlpha255(x, alpha1) + multiplyAlpha255(y, alpha2)); |
173 | | #endif |
174 | 0 | } Unexecuted instantiation: qimagescale.cpp:interpolate255(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:interpolate255(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qpixellayout.cpp:interpolate255(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:interpolate255(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:interpolate255(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper.cpp:interpolate255(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:interpolate255(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:interpolate255(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:interpolate255(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:interpolate255(QRgba64, unsigned int, QRgba64, unsigned int) |
175 | | |
176 | | #if defined __SSE2__ |
177 | | static inline __m128i Q_DECL_VECTORCALL interpolate65535(__m128i x, uint alpha1, __m128i y, uint alpha2) |
178 | 0 | { |
179 | 0 | return _mm_add_epi16(multiplyAlpha65535(x, alpha1), multiplyAlpha65535(y, alpha2)); |
180 | 0 | } Unexecuted instantiation: qimagescale.cpp:interpolate65535(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:interpolate65535(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qpixellayout.cpp:interpolate65535(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:interpolate65535(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:interpolate65535(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper.cpp:interpolate65535(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:interpolate65535(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:interpolate65535(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:interpolate65535(long long __vector(2), unsigned int, long long __vector(2), unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:interpolate65535(long long __vector(2), unsigned int, long long __vector(2), unsigned int) |
181 | | |
182 | | static inline __m128i Q_DECL_VECTORCALL interpolate65535(__m128i x, __m128i alpha1, __m128i y, __m128i alpha2) |
183 | 0 | { |
184 | 0 | return _mm_add_epi16(multiplyAlpha65535(x, alpha1), multiplyAlpha65535(y, alpha2)); |
185 | 0 | } Unexecuted instantiation: qimagescale.cpp:interpolate65535(long long __vector(2), long long __vector(2), long long __vector(2), long long __vector(2)) Unexecuted instantiation: qpaintengine_raster.cpp:interpolate65535(long long __vector(2), long long __vector(2), long long __vector(2), long long __vector(2)) Unexecuted instantiation: qpixellayout.cpp:interpolate65535(long long __vector(2), long long __vector(2), long long __vector(2), long long __vector(2)) Unexecuted instantiation: qdrawhelper_ssse3.cpp:interpolate65535(long long __vector(2), long long __vector(2), long long __vector(2), long long __vector(2)) Unexecuted instantiation: qdrawhelper_sse4.cpp:interpolate65535(long long __vector(2), long long __vector(2), long long __vector(2), long long __vector(2)) Unexecuted instantiation: qdrawhelper.cpp:interpolate65535(long long __vector(2), long long __vector(2), long long __vector(2), long long __vector(2)) Unexecuted instantiation: qcompositionfunctions.cpp:interpolate65535(long long __vector(2), long long __vector(2), long long __vector(2), long long __vector(2)) Unexecuted instantiation: qcosmeticstroker.cpp:interpolate65535(long long __vector(2), long long __vector(2), long long __vector(2), long long __vector(2)) Unexecuted instantiation: qdrawhelper_sse2.cpp:interpolate65535(long long __vector(2), long long __vector(2), long long __vector(2), long long __vector(2)) Unexecuted instantiation: qdrawhelper_avx2.cpp:interpolate65535(long long __vector(2), long long __vector(2), long long __vector(2), long long __vector(2)) |
186 | | #endif |
187 | | |
188 | | #if defined __ARM_NEON__ |
189 | | inline uint16x4_t interpolate65535(uint16x4_t x, uint alpha1, uint16x4_t y, uint alpha2) |
190 | | { |
191 | | return vadd_u16(multiplyAlpha65535(x, alpha1), multiplyAlpha65535(y, alpha2)); |
192 | | } |
193 | | inline uint16x4_t interpolate65535(uint16x4_t x, uint16x4_t alpha1, uint16x4_t y, uint16x4_t alpha2) |
194 | | { |
195 | | return vadd_u16(multiplyAlpha65535(x, alpha1), multiplyAlpha65535(y, alpha2)); |
196 | | } |
197 | | #endif |
198 | | |
199 | | #if defined __loongarch_sx |
200 | | static inline __m128i Q_DECL_VECTORCALL interpolate65535(__m128i x, uint alpha1, __m128i y, uint alpha2) |
201 | | { |
202 | | return __lsx_vadd_h(multiplyAlpha65535(x, alpha1), multiplyAlpha65535(y, alpha2)); |
203 | | } |
204 | | |
205 | | static inline __m128i Q_DECL_VECTORCALL interpolate65535(__m128i x, __m128i alpha1, __m128i y, __m128i alpha2) |
206 | | { |
207 | | return __lsx_vadd_h(multiplyAlpha65535(x, alpha1), multiplyAlpha65535(y, alpha2)); |
208 | | } |
209 | | #endif |
210 | | |
211 | | static inline QRgba64 interpolate65535(QRgba64 x, uint alpha1, QRgba64 y, uint alpha2) |
212 | 0 | { |
213 | 0 | #if defined(__SSE2__) |
214 | 0 | const __m128i vx = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&x)); |
215 | 0 | const __m128i vy = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&y)); |
216 | 0 | const __m128i vr = interpolate65535(vx, alpha1, vy, alpha2); |
217 | 0 | QRgba64 r; |
218 | 0 | _mm_storel_epi64(reinterpret_cast<__m128i *>(&r), vr); |
219 | 0 | return r; |
220 | | #elif defined(__ARM_NEON__) |
221 | | const uint16x4_t vx = vreinterpret_u16_u64(vld1_u64(reinterpret_cast<const uint64_t *>(&x))); |
222 | | const uint16x4_t vy = vreinterpret_u16_u64(vld1_u64(reinterpret_cast<const uint64_t *>(&y))); |
223 | | const uint16x4_t vr = interpolate65535(vx, alpha1, vy, alpha2); |
224 | | QRgba64 r; |
225 | | vst1_u64(reinterpret_cast<uint64_t *>(&r), vreinterpret_u64_u16(vr)); |
226 | | return r; |
227 | | #elif defined(__loongarch_sx) |
228 | | const __m128i vx = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&x), 0); |
229 | | const __m128i vy = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&y), 0); |
230 | | const __m128i vr = interpolate65535(vx, alpha1, vy, alpha2); |
231 | | QRgba64 r; |
232 | | __lsx_vstelm_d(vr, reinterpret_cast<__m128i *>(&r), 0, 0); |
233 | | return r; |
234 | | #else |
235 | | return QRgba64::fromRgba64(multiplyAlpha65535(x, alpha1) + multiplyAlpha65535(y, alpha2)); |
236 | | #endif |
237 | 0 | } Unexecuted instantiation: qimagescale.cpp:interpolate65535(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:interpolate65535(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qpixellayout.cpp:interpolate65535(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:interpolate65535(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:interpolate65535(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper.cpp:interpolate65535(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:interpolate65535(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:interpolate65535(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:interpolate65535(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:interpolate65535(QRgba64, unsigned int, QRgba64, unsigned int) |
238 | | |
239 | | static inline QRgba64 addWithSaturation(QRgba64 a, QRgba64 b) |
240 | 0 | { |
241 | 0 | #if defined(__SSE2__) |
242 | 0 | const __m128i va = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&a)); |
243 | 0 | const __m128i vb = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&b)); |
244 | 0 | const __m128i vr = _mm_adds_epu16(va, vb); |
245 | 0 | QRgba64 r; |
246 | 0 | _mm_storel_epi64(reinterpret_cast<__m128i *>(&r), vr); |
247 | 0 | return r; |
248 | 0 | #elif defined(__ARM_NEON__) |
249 | 0 | const uint16x4_t va = vreinterpret_u16_u64(vld1_u64(reinterpret_cast<const uint64_t *>(&a))); |
250 | 0 | const uint16x4_t vb = vreinterpret_u16_u64(vld1_u64(reinterpret_cast<const uint64_t *>(&b))); |
251 | 0 | QRgba64 r; |
252 | 0 | vst1_u64(reinterpret_cast<uint64_t *>(&r), vreinterpret_u64_u16(vqadd_u16(va, vb))); |
253 | 0 | return r; |
254 | 0 | #elif defined(__loongarch_sx) |
255 | 0 | const __m128i va = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&a), 0); |
256 | 0 | const __m128i vb = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&b), 0); |
257 | 0 | const __m128i vr = __lsx_vsadd_hu(va, vb); |
258 | 0 | QRgba64 r; |
259 | 0 | __lsx_vstelm_d(vr, reinterpret_cast<__m128i *>(&r), 0, 0); |
260 | 0 | return r; |
261 | 0 | #else |
262 | 0 |
|
263 | 0 | return QRgba64::fromRgba64(qMin(a.red() + b.red(), 65535), |
264 | 0 | qMin(a.green() + b.green(), 65535), |
265 | 0 | qMin(a.blue() + b.blue(), 65535), |
266 | 0 | qMin(a.alpha() + b.alpha(), 65535)); |
267 | 0 | #endif |
268 | 0 | } Unexecuted instantiation: qimagescale.cpp:addWithSaturation(QRgba64, QRgba64) Unexecuted instantiation: qpaintengine_raster.cpp:addWithSaturation(QRgba64, QRgba64) Unexecuted instantiation: qpixellayout.cpp:addWithSaturation(QRgba64, QRgba64) Unexecuted instantiation: qdrawhelper_ssse3.cpp:addWithSaturation(QRgba64, QRgba64) Unexecuted instantiation: qdrawhelper_sse4.cpp:addWithSaturation(QRgba64, QRgba64) Unexecuted instantiation: qdrawhelper.cpp:addWithSaturation(QRgba64, QRgba64) Unexecuted instantiation: qcompositionfunctions.cpp:addWithSaturation(QRgba64, QRgba64) Unexecuted instantiation: qcosmeticstroker.cpp:addWithSaturation(QRgba64, QRgba64) Unexecuted instantiation: qdrawhelper_sse2.cpp:addWithSaturation(QRgba64, QRgba64) Unexecuted instantiation: qdrawhelper_avx2.cpp:addWithSaturation(QRgba64, QRgba64) |
269 | | |
270 | | #if QT_COMPILER_SUPPORTS_HERE(SSE2) |
271 | | QT_FUNCTION_TARGET(SSE2) |
272 | | static inline uint Q_DECL_VECTORCALL toArgb32(__m128i v) |
273 | 0 | { |
274 | 0 | v = _mm_unpacklo_epi16(v, _mm_setzero_si128()); |
275 | 0 | v = _mm_add_epi32(v, _mm_set1_epi32(128)); |
276 | 0 | v = _mm_sub_epi32(v, _mm_srli_epi32(v, 8)); |
277 | 0 | v = _mm_srli_epi32(v, 8); |
278 | 0 | v = _mm_packs_epi32(v, v); |
279 | 0 | v = _mm_packus_epi16(v, v); |
280 | 0 | return _mm_cvtsi128_si32(v); |
281 | 0 | } Unexecuted instantiation: qimagescale.cpp:toArgb32(long long __vector(2)) Unexecuted instantiation: qpaintengine_raster.cpp:toArgb32(long long __vector(2)) Unexecuted instantiation: qpixellayout.cpp:toArgb32(long long __vector(2)) Unexecuted instantiation: qdrawhelper_ssse3.cpp:toArgb32(long long __vector(2)) Unexecuted instantiation: qdrawhelper_sse4.cpp:toArgb32(long long __vector(2)) Unexecuted instantiation: qdrawhelper.cpp:toArgb32(long long __vector(2)) Unexecuted instantiation: qcompositionfunctions.cpp:toArgb32(long long __vector(2)) Unexecuted instantiation: qcosmeticstroker.cpp:toArgb32(long long __vector(2)) Unexecuted instantiation: qdrawhelper_sse2.cpp:toArgb32(long long __vector(2)) Unexecuted instantiation: qdrawhelper_avx2.cpp:toArgb32(long long __vector(2)) |
282 | | #elif defined __ARM_NEON__ |
283 | | static inline uint toArgb32(uint16x4_t v) |
284 | | { |
285 | | v = vsub_u16(v, vrshr_n_u16(v, 8)); |
286 | | v = vrshr_n_u16(v, 8); |
287 | | uint8x8_t v8 = vmovn_u16(vcombine_u16(v, v)); |
288 | | return vget_lane_u32(vreinterpret_u32_u8(v8), 0); |
289 | | } |
290 | | #elif defined __loongarch_sx |
291 | | static inline uint Q_DECL_VECTORCALL toArgb32(__m128i v) |
292 | | { |
293 | | v = __lsx_vilvl_h(__lsx_vldi(0), v); |
294 | | v = __lsx_vadd_w(v, __lsx_vreplgr2vr_w(128)); |
295 | | v = __lsx_vsub_w(v, __lsx_vsrli_w(v, 8)); |
296 | | v = __lsx_vsrli_w(v, 8); |
297 | | v = __lsx_vpickev_h(__lsx_vsat_w(v, 15), __lsx_vsat_w(v, 15)); |
298 | | __m128i tmp = __lsx_vmaxi_h(v, 0); |
299 | | v = __lsx_vpickev_b(__lsx_vsat_hu(tmp, 7), __lsx_vsat_hu(tmp, 7)); |
300 | | return __lsx_vpickve2gr_w(v, 0); |
301 | | } |
302 | | #endif |
303 | | |
304 | | static inline uint toArgb32(QRgba64 rgba64) |
305 | 0 | { |
306 | 0 | #if defined __SSE2__ |
307 | 0 | __m128i v = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&rgba64)); |
308 | 0 | v = _mm_shufflelo_epi16(v, _MM_SHUFFLE(3, 0, 1, 2)); |
309 | 0 | return toArgb32(v); |
310 | | #elif defined __ARM_NEON__ |
311 | | uint16x4_t v = vreinterpret_u16_u64(vld1_u64(reinterpret_cast<const uint64_t *>(&rgba64))); |
312 | | #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN |
313 | | const uint8x8_t shuffleMask = qvset_n_u8(4, 5, 2, 3, 0, 1, 6, 7); |
314 | | v = vreinterpret_u16_u8(vtbl1_u8(vreinterpret_u8_u16(v), shuffleMask)); |
315 | | #else |
316 | | v = vext_u16(v, v, 3); |
317 | | #endif |
318 | | return toArgb32(v); |
319 | | #elif defined __loongarch_sx |
320 | | __m128i v = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&rgba64), 0); |
321 | | const __m128i shuffleMask = (__m128i)(v8i16){2, 1, 0, 3, 4, 5, 6, 7}; |
322 | | v = __lsx_vshuf_h(shuffleMask, __lsx_vldi(0), v); |
323 | | return toArgb32(v); |
324 | | #else |
325 | | return rgba64.toArgb32(); |
326 | | #endif |
327 | 0 | } Unexecuted instantiation: qimagescale.cpp:toArgb32(QRgba64) Unexecuted instantiation: qpaintengine_raster.cpp:toArgb32(QRgba64) Unexecuted instantiation: qpixellayout.cpp:toArgb32(QRgba64) Unexecuted instantiation: qdrawhelper_ssse3.cpp:toArgb32(QRgba64) Unexecuted instantiation: qdrawhelper_sse4.cpp:toArgb32(QRgba64) Unexecuted instantiation: qdrawhelper.cpp:toArgb32(QRgba64) Unexecuted instantiation: qcompositionfunctions.cpp:toArgb32(QRgba64) Unexecuted instantiation: qcosmeticstroker.cpp:toArgb32(QRgba64) Unexecuted instantiation: qdrawhelper_sse2.cpp:toArgb32(QRgba64) Unexecuted instantiation: qdrawhelper_avx2.cpp:toArgb32(QRgba64) |
328 | | |
329 | | static inline uint toRgba8888(QRgba64 rgba64) |
330 | 0 | { |
331 | 0 | #if defined __SSE2__ |
332 | 0 | __m128i v = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&rgba64)); |
333 | 0 | return toArgb32(v); |
334 | | #elif defined __ARM_NEON__ |
335 | | uint16x4_t v = vreinterpret_u16_u64(vld1_u64(reinterpret_cast<const uint64_t *>(&rgba64))); |
336 | | return toArgb32(v); |
337 | | #elif defined __loongarch_sx |
338 | | __m128i v = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&rgba64), 0); |
339 | | return toArgb32(v); |
340 | | #else |
341 | | return ARGB2RGBA(toArgb32(rgba64)); |
342 | | #endif |
343 | 0 | } Unexecuted instantiation: qimagescale.cpp:toRgba8888(QRgba64) Unexecuted instantiation: qpaintengine_raster.cpp:toRgba8888(QRgba64) Unexecuted instantiation: qpixellayout.cpp:toRgba8888(QRgba64) Unexecuted instantiation: qdrawhelper_ssse3.cpp:toRgba8888(QRgba64) Unexecuted instantiation: qdrawhelper_sse4.cpp:toRgba8888(QRgba64) Unexecuted instantiation: qdrawhelper.cpp:toRgba8888(QRgba64) Unexecuted instantiation: qcompositionfunctions.cpp:toRgba8888(QRgba64) Unexecuted instantiation: qcosmeticstroker.cpp:toRgba8888(QRgba64) Unexecuted instantiation: qdrawhelper_sse2.cpp:toRgba8888(QRgba64) Unexecuted instantiation: qdrawhelper_avx2.cpp:toRgba8888(QRgba64) |
344 | | |
345 | | static inline QRgba64 rgbBlend(QRgba64 d, QRgba64 s, uint rgbAlpha) |
346 | 0 | { |
347 | 0 | QRgba64 blend; |
348 | 0 | #if defined(__SSE2__) |
349 | 0 | __m128i vd = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&d)); |
350 | 0 | __m128i vs = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&s)); |
351 | 0 | __m128i va = _mm_cvtsi32_si128(rgbAlpha); |
352 | 0 | va = _mm_unpacklo_epi8(va, va); |
353 | 0 | va = _mm_shufflelo_epi16(va, _MM_SHUFFLE(3, 0, 1, 2)); |
354 | 0 | __m128i vb = _mm_xor_si128(_mm_set1_epi16(-1), va); |
355 | |
|
356 | 0 | vs = _mm_unpacklo_epi16(_mm_mullo_epi16(vs, va), _mm_mulhi_epu16(vs, va)); |
357 | 0 | vd = _mm_unpacklo_epi16(_mm_mullo_epi16(vd, vb), _mm_mulhi_epu16(vd, vb)); |
358 | 0 | vd = _mm_add_epi32(vd, vs); |
359 | 0 | vd = _mm_add_epi32(vd, _mm_srli_epi32(vd, 16)); |
360 | 0 | vd = _mm_add_epi32(vd, _mm_set1_epi32(0x8000)); |
361 | 0 | vd = _mm_srai_epi32(vd, 16); |
362 | 0 | vd = _mm_packs_epi32(vd, vd); |
363 | |
|
364 | 0 | _mm_storel_epi64(reinterpret_cast<__m128i *>(&blend), vd); |
365 | | #elif defined(__ARM_NEON__) |
366 | | uint16x4_t vd = vreinterpret_u16_u64(vmov_n_u64(d)); |
367 | | uint16x4_t vs = vreinterpret_u16_u64(vmov_n_u64(s)); |
368 | | uint8x8_t va8 = vreinterpret_u8_u32(vmov_n_u32(ARGB2RGBA(rgbAlpha))); |
369 | | uint16x4_t va = vreinterpret_u16_u8(vzip_u8(va8, va8).val[0]); |
370 | | uint16x4_t vb = veor_u16(vdup_n_u16(0xffff), va); |
371 | | |
372 | | uint32x4_t vs32 = vmull_u16(vs, va); |
373 | | uint32x4_t vd32 = vmull_u16(vd, vb); |
374 | | vd32 = vaddq_u32(vd32, vs32); |
375 | | vd32 = vsraq_n_u32(vd32, vd32, 16); |
376 | | vd = vrshrn_n_u32(vd32, 16); |
377 | | vst1_u64(reinterpret_cast<uint64_t *>(&blend), vreinterpret_u64_u16(vd)); |
378 | | #elif defined(__loongarch_sx) |
379 | | __m128i vd = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&d), 0); |
380 | | __m128i vs = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&s), 0); |
381 | | __m128i va = __lsx_vinsgr2vr_w(__lsx_vldi(0), rgbAlpha, 0); |
382 | | va = __lsx_vilvl_b(va, va); |
383 | | const __m128i shuffleMask = (__m128i)(v8i16){2, 1, 0, 3, 4, 5, 6, 7}; |
384 | | va = __lsx_vshuf_h(shuffleMask, __lsx_vldi(0), va); |
385 | | __m128i vb = __lsx_vxor_v(__lsx_vreplgr2vr_h(-1), va); |
386 | | |
387 | | vs = __lsx_vilvl_h(__lsx_vmuh_hu(vs, va), __lsx_vmul_h(vs, va)); |
388 | | vd = __lsx_vilvl_h(__lsx_vmuh_hu(vd, vb), __lsx_vmul_h(vd, vb)); |
389 | | vd = __lsx_vadd_w(vd, vs); |
390 | | vd = __lsx_vadd_w(vd, __lsx_vsrli_w(vd, 16)); |
391 | | vd = __lsx_vadd_w(vd, __lsx_vreplgr2vr_w(0x8000)); |
392 | | vd = __lsx_vsrai_w(vd, 16); |
393 | | vd = __lsx_vpickev_h(__lsx_vsat_w(vd, 15), __lsx_vsat_w(vd, 15)); |
394 | | __lsx_vstelm_d(vd, reinterpret_cast<__m128i *>(&blend), 0, 0); |
395 | | #else |
396 | | const int mr = qRed(rgbAlpha); |
397 | | const int mg = qGreen(rgbAlpha); |
398 | | const int mb = qBlue(rgbAlpha); |
399 | | blend = qRgba64(qt_div_255(s.red() * mr + d.red() * (255 - mr)), |
400 | | qt_div_255(s.green() * mg + d.green() * (255 - mg)), |
401 | | qt_div_255(s.blue() * mb + d.blue() * (255 - mb)), |
402 | | s.alpha()); |
403 | | #endif |
404 | 0 | return blend; |
405 | 0 | } Unexecuted instantiation: qimagescale.cpp:rgbBlend(QRgba64, QRgba64, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:rgbBlend(QRgba64, QRgba64, unsigned int) Unexecuted instantiation: qpixellayout.cpp:rgbBlend(QRgba64, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:rgbBlend(QRgba64, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:rgbBlend(QRgba64, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper.cpp:rgbBlend(QRgba64, QRgba64, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:rgbBlend(QRgba64, QRgba64, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:rgbBlend(QRgba64, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:rgbBlend(QRgba64, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:rgbBlend(QRgba64, QRgba64, unsigned int) |
406 | | |
407 | | static inline void blend_pixel(QRgba64 &dst, QRgba64 src) |
408 | 0 | { |
409 | 0 | if (src.isOpaque()) |
410 | 0 | dst = src; |
411 | 0 | else if (!src.isTransparent()) { |
412 | 0 | #if defined(__SSE2__) |
413 | 0 | const __m128i vd = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&dst)); |
414 | 0 | const __m128i vs = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&src)); |
415 | 0 | const __m128i via = _mm_xor_si128(_mm_set1_epi16(-1), _mm_shufflelo_epi16(vs, _MM_SHUFFLE(3, 3, 3, 3))); |
416 | 0 | const __m128i vr = _mm_add_epi16(vs, multiplyAlpha65535(vd, via)); |
417 | 0 | _mm_storel_epi64(reinterpret_cast<__m128i *>(&dst), vr); |
418 | | #elif defined(__ARM_NEON__) |
419 | | const uint16x4_t vd = vreinterpret_u16_u64(vld1_u64(reinterpret_cast<const uint64_t *>(&dst))); |
420 | | const uint16x4_t vs = vreinterpret_u16_u64(vld1_u64(reinterpret_cast<const uint64_t *>(&src))); |
421 | | const uint16x4_t via = veor_u16(vdup_n_u16(0xffff), vdup_lane_u16(vs, 3)); |
422 | | const uint16x4_t vr = vadd_u16(vs, multiplyAlpha65535(vd, via)); |
423 | | vst1_u64(reinterpret_cast<uint64_t *>(&dst), vreinterpret_u64_u16(vr)); |
424 | | #elif defined(__loongarch_sx) |
425 | | const __m128i vd = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&dst), 0); |
426 | | const __m128i vs = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&src), 0); |
427 | | const __m128i shuffleMask = (__m128i)(v8i16){3, 3, 3, 3, 4, 5, 6, 7}; |
428 | | const __m128i via = __lsx_vxor_v(__lsx_vreplgr2vr_h(-1), __lsx_vshuf_h(shuffleMask, __lsx_vldi(0), vs)); |
429 | | const __m128i vr = __lsx_vadd_h(vs, multiplyAlpha65535(vd, via)); |
430 | | __lsx_vstelm_d(vr, reinterpret_cast<__m128i *>(&dst), 0, 0); |
431 | | #else |
432 | | dst = src + multiplyAlpha65535(dst, 65535 - src.alpha()); |
433 | | #endif |
434 | 0 | } |
435 | 0 | } Unexecuted instantiation: qimagescale.cpp:blend_pixel(QRgba64&, QRgba64) Unexecuted instantiation: qpaintengine_raster.cpp:blend_pixel(QRgba64&, QRgba64) Unexecuted instantiation: qpixellayout.cpp:blend_pixel(QRgba64&, QRgba64) Unexecuted instantiation: qdrawhelper_ssse3.cpp:blend_pixel(QRgba64&, QRgba64) Unexecuted instantiation: qdrawhelper_sse4.cpp:blend_pixel(QRgba64&, QRgba64) Unexecuted instantiation: qdrawhelper.cpp:blend_pixel(QRgba64&, QRgba64) Unexecuted instantiation: qcompositionfunctions.cpp:blend_pixel(QRgba64&, QRgba64) Unexecuted instantiation: qcosmeticstroker.cpp:blend_pixel(QRgba64&, QRgba64) Unexecuted instantiation: qdrawhelper_sse2.cpp:blend_pixel(QRgba64&, QRgba64) Unexecuted instantiation: qdrawhelper_avx2.cpp:blend_pixel(QRgba64&, QRgba64) |
436 | | |
437 | | static inline void blend_pixel(QRgba64 &dst, QRgba64 src, const int const_alpha) |
438 | 0 | { |
439 | 0 | if (const_alpha == 255) |
440 | 0 | return blend_pixel(dst, src); |
441 | 0 | if (!src.isTransparent()) { |
442 | 0 | #if defined(__SSE2__) |
443 | 0 | const __m128i vd = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&dst)); |
444 | 0 | __m128i vs = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(&src)); |
445 | 0 | vs = multiplyAlpha255(vs, const_alpha); |
446 | 0 | const __m128i via = _mm_xor_si128(_mm_set1_epi16(-1), _mm_shufflelo_epi16(vs, _MM_SHUFFLE(3, 3, 3, 3))); |
447 | 0 | const __m128i vr = _mm_add_epi16(vs, multiplyAlpha65535(vd, via)); |
448 | 0 | _mm_storel_epi64(reinterpret_cast<__m128i *>(&dst), vr); |
449 | | #elif defined(__ARM_NEON__) |
450 | | const uint16x4_t vd = vreinterpret_u16_u64(vld1_u64(reinterpret_cast<const uint64_t *>(&dst))); |
451 | | uint16x4_t vs = vreinterpret_u16_u64(vld1_u64(reinterpret_cast<const uint64_t *>(&src))); |
452 | | vs = multiplyAlpha255(vs, const_alpha); |
453 | | const uint16x4_t via = veor_u16(vdup_n_u16(0xffff), vdup_lane_u16(vs, 3)); |
454 | | const uint16x4_t vr = vadd_u16(vs, multiplyAlpha65535(vd, via)); |
455 | | vst1_u64(reinterpret_cast<uint64_t *>(&dst), vreinterpret_u64_u16(vr)); |
456 | | #elif defined(__loongarch_sx) |
457 | | const __m128i vd = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&dst), 0); |
458 | | __m128i vs = __lsx_vldrepl_d(reinterpret_cast<const __m128i *>(&src), 0); |
459 | | vs = multiplyAlpha255(vs, const_alpha); |
460 | | const __m128i shuffleMask = (__m128i)(v8i16){3, 3, 3, 3, 4, 5, 6, 7}; |
461 | | const __m128i via = __lsx_vxor_v(__lsx_vreplgr2vr_h(-1), __lsx_vshuf_h(shuffleMask, __lsx_vldi(0), vs)); |
462 | | const __m128i vr = __lsx_vadd_h(vs, multiplyAlpha65535(vd, via)); |
463 | | __lsx_vstelm_d(vr, reinterpret_cast<__m128i *>(&dst), 0, 0); |
464 | | #else |
465 | | src = multiplyAlpha255(src, const_alpha); |
466 | | dst = src + multiplyAlpha65535(dst, 65535 - src.alpha()); |
467 | | #endif |
468 | 0 | } |
469 | 0 | } Unexecuted instantiation: qimagescale.cpp:blend_pixel(QRgba64&, QRgba64, int) Unexecuted instantiation: qpaintengine_raster.cpp:blend_pixel(QRgba64&, QRgba64, int) Unexecuted instantiation: qpixellayout.cpp:blend_pixel(QRgba64&, QRgba64, int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:blend_pixel(QRgba64&, QRgba64, int) Unexecuted instantiation: qdrawhelper_sse4.cpp:blend_pixel(QRgba64&, QRgba64, int) Unexecuted instantiation: qdrawhelper.cpp:blend_pixel(QRgba64&, QRgba64, int) Unexecuted instantiation: qcompositionfunctions.cpp:blend_pixel(QRgba64&, QRgba64, int) Unexecuted instantiation: qcosmeticstroker.cpp:blend_pixel(QRgba64&, QRgba64, int) Unexecuted instantiation: qdrawhelper_sse2.cpp:blend_pixel(QRgba64&, QRgba64, int) Unexecuted instantiation: qdrawhelper_avx2.cpp:blend_pixel(QRgba64&, QRgba64, int) |
470 | | |
471 | | QT_END_NAMESPACE |
472 | | |
473 | | #endif // QRGBA64_P_H |