diff options
Diffstat (limited to 'src/corelib/codecs/qutfcodec.cpp')
-rw-r--r-- | src/corelib/codecs/qutfcodec.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index 26c68cdee5..85736fdf02 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -54,7 +54,7 @@ static const uchar utf8bom[] = { 0xef, 0xbb, 0xbf }; #if (defined(__SSE2__) && defined(QT_COMPILER_SUPPORTS_SSE2)) \ || (defined(__ARM_NEON__) && defined(Q_PROCESSOR_ARM_64)) -static Q_ALWAYS_INLINE uint qBitScanReverse(unsigned v) Q_DECL_NOTHROW +static Q_ALWAYS_INLINE uint qBitScanReverse(unsigned v) noexcept { uint result = qCountLeadingZeroBits(v); // Now Invert the result: clz will count *down* from the msb to the lsb, so the msb index is 31 @@ -70,9 +70,14 @@ static inline bool simdEncodeAscii(uchar *&dst, const ushort *&nextAscii, const { // do sixteen characters at a time for ( ; end - src >= 16; src += 16, dst += 16) { +# ifdef __AVX2__ + __m256i data = _mm256_loadu_si256(reinterpret_cast<const __m256i *>(src)); + __m128i data1 = _mm256_castsi256_si128(data); + __m128i data2 = _mm256_extracti128_si256(data, 1); +# else __m128i data1 = _mm_loadu_si128((const __m128i*)src); __m128i data2 = _mm_loadu_si128(1+(const __m128i*)src); - +# endif // check if everything is ASCII // the highest ASCII value is U+007F @@ -499,7 +504,7 @@ QString QUtf8::convertToUnicode(const char *chars, int len) This function never throws. */ -QChar *QUtf8::convertToUnicode(QChar *buffer, const char *chars, int len) Q_DECL_NOTHROW +QChar *QUtf8::convertToUnicode(QChar *buffer, const char *chars, int len) noexcept { ushort *dst = reinterpret_cast<ushort *>(buffer); const uchar *src = reinterpret_cast<const uchar *>(chars); @@ -967,7 +972,7 @@ QString QUtf32::convertToUnicode(const char *chars, int len, QTextCodec::Convert } -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) QUtf8Codec::~QUtf8Codec() { @@ -1121,6 +1126,6 @@ QList<QByteArray> QUtf32LECodec::aliases() const return list; } -#endif //QT_NO_TEXTCODEC +#endif // textcodec QT_END_NAMESPACE |