diff options
author | Nick Shaforostoff <shaforostoff@gmail.com> | 2021-02-28 20:02:18 +0100 |
---|---|---|
committer | Nick Shaforostoff <shaforostoff@gmail.com> | 2021-03-08 00:31:23 +0100 |
commit | 4f37cf2ce544dad5b207161536566627b6b0b1ef (patch) | |
tree | 7d2305d3a77ae604b5107373f23c849c2f636840 /src/corelib/text/qstring.cpp | |
parent | d58d0bb9708f4a50f77a665e00be6a24b1efc46b (diff) |
string 16<->8 bits conversion: SIMD on arm32
this adds emulation for 2 NEON commands that armv7 lacks
this increases conversion speed by around 50% in my simple tests
Change-Id: I4f52d353184e9a8d88089de60e17bd5670637c0c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r-- | src/corelib/text/qstring.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 24e725ee9a..49e56d26d6 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -333,7 +333,7 @@ const char16_t *QtPrivate::qustrchr(QStringView str, char16_t c) noexcept [=](int i) { return n[i] == c; }, [=](int i) { return n + i; }); # endif -#elif defined(__ARM_NEON__) && defined(Q_PROCESSOR_ARM_64) // vaddv is only available on Aarch64 +#elif defined(__ARM_NEON__) const uint16x8_t vmask = { 1, 1 << 1, 1 << 2, 1 << 3, 1 << 4, 1 << 5, 1 << 6, 1 << 7 }; const uint16x8_t ch_vec = vdupq_n_u16(c); for (const char16_t *next = n + 8; next <= e; n = next, next += 8) { @@ -1004,7 +1004,7 @@ static int ucstrncmp(const QChar *a, const QChar *b, size_t l) }; return UnrollTailLoop<3>::exec(l, 0, lambda, lambda); #endif -#if defined(__ARM_NEON__) && defined(Q_PROCESSOR_ARM_64) // vaddv is only available on Aarch64 +#ifdef __ARM_NEON__ if (l >= 8) { const QChar *end = a + l; const uint16x8_t mask = { 1, 1 << 1, 1 << 2, 1 << 3, 1 << 4, 1 << 5, 1 << 6, 1 << 7 }; |