summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2016-12-12 23:53:22 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2016-12-13 05:14:32 +0000
commitbb0f29f82b934b489f1679b7b72f094aa287be3c (patch)
treed5261b8283dfa5383509628373d9e125eb040f57 /src
parent4c0760d327e390a37d0d6ce2016d3a8c5b87a119 (diff)
Fix gcc 6.4 builds
The builtins clzs and ctzs have been removed. Additionally they were never proper internal GCC builtins and shouldn't have been used in a constexpr function in the first place. This patch removes the assumption that they exist when BMI is available, and let GCC fall back to using __builtin_clz and __builtin_ctz. Change-Id: I3e0b4e246098bb9ce6ede28b311948260ef881b9 Task-number: QTBUG-56813 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qalgorithms.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h
index 303374b06d..51f73c3368 100644
--- a/src/corelib/tools/qalgorithms.h
+++ b/src/corelib/tools/qalgorithms.h
@@ -535,7 +535,7 @@ QT_DEPRECATED_X("Use std::binary_search") Q_OUTOFLINE_TEMPLATE RandomAccessItera
# define QT_HAS_BUILTIN_CTZS
Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
{
-# if QT_HAS_BUILTIN(__builtin_ctzs) || defined(__BMI__)
+# if QT_HAS_BUILTIN(__builtin_ctzs)
return __builtin_ctzs(v);
# else
return __builtin_ctz(v);
@@ -544,7 +544,7 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
#define QT_HAS_BUILTIN_CLZS
Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW
{
-# if QT_HAS_BUILTIN(__builtin_clzs) || defined(__BMI__)
+# if QT_HAS_BUILTIN(__builtin_clzs)
return __builtin_clzs(v);
# else
return __builtin_clz(v) - 16U;