summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-12-04 17:14:07 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-05 23:57:47 +0100
commit13673ced441f90fa62b41e69b5d5d7341d2e24f9 (patch)
tree202228be0dc459bffb5faf0a91276f45970294f6 /src/corelib
parentaf47adede0de1e2420161d7b2f348343134a5009 (diff)
Replace the qCpuHasFeature function with a macro
We want to make sure that there's a constant propagation from the static variable that is filled in with the current code-generation options. With most compilers in debug mode, we'd carry dead code. With MSVC, even inlining is really bad even in release mode, and it doesn't perform constant propagation even with __forceinline. Change-Id: I7a95ff6622b864771243990bb5e205b2df0c33fc Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qsimd_p.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 98eb473da0..b01c47d4ce 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -239,11 +239,7 @@ static inline uint qCpuFeatures()
return uint(features);
}
-static inline uint qCpuHasFeature(CPUFeatures feature)
-{
- return qCompilerCpuFeatures & feature || qCpuFeatures() & feature;
-}
-
+#define qCpuHasFeature(feature) ((qCompilerCpuFeatures & (feature)) || (qCpuFeatures() & (feature)))
#define ALIGNMENT_PROLOGUE_16BYTES(ptr, i, length) \
for (; i < static_cast<int>(qMin(static_cast<quintptr>(length), ((4 - ((reinterpret_cast<quintptr>(ptr) >> 2) & 0x3)) & 0x3))); ++i)