Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qsimd_p.h File Reference
#include <QtCore/private/qglobal_p.h>
#include <QtCore/qsimd.h>
#include <stdatomic.h>
+ Include dependency graph for qsimd_p.h:
+ This graph shows which files directly or indirectly include this file:

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)
 
#define ALIGNMENT_PROLOGUE_32BYTES(ptr, i, length)    for (; i < static_cast<int>(qMin(static_cast<quintptr>(length), ((8 - ((reinterpret_cast<quintptr>(ptr) >> 2) & 0x7)) & 0x7))); ++i)
 
#define SIMD_EPILOGUE(i, length, max)    for (int _i = 0; _i < max && i < length; ++i, ++_i)
 
#define QT_COMPILER_SUPPORTS(x)   (QT_COMPILER_SUPPORTS_ ## x - 0)
 
#define QT_COMPILER_SUPPORTS_HERE(x)   (__ ## x ## __)
 
#define QT_FUNCTION_TARGET(x)
 
#define Q_ATOMIC(T)   _Atomic(T)
 
#define qCpuHasFeature(feature)
 

Typedefs

typedef unsigned QCpuFeatureType
 

Enumerations

enum  CPUFeatures
 

Functions

Q_CORE_EXPORT Q_ATOMIC (QCpuFeatureType) QT_MANGLE_NAMESPACE(qt_cpu_features)[1]
 
Q_CORE_EXPORT uint64_t QT_MANGLE_NAMESPACE() qDetectCpuFeatures ()
 
static uint64_t qCpuFeatures ()
 
static void qYieldCpu ()
 

Variables

static const uint64_t qCompilerCpuFeatures = 0
 

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 27 of file qsimd_p.h.

◆ ALIGNMENT_PROLOGUE_32BYTES

#define ALIGNMENT_PROLOGUE_32BYTES (   ptr,
  i,
  length 
)     for (; i < static_cast<int>(qMin(static_cast<quintptr>(length), ((8 - ((reinterpret_cast<quintptr>(ptr) >> 2) & 0x7)) & 0x7))); ++i)

Definition at line 30 of file qsimd_p.h.

◆ Q_ATOMIC

#define Q_ATOMIC (   T)    _Atomic(T)

Definition at line 350 of file qsimd_p.h.

◆ qCpuHasFeature

#define qCpuHasFeature (   feature)
Value:
(((qCompilerCpuFeatures & CpuFeature ## feature) == CpuFeature ## feature) \
|| ((qCpuFeatures() & CpuFeature ## feature) == CpuFeature ## feature))
static const uint64_t qCompilerCpuFeatures
Definition qsimd_p.h:322
static uint64_t qCpuFeatures()
Definition qsimd_p.h:364

Definition at line 378 of file qsimd_p.h.

◆ QT_COMPILER_SUPPORTS

#define QT_COMPILER_SUPPORTS (   x)    (QT_COMPILER_SUPPORTS_ ## x - 0)

Definition at line 100 of file qsimd_p.h.

◆ QT_COMPILER_SUPPORTS_HERE

#define QT_COMPILER_SUPPORTS_HERE (   x)    (__ ## x ## __)

Definition at line 132 of file qsimd_p.h.

◆ QT_FUNCTION_TARGET

#define QT_FUNCTION_TARGET (   x)

Definition at line 133 of file qsimd_p.h.

◆ SIMD_EPILOGUE

#define SIMD_EPILOGUE (   i,
  length,
  max 
)     for (int _i = 0; _i < max && i < length; ++i, ++_i)

Definition at line 33 of file qsimd_p.h.

Typedef Documentation

◆ QCpuFeatureType

typedef unsigned QCpuFeatureType

Definition at line 359 of file qsimd_p.h.

Enumeration Type Documentation

◆ CPUFeatures

Definition at line 309 of file qsimd_p.h.

Function Documentation

◆ Q_ATOMIC()

Q_CORE_EXPORT Q_ATOMIC ( QCpuFeatureType  ) )[1]

◆ qCpuFeatures()

static uint64_t qCpuFeatures ( )
inlinestatic

Definition at line 364 of file qsimd_p.h.

References Q_UNLIKELY, qCompilerCpuFeatures, qDetectCpuFeatures(), QT_MANGLE_NAMESPACE, and QT_SUPPORTS_INIT_PRIORITY.

Referenced by QHash< Key, T >::qHashBits().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qDetectCpuFeatures()

Q_CORE_EXPORT uint64_t QT_MANGLE_NAMESPACE() qDetectCpuFeatures ( )

Definition at line 566 of file qsimd.cpp.

References arraysize(), assert, detectProcessorFeatures(), features_indices, features_string, i, minFeature, Q_UINT64_C, Q_UNLIKELY, qAbort(), QT_MANGLE_NAMESPACE, SimdInitialized, str, and token.

Referenced by qCpuFeatures().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qYieldCpu()

static void qYieldCpu ( )
inlinestatic

Definition at line 403 of file qsimd_p.h.

Referenced by QtConcurrent::ThreadEngineBarrier::acquire(), is_fatal_count_down(), QtConcurrent::ThreadEngineBarrier::release(), QtConcurrent::ThreadEngineBarrier::releaseUnlessLast(), switch_from_to(), and QtConcurrent::ThreadEngineBarrier::wait().

+ Here is the caller graph for this function:

Variable Documentation

◆ qCompilerCpuFeatures

const uint64_t qCompilerCpuFeatures = 0
static

Definition at line 322 of file qsimd_p.h.

Referenced by qCpuFeatures(), and qDumpCPUFeatures().