summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qdrawhelper_p.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-03-23 10:19:11 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-04-11 07:53:53 +0000
commit4b6542c9ffa59eba6e82c0ecbb04dab361e3632f (patch)
treef8b7f4c8eb3448dd9050566a9a66e387445c67f5 /src/gui/painting/qdrawhelper_p.h
parenta5e2ec5cdb35dddf71c39633133c4eaf8ccc12f7 (diff)
Remove last uses of interpolate_4_pixels_16 on SSE2 and NEON
With SSE2 or NEON interpolate_4_pixels is faster than interpolate_4_pixels_16, and using it saves a branch of duplicated code. Similar changes had already been done other places it was used, those have been updated to follow a similar logic. Change-Id: I040d96480f7f925f659602f66f931d28b59312a5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/painting/qdrawhelper_p.h')
-rw-r--r--src/gui/painting/qdrawhelper_p.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index ebf215a3eb..b94fd34b51 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -685,6 +685,9 @@ static inline uint interpolate_4_pixels(const uint t[], const uint b[], uint dis
__m128i vb = _mm_loadl_epi64((const __m128i*)b);
return interpolate_4_pixels_sse2(vt, vb, distx, disty);
}
+
+static constexpr inline bool hasFastInterpolate4() { return true; }
+
#elif defined(__ARM_NEON__)
static Q_ALWAYS_INLINE uint interpolate_4_pixels_neon(uint32x2_t vt32, uint32x2_t vb32, uint distx, uint disty)
{
@@ -717,6 +720,9 @@ static inline uint interpolate_4_pixels(const uint t[], const uint b[], uint dis
uint32x2_t vb32 = vld1_u32(b);
return interpolate_4_pixels_neon(vt32, vb32, distx, disty);
}
+
+static constexpr inline bool hasFastInterpolate4() { return true; }
+
#else
static inline uint interpolate_4_pixels(uint tl, uint tr, uint bl, uint br, uint distx, uint disty)
{
@@ -731,6 +737,9 @@ static inline uint interpolate_4_pixels(const uint t[], const uint b[], uint dis
{
return interpolate_4_pixels(t[0], t[1], b[0], b[1], distx, disty);
}
+
+static constexpr inline bool hasFastInterpolate4() { return false; }
+
#endif
#if Q_BYTE_ORDER == Q_BIG_ENDIAN