summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-08-24 10:14:41 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-08-24 10:36:45 (GMT)
commit469210fdf9287dc8a4933e0761bbff91a031045f (patch)
tree9653045d415e1c0004b7f961c53aca52549118bb /tests/benchmarks
parent3cfd8330d5252d6ca9439882cb4a0f2246cccfc0 (diff)
downloadQt-469210fdf9287dc8a4933e0761bbff91a031045f.zip
Qt-469210fdf9287dc8a4933e0761bbff91a031045f.tar.gz
Qt-469210fdf9287dc8a4933e0761bbff91a031045f.tar.bz2
Don't try to compile the SSE2 and SSSE3 code with compilers that don't support them (e.g. ARM)
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/corelib/tools/qstring/main.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp
index d2861b6..3b86792 100644
--- a/tests/benchmarks/corelib/tools/qstring/main.cpp
+++ b/tests/benchmarks/corelib/tools/qstring/main.cpp
@@ -163,7 +163,7 @@ static bool equals2_bytewise(const ushort *p1, const ushort *p2, int len)
return true;
}
-static bool __attribute__((optimize("unroll-loops"))) equals2_shortwise(const ushort *p1, const ushort *p2, int len)
+static bool equals2_shortwise(const ushort *p1, const ushort *p2, int len)
{
if (p1 == p2 || !len)
return true;
@@ -259,7 +259,7 @@ static inline bool equals2_short_tail(const ushort *p1, const ushort *p2, int le
return true;
}
-#pragma GCC optimize("unroll-loops off")
+//#pragma GCC optimize("no-unroll-loops")
#ifdef __SSE2__
static bool equals2_sse2_aligned(const ushort *p1, const ushort *p2, int len)
{
@@ -1155,7 +1155,7 @@ int ucstrncmp_ssse3_aligning2_aligned(const ushort *a, const ushort *b, int len,
return ucstrncmp_sse2_aligned(a + 8, b + 8, len);
}
-template<int N> static inline __attribute__((optimize("no-unroll-loops")))
+template<int N> static inline __attribute__((optimize("no-unroll-loops"),always_inline))
int ucstrncmp_ssse3_aligning2_alignr(const ushort *a, const ushort *b, int len, int garbage)
{
// len >= 8
@@ -1268,11 +1268,15 @@ void tst_QString::ucstrncmp_data() const
QTest::newRow("selftest") << UcstrncmpFunction(0);
QTest::newRow("shortwise") << &ucstrncmp_shortwise;
QTest::newRow("intwise") << &ucstrncmp_intwise;
+#ifdef __SSE2__
QTest::newRow("sse2") << &ucstrncmp_sse2;
QTest::newRow("sse2_aligning") << &ucstrncmp_sse2_aligning;
+#ifdef __SSSE3__
QTest::newRow("ssse3") << &ucstrncmp_ssse3;
QTest::newRow("ssse3_aligning") << &ucstrncmp_ssse3_aligning;
QTest::newRow("ssse3_aligning2") << &ucstrncmp_ssse3_aligning2;
+#endif
+#endif
}
void tst_QString::ucstrncmp() const
@@ -1282,11 +1286,15 @@ void tst_QString::ucstrncmp() const
static const UcstrncmpFunction func[] = {
&ucstrncmp_shortwise,
&ucstrncmp_intwise,
+#ifdef __SSE2__
&ucstrncmp_sse2,
&ucstrncmp_sse2_aligning,
+#ifdef __SSSE3__
&ucstrncmp_ssse3,
&ucstrncmp_ssse3_aligning,
&ucstrncmp_ssse3_aligning2
+#endif
+#endif
};
static const int functionCount = sizeof func / sizeof func[0];