iOS: rely on built-in compiler macros to check for CPU features

iOS cannot do runtime feature detection, and querying the CPU is only
allowed in kernel mode (or beyond), so we have to decide the features
at compile time, in which case we might as well use the fallback code
path that uses the built in __ARM_* macros to point out which features
are supported, instead of hard-coding the features for iOS.

Change-Id: Ie507c0d8e962a7bdab16508c8b8122645276512e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
Erik Verbruggen 2016-02-25 10:05:46 +01:00
parent 7d2c7ca8fa
commit 50388a7e4f

View File

@ -117,13 +117,7 @@ static inline quint64 detectProcessorFeatures()
{ {
quint64 features = 0; quint64 features = 0;
#if defined(Q_OS_IOS) #if defined(Q_OS_LINUX)
features |= Q_UINT64_C(1) << CpuFeatureNEON; // On iOS, NEON is always available.
# ifdef Q_PROCESSOR_ARM_V8
features |= Q_UINT64_C(1) << CpuFeatureCRC32; // On iOS, crc32 is always available if the architecture is Aarch32/64.
# endif
return features;
#elif defined(Q_OS_LINUX)
# if defined(Q_PROCESSOR_ARM_V8) && defined(Q_PROCESSOR_ARM_64) # if defined(Q_PROCESSOR_ARM_V8) && defined(Q_PROCESSOR_ARM_64)
features |= Q_UINT64_C(1) << CpuFeatureNEON; // NEON is always available on ARMv8 64bit. features |= Q_UINT64_C(1) << CpuFeatureNEON; // NEON is always available on ARMv8 64bit.
# endif # endif