summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-11-16 11:02:09 -0800
committerThiago Macieira <thiago.macieira@intel.com>2018-05-05 06:20:04 +0000
commit6e1190053d28877b2e90375056735429525e2ee7 (patch)
treea95b35478f8f008cabfab0ee112c3966852858a8 /src
parent2f9d49630d1b250bd8c9bb1202dc113fbb3cb20a (diff)
qsimd: remove support for systems without 64-bit atomics
We had that as a concession for early toolchains that failed to include the necessary libraries. They must now be up-to-date. Change-Id: I938b024e38bf4aac9154fffd14f7a630ef160cd5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qsimd.cpp7
-rw-r--r--src/corelib/tools/qsimd_p.h17
2 files changed, 7 insertions, 17 deletions
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index 25340f2d02..c4d7117449 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -644,11 +644,7 @@ static const int features_count = (sizeof features_indices) / (sizeof features_i
// record what CPU features were enabled by default in this Qt build
static const quint64 minFeature = qCompilerCpuFeatures;
-#ifdef Q_ATOMIC_INT64_IS_SUPPORTED
Q_CORE_EXPORT QBasicAtomicInteger<quint64> qt_cpu_features[1] = { Q_BASIC_ATOMIC_INITIALIZER(0) };
-#else
-Q_CORE_EXPORT QBasicAtomicInteger<unsigned> qt_cpu_features[2] = { Q_BASIC_ATOMIC_INITIALIZER(0), Q_BASIC_ATOMIC_INITIALIZER(0) };
-#endif
void qDetectCpuFeatures()
{
@@ -681,9 +677,6 @@ void qDetectCpuFeatures()
}
qt_cpu_features[0].store(f | quint32(QSimdInitialized));
-#ifndef Q_ATOMIC_INT64_IS_SUPPORTED
- qt_cpu_features[1].store(f >> 32);
-#endif
}
void qDumpCPUFeatures()
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 18684caefb..3161ee7412 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -435,29 +435,26 @@ static const quint64 qCompilerCpuFeatures = 0
#endif
;
-#ifdef Q_ATOMIC_INT64_IS_SUPPORTED
-extern Q_CORE_EXPORT QBasicAtomicInteger<quint64> qt_cpu_features[1];
+#ifdef QT_BOOTSTRAPPED
+static inline quint64 qCpuFeatures()
+{
+ return QSimdInitialized;
+}
#else
-extern Q_CORE_EXPORT QBasicAtomicInteger<unsigned> qt_cpu_features[2];
-#endif
+extern Q_CORE_EXPORT QBasicAtomicInteger<quint64> qt_cpu_features[1];
Q_CORE_EXPORT void qDetectCpuFeatures();
static inline quint64 qCpuFeatures()
{
quint64 features = qt_cpu_features[0].load();
-#ifndef Q_ATOMIC_INT64_IS_SUPPORTED
- features |= quint64(qt_cpu_features[1].load()) << 32;
-#endif
if (Q_UNLIKELY(features == 0)) {
qDetectCpuFeatures();
features = qt_cpu_features[0].load();
-#ifndef Q_ATOMIC_INT64_IS_SUPPORTED
- features |= quint64(qt_cpu_features[1].load()) << 32;
-#endif
Q_ASSUME(features != 0);
}
return features;
}
+#endif
#define qCpuHasFeature(feature) ((qCompilerCpuFeatures & (Q_UINT64_C(1) << CpuFeature ## feature)) \
|| (qCpuFeatures() & (Q_UINT64_C(1) << CpuFeature ## feature)))