summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2010-07-19 13:59:02 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2010-07-19 14:06:12 (GMT)
commitf19a95429a5e9b760f49152ebdf9b39474750116 (patch)
tree48a7d29b2cac898f14bda207cca212c2839c78d0 /src
parentcbbdb874e0340492b80c8abcd130d1f41a8cf2b3 (diff)
downloadQt-f19a95429a5e9b760f49152ebdf9b39474750116.zip
Qt-f19a95429a5e9b760f49152ebdf9b39474750116.tar.gz
Qt-f19a95429a5e9b760f49152ebdf9b39474750116.tar.bz2
Extend the detection of CPU feature for x86
Add detection of CPU extension for SSE3, SSSE3, SSE4.1, SSE4.2 and AVX. Reviewed-by: Andreas Kling
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qsimd.cpp11
-rw-r--r--src/corelib/tools/qsimd_p.h7
2 files changed, 17 insertions, 1 deletions
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index 1ef513c..aa2ee47 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -218,6 +218,17 @@ uint qDetectCPUFeatures()
features |= SSE;
if (result & (1u << 26))
features |= SSE2;
+ if (extended_result & (1u))
+ features |= SSE3;
+ if (extended_result & (1u << 9))
+ features |= SSSE3;
+ if (extended_result & (1u << 19))
+ features |= SSE4_1;
+ if (extended_result & (1u << 20))
+ features |= SSE4_2;
+ if (extended_result & (1u << 28))
+ features |= AVX;
+
#endif // i386
#if defined(QT_HAVE_MMX)
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 0ed9d5d..18394853 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -119,7 +119,12 @@ enum CPUFeatures {
SSE2 = 0x20,
CMOV = 0x40,
IWMMXT = 0x80,
- NEON = 0x100
+ NEON = 0x100,
+ SSE3 = 0x200,
+ SSSE3 = 0x400,
+ SSE4_1 = 0x800,
+ SSE4_2 = 0x1000,
+ AVX = 0x2000
};
Q_CORE_EXPORT uint qDetectCPUFeatures();