46 #if defined(Q_OS_WINCE) 50 #if defined(Q_OS_WIN64) 54 #if defined(Q_OS_LINUX) && defined(__arm__) 55 #include "private/qcore_unix_p.h" 61 #define HWCAP_IWMMXT 512 62 #define HWCAP_CRUNCH 1024 63 #define HWCAP_THUMBEE 2048 64 #define HWCAP_NEON 4096 65 #define HWCAP_VFPv3 8192 66 #define HWCAP_VFPv3D16 16384 75 #if defined (Q_OS_NACL) 80 #elif defined (Q_OS_WINCE) 86 if (IsProcessorFeaturePresent(PF_ARM_INTEL_WMMX)) {
92 #if defined QT_HAVE_MMX 93 if (IsProcessorFeaturePresent(PF_MMX_INSTRUCTIONS_AVAILABLE))
96 #if defined QT_HAVE_3DNOW 97 if (IsProcessorFeaturePresent(PF_3DNOW_INSTRUCTIONS_AVAILABLE))
106 #elif defined(__arm__) || defined(__arm) || defined(QT_HAVE_IWMMXT) || defined(QT_HAVE_NEON) 111 #if defined(Q_OS_LINUX) 114 unsigned long vector[64];
116 while (features == 0) {
123 int max = nread / (
sizeof vector[0]);
124 for (
int i = 0; i < max; i += 2)
125 if (vector[i] == AT_HWCAP) {
126 if (vector[i+1] & HWCAP_IWMMXT)
128 if (vector[i+1] & HWCAP_NEON)
140 #if defined(QT_HAVE_IWMMXT) 143 #elif defined(QT_ALWAYS_HAVE_NEON) 150 #elif defined(__i386__) || defined(_M_IX86) 155 unsigned int extended_result = 0;
156 unsigned int feature_result = 0;
159 #if defined(Q_CC_GNU) 160 long cpuid_supported, tmp1;
164 "xor $0x00200000, %0\n" 170 :
"=a" (cpuid_supported),
"=r" (tmp1)
172 if (cpuid_supported) {
173 asm (
"xchg %%ebx, %2\n" 176 :
"=c" (feature_result),
"=d" (result),
"=&r" (tmp1)
179 asm (
"xchg %%ebx, %1\n" 181 "cmp $0x80000000, %%eax\n" 186 "mov $0x80000001, %%eax\n" 190 :
"=d" (extended_result),
"=&r" (tmp1)
196 #elif defined (Q_OS_WIN) 217 mov feature_result, ecx
248 mov extended_result, edx
259 if (result & (1
u << 15))
261 if (result & (1
u << 23))
263 if (extended_result & (1
u << 22))
265 if (extended_result & (1
u << 31))
267 if (extended_result & (1
u << 30))
269 if (result & (1
u << 25))
271 if (result & (1
u << 26))
273 if (feature_result & (1
u))
275 if (feature_result & (1
u << 9))
277 if (feature_result & (1
u << 19))
279 if (feature_result & (1
u << 20))
281 if (feature_result & (1
u << 28))
287 #elif defined(__x86_64) || defined(Q_OS_WIN64) 291 uint feature_result = 0;
293 #if defined (Q_OS_WIN64) 297 feature_result = info[2];
299 #elif defined(Q_CC_GNU) 301 asm (
"xchg %%rbx, %1\n" 304 :
"=c" (feature_result),
"=&r" (tmp)
310 if (feature_result & (1
u))
312 if (feature_result & (1
u << 9))
314 if (feature_result & (1
u << 19))
316 if (feature_result & (1
u << 20))
318 if (feature_result & (1
u << 28))
324 #elif defined(__ia64__) 375 0, 5, 13, 23, 36, 41, 47, 53,
376 61, 67, 73, 80, 88, 96, -1
405 printf(
"Processor features: ");
407 if (features & (1 << i))
static const int features_indices[]
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
static mach_timebase_info_data_t info
#define QT_END_NAMESPACE
This macro expands to.
The QByteArray class provides an array of bytes.
QByteArray & prepend(char c)
Prepends the character ch to this byte array.
static int qt_safe_close(int fd)
#define Q_BASIC_ATOMIC_INITIALIZER(a)
#define QT_BEGIN_NAMESPACE
This macro expands to.
static int qt_safe_open(const char *pathname, int flags, mode_t mode=0777)
static int cmp(const ushort *s1, const ushort *s2, size_t len)
uint qDetectCPUFeatures()
static const char features_string[]
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
static uint detectProcessorFeatures()
static qint64 qt_safe_read(int fd, void *data, qint64 maxlen)
QBool contains(char c) const
Returns true if the byte array contains the character ch; otherwise returns false.