diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-06-05 14:16:16 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-06-13 21:26:53 +0000 |
commit | efd9016ea1f11dca78fec7b6c5a4221474436a63 (patch) | |
tree | 91936866af680fc0f13db668d35241fe8b6fbf47 /src | |
parent | 79a77f7def676c557792fb871df3f36a86a3fa5f (diff) | |
download | qtbase-efd9016ea1f11dca78fec7b6c5a4221474436a63.tar.gz |
Add warning about missing but required CPU features
Useful to debug why you're getting SIGILL, like running under Valgrind:
Processor features: sse3[required] sse2[required] ssse3[required] fma
cmpxchg16b sse4.1[required] sse4.2[required] movbe popcnt[required]
aes[required] avx[required] f16c[required] bmi[required] avx2[required]
bmi2[required]
!!!!!!!!!!!!!!!!!!!!
!!! Missing required features: rdrand rdseed
!!! Applications will likely crash with "Invalid Instruction"
!!!!!!!!!!!!!!!!!!!!
Change-Id: Ia3e896da908f42939148fffd14c556557419b091
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qsimd.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index d4edf459de..4c6f08c774 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -721,6 +721,14 @@ void qDumpCPUFeatures() printf("%s%s", features_string + features_indices[i], minFeature & (Q_UINT64_C(1) << i) ? "[required]" : ""); } + if ((features = (qCompilerCpuFeatures & ~features))) { + printf("\n!!!!!!!!!!!!!!!!!!!!\n!!! Missing required features:"); + for (int i = 0; i < features_count; ++i) { + if (features & (Q_UINT64_C(1) << i)) + printf("%s", features_string + features_indices[i]); + } + printf("\n!!! Applications will likely crash with \"Invalid Instruction\"\n!!!!!!!!!!!!!!!!!!!!"); + } puts(""); } |