diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-01-20 18:16:08 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-01-20 18:18:59 +0100 |
commit | 9033977d3971db5352a2bb51052a723a2ac57a8f (patch) | |
tree | d1a70bdf5e892cc391f7bbfd61ff5611fe25ce3d /src/corelib/tools/qstring.cpp | |
parent | e5e43a2386fb4a4c2cb90d5a8d9bb5ca81a2675e (diff) | |
parent | 03b6a2f0f98b70b24c0cce645d6d58c084111f91 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/corelib/global/qglobal.h
src/corelib/tools/qstring.cpp
src/gui/image/image.pri
src/gui/image/qimage.cpp
src/plugins/platforms/cocoa/qcocoawindow.h
src/plugins/platforms/cocoa/qcocoawindow.mm
src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 9544062dd9..555f8a8c97 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -189,9 +189,23 @@ static int ucstricmp(const ushort *a, const ushort *ae, const uchar *b, const uc return 1; } +#if defined(__mips_dsp) +// From qstring_mips_dsp_asm.S +extern "C" int qt_ucstrncmp_mips_dsp_asm(const ushort *a, + const ushort *b, + unsigned len); +#endif + // Unicode case-sensitive compare two same-sized strings static int ucstrncmp(const QChar *a, const QChar *b, int l) { +#if defined(__mips_dsp) + if (l >= 8) { + return qt_ucstrncmp_mips_dsp_asm(reinterpret_cast<const ushort*>(a), + reinterpret_cast<const ushort*>(b), + l); + } +#endif // __mips_dsp while (l-- && *a == *b) a++,b++; if (l==-1) @@ -3947,6 +3961,10 @@ static inline __m128i mergeQuestionMarks(__m128i chunk) } #endif +#if defined(__mips_dsp) +extern "C" void qt_toLatin1_mips_dsp_asm(uchar *dst, const ushort *src, int length); +#endif + static void toLatin1_helper(uchar *dst, const ushort *src, int length) { if (length) { @@ -3995,10 +4013,14 @@ static void toLatin1_helper(uchar *dst, const ushort *src, int length) length = length % 8; } #endif +#if defined(__mips_dsp) + qt_toLatin1_mips_dsp_asm(dst, src, length); +#else while (length--) { *dst++ = (*src>0xff) ? '?' : (uchar) *src; ++src; } +#endif } } @@ -4151,6 +4173,12 @@ QVector<uint> QString::toUcs4() const return v; } +#if defined(__mips_dsp) +// From qstring_mips_dsp_asm.S +extern "C" void qt_fromlatin1_mips_asm_unroll4 (ushort*, const char*, uint); +extern "C" void qt_fromlatin1_mips_asm_unroll8 (ushort*, const char*, uint); +#endif + QString::Data *QString::fromLatin1_helper(const char *str, int size) { Data *d; @@ -4191,8 +4219,15 @@ QString::Data *QString::fromLatin1_helper(const char *str, int size) size = size % 16; } #endif +#if defined(__mips_dsp) + if (size > 20) + qt_fromlatin1_mips_asm_unroll8(dst, str, size); + else + qt_fromlatin1_mips_asm_unroll4(dst, str, size); +#else while (size--) *dst++ = (uchar)*str++; +#endif } return d; } |