summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2011-03-18 16:17:34 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2011-03-22 14:51:48 (GMT)
commitda88d5889a6b60b64403342b5bfbae54462d3111 (patch)
tree34c58624fb832a81835e99e2dd577ea7976014ad
parentfc87ff3d793a4b87d9d08f84a7cc3c632cf78a09 (diff)
downloadQt-da88d5889a6b60b64403342b5bfbae54462d3111.zip
Qt-da88d5889a6b60b64403342b5bfbae54462d3111.tar.gz
Qt-da88d5889a6b60b64403342b5bfbae54462d3111.tar.bz2
Add an unrolled prolog
-rw-r--r--tests/benchmarks/corelib/tools/qstring/main.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp
index dfe3015..35e1939 100644
--- a/tests/benchmarks/corelib/tools/qstring/main.cpp
+++ b/tests/benchmarks/corelib/tools/qstring/main.cpp
@@ -1477,6 +1477,26 @@ void fromLatin1_sse2_qt47(ushort *dst, const char *str, int size)
*dst++ = (uchar)*str++;
}
+void fromLatin1_prolog_unrolled(ushort *dst, const char *str, int size)
+{
+ switch (size) {
+ case 7:
+ *dst++ = (uchar)*str++;
+ case 6:
+ *dst++ = (uchar)*str++;
+ case 5:
+ *dst++ = (uchar)*str++;
+ case 4:
+ *dst++ = (uchar)*str++;
+ case 3:
+ *dst++ = (uchar)*str++;
+ case 2:
+ *dst++ = (uchar)*str++;
+ case 1:
+ *dst++ = (uchar)*str++;
+ }
+}
+
template<FromLatin1Function prologFunction>
void fromLatin1_sse2_withprolog(ushort *dst, const char *str, int size)
{
@@ -1523,7 +1543,8 @@ void tst_QString::fromLatin1Alternatives_data() const
QTest::addColumn<FromLatin1Function>("function");
QTest::newRow("regular") << &fromLatin1_regular;
QTest::newRow("sse2-qt4.7") << &fromLatin1_sse2_qt47;
- QTest::newRow("sse2-with-prolog") << &fromLatin1_sse2_withprolog<&fromLatin1_regular>;
+ QTest::newRow("sse2-with-prolog-regular") << &fromLatin1_sse2_withprolog<&fromLatin1_regular>;
+ QTest::newRow("sse2-with-prolog-unrolled") << &fromLatin1_sse2_withprolog<&fromLatin1_prolog_unrolled>;
}
static void fromLatin1Alternatives_internal(FromLatin1Function function, bool doVerify)