Qt 4.8
Macros | Enumerations | Functions
qsimd_p.h File Reference
#include <qglobal.h>

Go to the source code of this file.

Macros

#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)
 

Enumerations

enum  CPUFeatures {
  None = 0, MMX = 0x1, MMXEXT = 0x2, MMX3DNOW = 0x4,
  MMX3DNOWEXT = 0x8, SSE = 0x10, SSE2 = 0x20, CMOV = 0x40,
  IWMMXT = 0x80, NEON = 0x100, SSE3 = 0x200, SSSE3 = 0x400,
  SSE4_1 = 0x800, SSE4_2 = 0x1000, AVX = 0x2000
}
 

Functions

Q_CORE_EXPORT uint qDetectCPUFeatures ()
 

Macro Definition Documentation

◆ ALIGNMENT_PROLOGUE_16BYTES

#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)

Definition at line 231 of file qsimd_p.h.

Enumeration Type Documentation

◆ CPUFeatures

Enumerator
None 
MMX 
MMXEXT 
MMX3DNOW 
MMX3DNOWEXT 
SSE 
SSE2 
CMOV 
IWMMXT 
NEON 
SSE3 
SSSE3 
SSE4_1 
SSE4_2 
AVX 

Definition at line 210 of file qsimd_p.h.

210  {
211  None = 0,
212  MMX = 0x1,
213  MMXEXT = 0x2,
214  MMX3DNOW = 0x4,
215  MMX3DNOWEXT = 0x8,
216  SSE = 0x10,
217  SSE2 = 0x20,
218  CMOV = 0x40,
219  IWMMXT = 0x80,
220  NEON = 0x100,
221  SSE3 = 0x200,
222  SSSE3 = 0x400,
223  SSE4_1 = 0x800,
224  SSE4_2 = 0x1000,
225  AVX = 0x2000
226 };
Definition: qsimd_p.h:211
Definition: qsimd_p.h:225
Definition: qsimd_p.h:217
Definition: qsimd_p.h:218
Definition: qsimd_p.h:212
Definition: qsimd_p.h:222
Definition: qsimd_p.h:221
Definition: qsimd_p.h:220
Definition: qsimd_p.h:216

Function Documentation

◆ qDetectCPUFeatures()

Q_CORE_EXPORT uint qDetectCPUFeatures ( )

Definition at line 382 of file qsimd.cpp.

Referenced by qDumpCPUFeatures(), qInitDrawhelperAsm(), qInitImageConversions(), and QJpegHandler::QJpegHandler().

383 {
384  static QBasicAtomicInt features = Q_BASIC_ATOMIC_INITIALIZER(-1);
385  if (features != -1)
386  return features;
387 
389  QByteArray disable = qgetenv("QT_NO_CPU_FEATURE");
390  if (!disable.isEmpty()) {
391  disable.prepend(' ');
392  for (int i = 0; i < features_count; ++i) {
393  if (disable.contains(features_string + features_indices[i]))
394  f &= ~(1 << i);
395  }
396  }
397 
398  features = f;
399  return features;
400 }
static const int features_indices[]
Definition: qsimd.cpp:374
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
const int features_count
Definition: qsimd.cpp:380
QByteArray & prepend(char c)
Prepends the character ch to this byte array.
#define Q_BASIC_ATOMIC_INITIALIZER(a)
Definition: qbasicatomic.h:218
unsigned int uint
Definition: qglobal.h:996
static const char features_string[]
Definition: qsimd.cpp:357
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
static uint detectProcessorFeatures()
Definition: qsimd.cpp:81
QBool contains(char c) const
Returns true if the byte array contains the character ch; otherwise returns false.
Definition: qbytearray.h:525