Fix build with GCC 13: target specific option mismatch
range_access.h:274:5: error: inlining failed in call to ‘always_inline’ ‘constexpr std::size_t std::size(const _Tp (&)[_Nm]) noexcept [with _Tp = short unsigned int; long unsigned int _Nm = 34]’: target specific option mismatch qsimd.cpp:367:35: note: called from here Pick-to: 6.5 Change-Id: Ide4dbd0777a44ed0870efffd1739097c71991822 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
parent
e7c7902e73
commit
d298ec3a6f
@ -9,8 +9,6 @@
|
|||||||
#include "qsimd_p.h"
|
#include "qsimd_p.h"
|
||||||
#include "qalgorithms.h"
|
#include "qalgorithms.h"
|
||||||
|
|
||||||
#include <array> // for std::size
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -64,6 +62,14 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
template <typename T, uint N> QT_FUNCTION_TARGET_BASELINE
|
||||||
|
uint arraysize(T (&)[N])
|
||||||
|
{
|
||||||
|
// Same as std::size, but with QT_FUNCTION_TARGET_BASELIE,
|
||||||
|
// otherwise some versions of GCC fail to compile.
|
||||||
|
return N;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(Q_PROCESSOR_ARM)
|
#if defined(Q_PROCESSOR_ARM)
|
||||||
/* Data:
|
/* Data:
|
||||||
neon
|
neon
|
||||||
@ -364,7 +370,7 @@ static quint64 detectProcessorFeatures()
|
|||||||
cpuidFeatures07_00(results[Leaf07_00EBX], results[Leaf07_00ECX], results[Leaf07_00EDX]);
|
cpuidFeatures07_00(results[Leaf07_00EBX], results[Leaf07_00ECX], results[Leaf07_00EDX]);
|
||||||
|
|
||||||
// populate our feature list
|
// populate our feature list
|
||||||
for (uint i = 0; i < std::size(x86_locators); ++i) {
|
for (uint i = 0; i < arraysize(x86_locators); ++i) {
|
||||||
uint word = x86_locators[i] / 32;
|
uint word = x86_locators[i] / 32;
|
||||||
uint bit = 1U << (x86_locators[i] % 32);
|
uint bit = 1U << (x86_locators[i] % 32);
|
||||||
quint64 feature = Q_UINT64_C(1) << i;
|
quint64 feature = Q_UINT64_C(1) << i;
|
||||||
@ -583,7 +589,7 @@ uint64_t QT_MANGLE_NAMESPACE(qDetectCpuFeatures)()
|
|||||||
#endif
|
#endif
|
||||||
while (char *token = strtok(disable, " ")) {
|
while (char *token = strtok(disable, " ")) {
|
||||||
disable = nullptr;
|
disable = nullptr;
|
||||||
for (uint i = 0; i < std::size(features_indices); ++i) {
|
for (uint i = 0; i < arraysize(features_indices); ++i) {
|
||||||
if (strcmp(token, features_string + features_indices[i]) == 0)
|
if (strcmp(token, features_string + features_indices[i]) == 0)
|
||||||
f &= ~(Q_UINT64_C(1) << i);
|
f &= ~(Q_UINT64_C(1) << i);
|
||||||
}
|
}
|
||||||
@ -598,7 +604,7 @@ uint64_t QT_MANGLE_NAMESPACE(qDetectCpuFeatures)()
|
|||||||
if (Q_UNLIKELY(!runningOnValgrind && minFeatureTest != 0 && (f & minFeatureTest) != minFeatureTest)) {
|
if (Q_UNLIKELY(!runningOnValgrind && minFeatureTest != 0 && (f & minFeatureTest) != minFeatureTest)) {
|
||||||
quint64 missing = minFeatureTest & ~quint64(f);
|
quint64 missing = minFeatureTest & ~quint64(f);
|
||||||
fprintf(stderr, "Incompatible processor. This Qt build requires the following features:\n ");
|
fprintf(stderr, "Incompatible processor. This Qt build requires the following features:\n ");
|
||||||
for (uint i = 0; i < std::size(features_indices); ++i) {
|
for (uint i = 0; i < arraysize(features_indices); ++i) {
|
||||||
if (missing & (Q_UINT64_C(1) << i))
|
if (missing & (Q_UINT64_C(1) << i))
|
||||||
fprintf(stderr, "%s", features_string + features_indices[i]);
|
fprintf(stderr, "%s", features_string + features_indices[i]);
|
||||||
}
|
}
|
||||||
@ -618,14 +624,14 @@ void qDumpCPUFeatures()
|
|||||||
{
|
{
|
||||||
quint64 features = detectProcessorFeatures() & ~SimdInitialized;
|
quint64 features = detectProcessorFeatures() & ~SimdInitialized;
|
||||||
printf("Processor features: ");
|
printf("Processor features: ");
|
||||||
for (uint i = 0; i < std::size(features_indices); ++i) {
|
for (uint i = 0; i < arraysize(features_indices); ++i) {
|
||||||
if (features & (Q_UINT64_C(1) << i))
|
if (features & (Q_UINT64_C(1) << i))
|
||||||
printf("%s%s", features_string + features_indices[i],
|
printf("%s%s", features_string + features_indices[i],
|
||||||
minFeature & (Q_UINT64_C(1) << i) ? "[required]" : "");
|
minFeature & (Q_UINT64_C(1) << i) ? "[required]" : "");
|
||||||
}
|
}
|
||||||
if ((features = (qCompilerCpuFeatures & ~features))) {
|
if ((features = (qCompilerCpuFeatures & ~features))) {
|
||||||
printf("\n!!!!!!!!!!!!!!!!!!!!\n!!! Missing required features:");
|
printf("\n!!!!!!!!!!!!!!!!!!!!\n!!! Missing required features:");
|
||||||
for (uint i = 0; i < std::size(features_indices); ++i) {
|
for (uint i = 0; i < arraysize(features_indices); ++i) {
|
||||||
if (features & (Q_UINT64_C(1) << i))
|
if (features & (Q_UINT64_C(1) << i))
|
||||||
printf("%s", features_string + features_indices[i]);
|
printf("%s", features_string + features_indices[i]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user