summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-03-28 02:55:25 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-03-28 02:55:25 (GMT)
commitaee4087d62900624822ea820b1eb8e2d960d0869 (patch)
tree45575eca8d255e519562ab0279d9582736dee7a2
parent09ecb50448bc3255c80764dbc267bb6a77195287 (diff)
parentbfc04b22d3f80f43787e86ee4cc6a39436fa039c (diff)
downloadQt-aee4087d62900624822ea820b1eb8e2d960d0869.zip
Qt-aee4087d62900624822ea820b1eb8e2d960d0869.tar.gz
Qt-aee4087d62900624822ea820b1eb8e2d960d0869.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: tst_qlocale: improve failure message in tst_QLocale::macDefaultLocale Add a once-over unrolled fromLatin1 conversion (32 characters) Add 16-byte loads of the Neon fromLatin1 functions Fix warning about unused parameter
-rw-r--r--src/declarative/qml/qdeclarativetypenamescriptclass.cpp2
-rw-r--r--tests/auto/qlocale/tst_qlocale.cpp6
-rw-r--r--tests/benchmarks/corelib/tools/qstring/main.cpp114
3 files changed, 120 insertions, 2 deletions
diff --git a/src/declarative/qml/qdeclarativetypenamescriptclass.cpp b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
index 0314a7a..a7c0b2c 100644
--- a/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
+++ b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
@@ -152,7 +152,7 @@ QDeclarativeTypeNameScriptClass::property(Object *obj, const Identifier &name)
}
}
-void QDeclarativeTypeNameScriptClass::setProperty(Object *o, const Identifier &n, const QScriptValue &v)
+void QDeclarativeTypeNameScriptClass::setProperty(Object *, const Identifier &n, const QScriptValue &v)
{
Q_ASSERT(object);
Q_ASSERT(!type);
diff --git a/tests/auto/qlocale/tst_qlocale.cpp b/tests/auto/qlocale/tst_qlocale.cpp
index 16846de..3b62d64 100644
--- a/tests/auto/qlocale/tst_qlocale.cpp
+++ b/tests/auto/qlocale/tst_qlocale.cpp
@@ -1107,7 +1107,11 @@ void tst_QLocale::macDefaultLocale()
expectedGMTSpecifier.append(QString("0%1").arg(qAbs(diff)));
else
expectedGMTSpecifier.append(QString("%1").arg(qAbs(diff)));
- QVERIFY(timeString.contains(expectedGMTSpecifier));
+ QVERIFY2(timeString.contains(expectedGMTSpecifier), qPrintable(
+ QString("timeString `%1', expectedGMTSpecifier `%2'")
+ .arg(timeString)
+ .arg(expectedGMTSpecifier)
+ ));
}
QCOMPARE(locale.dayName(1), QString("Monday"));
QCOMPARE(locale.dayName(7), QString("Sunday"));
diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp
index df41efd..96f2c30 100644
--- a/tests/benchmarks/corelib/tools/qstring/main.cpp
+++ b/tests/benchmarks/corelib/tools/qstring/main.cpp
@@ -1538,6 +1538,51 @@ void fromLatin1_sse2_improved(ushort *dst, const char *str, int size)
fromLatin1_epilog(dst + counter, str + counter, size - counter);
}
+void fromLatin1_sse2_improved2(ushort *dst, const char *str, int size)
+{
+ const __m128i nullMask = _mm_set1_epi32(0);
+ qptrdiff counter = 0;
+ size -= 32;
+ while (size >= counter) {
+ const __m128i chunk1 = _mm_loadu_si128((__m128i*)(str + counter)); // load
+ const __m128i chunk2 = _mm_loadu_si128((__m128i*)(str + counter + 16)); // load
+
+ // unpack the first 8 bytes, padding with zeros
+ const __m128i firstHalf1 = _mm_unpacklo_epi8(chunk1, nullMask);
+ _mm_storeu_si128((__m128i*)(dst + counter), firstHalf1); // store
+
+ // unpack the last 8 bytes, padding with zeros
+ const __m128i secondHalf1 = _mm_unpackhi_epi8(chunk1, nullMask);
+ _mm_storeu_si128((__m128i*)(dst + counter + 8), secondHalf1); // store
+
+ // unpack the first 8 bytes, padding with zeros
+ const __m128i firstHalf2 = _mm_unpacklo_epi8(chunk2, nullMask);
+ _mm_storeu_si128((__m128i*)(dst + counter + 16), firstHalf2); // store
+
+ // unpack the last 8 bytes, padding with zeros
+ const __m128i secondHalf2 = _mm_unpackhi_epi8(chunk2, nullMask);
+ _mm_storeu_si128((__m128i*)(dst + counter + 24), secondHalf2); // store
+
+ counter += 32;
+ }
+ size += 16;
+ if (size >= counter) {
+ const __m128i chunk = _mm_loadu_si128((__m128i*)(str + counter)); // load
+
+ // unpack the first 8 bytes, padding with zeros
+ const __m128i firstHalf = _mm_unpacklo_epi8(chunk, nullMask);
+ _mm_storeu_si128((__m128i*)(dst + counter), firstHalf); // store
+
+ // unpack the last 8 bytes, padding with zeros
+ const __m128i secondHalf = _mm_unpackhi_epi8 (chunk, nullMask);
+ _mm_storeu_si128((__m128i*)(dst + counter + 8), secondHalf); // store
+
+ counter += 16;
+ }
+ size += 16;
+ fromLatin1_epilog(dst + counter, str + counter, size - counter);
+}
+
void fromLatin1_prolog_unrolled(ushort *dst, const char *str, int size)
{
// QString's data pointer is most often ending in 0x2 or 0xa
@@ -1694,6 +1739,39 @@ void fromLatin1_neon_improved(ushort *dst, const char *str, int len)
fromLatin1_epilog(dst, str, len);
}
+void fromLatin1_neon_improved2(ushort *dst, const char *str, int len)
+{
+ while (len >= 16) {
+ // load 16 bytes into one quadword Neon register
+ const uint8x16_t chunk = vld1q_u8((uint8_t *)str);
+ str += 16;
+
+ // expand each doubleword of the quadword register into a quadword
+ const uint16x8_t expanded_low = vmovl_u8(vget_low_u8(chunk));
+ vst1q_u16(dst, expanded_low); // store
+ dst += 8;
+ const uint16x8_t expanded_high = vmovl_u8(vget_high_u8(chunk));
+ vst1q_u16(dst, expanded_high); // store
+ dst += 8;
+
+ len -= 16;
+ }
+
+ if (len >= 8) {
+ // load 8 bytes into one doubleword Neon register
+ const uint8x8_t chunk = vld1_u8((uint8_t *)str);
+ str += 8;
+
+ // expand 8 bytes into 16 bytes in a quadword register
+ const uint16x8_t expanded = vmovl_u8(chunk);
+ vst1q_u16(dst, expanded); // store
+ dst += 8;
+
+ len -= 8;
+ }
+ fromLatin1_epilog(dst, str, len);
+}
+
void fromLatin1_neon_handwritten(ushort *dst, const char *str, int len)
{
// same as above, but handwritten Neon
@@ -1711,6 +1789,39 @@ void fromLatin1_neon_handwritten(ushort *dst, const char *str, int len)
fromLatin1_epilog(dst, str, len);
}
+
+void fromLatin1_neon_handwritten2(ushort *dst, const char *str, int len)
+{
+ // same as above, but handwritten Neon
+ while (len >= 16) {
+ uint16x8_t chunk1, chunk2;
+ asm (
+ "vld1.8 %h[chunk1], [%[str]]!\n"
+ "vmovl.u8 %q[chunk2], %f[chunk1]\n"
+ "vmovl.u8 %q[chunk1], %e[chunk1]\n"
+ "vst1.16 %h[chunk1], [%[dst]]!\n"
+ "vst1.16 %h[chunk2], [%[dst]]!\n"
+ : [dst] "+r" (dst),
+ [str] "+r" (str),
+ [chunk1] "=w" (chunk1),
+ [chunk2] "=w" (chunk2));
+ len -= 16;
+ }
+
+ if (len >= 8) {
+ uint16x8_t chunk;
+ asm (
+ "vld1.8 %[chunk], [%[str]]!\n"
+ "vmovl.u8 %q[chunk], %[chunk]\n"
+ "vst1.16 %h[chunk], [%[dst]]!\n"
+ : [dst] "+r" (dst),
+ [str] "+r" (str),
+ [chunk] "=w" (chunk));
+ len -= 8;
+ }
+
+ fromLatin1_epilog(dst, str, len);
+}
#endif
void tst_QString::fromLatin1Alternatives_data() const
@@ -1721,6 +1832,7 @@ void tst_QString::fromLatin1Alternatives_data() const
#ifdef __SSE2__
QTest::newRow("sse2-qt4.7") << &fromLatin1_sse2_qt47;
QTest::newRow("sse2-improved") << &fromLatin1_sse2_improved;
+ QTest::newRow("sse2-improved2") << &fromLatin1_sse2_improved2;
QTest::newRow("sse2-with-prolog-regular") << &fromLatin1_sse2_withprolog<&fromLatin1_regular>;
QTest::newRow("sse2-with-prolog-unrolled") << &fromLatin1_sse2_withprolog<&fromLatin1_prolog_unrolled>;
QTest::newRow("sse2-with-prolog-sse2-overcommit") << &fromLatin1_sse2_withprolog<&fromLatin1_prolog_sse2_overcommit>;
@@ -1731,7 +1843,9 @@ void tst_QString::fromLatin1Alternatives_data() const
#endif
#ifdef __ARM_NEON__
QTest::newRow("neon-improved") << &fromLatin1_neon_improved;
+ QTest::newRow("neon-improved2") << &fromLatin1_neon_improved2;
QTest::newRow("neon-handwritten") << &fromLatin1_neon_handwritten;
+ QTest::newRow("neon-handwritten2") << &fromLatin1_neon_handwritten2;
#endif
}