qtbase/src/corelib/tools/qsimd_x86.cpp
Thiago Macieira cf63b0e1df qsimd: add support for new x86 CPU features
This adds detection for: VAES, GFNI, AVX512VBMI2, AVX512VNNI,
AVX512BITALG, AVX512VPOPCNTDQ, AVX512_4NNIW, AVX512_4FMAPS. These
features were found in the "Intel® Architecture Instruction Set
Extensions and Future Features" manual, revision 30. This commit also
adds support for RDPID (already in the main manual) and the Control-flow
Enforcement Technology, which appears in a separate Intel paper.

This new support was done by adding a new generator script so we don't
have to maintain two tables in sync, one in qsimd.cpp with the feature
names, and the other in qsimd_p.h.

Since we now need a lot more bits, it's no longer worth keeping the two
halves of the qt_cpu_features variable mostly similar to the main two
CPUID results. This commit goes back to keeping things in order, like we
used to prior to commit 6a8251a89b6a61258498f4af1ba7b3d5b7f7096c (Qt 5.6)

At the time of this commit, GCC 8 has macros for AVX512VPOPCNTDQ,
AVX512_4NNIW, AVX512_4FMAPS, AVX512VBMI2 and GFNI.

Change-Id: I938b024e38bf4aac9154fffd14f7afae50faaa96
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-05-05 06:20:07 +00:00

99 lines
2.3 KiB
C++

// This is a generated file. DO NOT EDIT.
// Please see util/x86simdgen/generate.pl
#include <qglobal.h>
static const char features_string[] =
" sse2\0"
" sse3\0"
" ssse3\0"
" fma\0"
" sse4.1\0"
" sse4.2\0"
" movbe\0"
" popcnt\0"
" aes\0"
" avx\0"
" f16c\0"
" rdrnd\0"
" bmi\0"
" hle\0"
" avx2\0"
" bmi2\0"
" rtm\0"
" avx512f\0"
" avx512dq\0"
" rdseed\0"
" avx512ifma\0"
" avx512pf\0"
" avx512er\0"
" avx512cd\0"
" sha\0"
" avx512bw\0"
" avx512vl\0"
" avx512vbmi\0"
" avx512vbmi2\0"
" gfni\0"
" vaes\0"
" avx512vnni\0"
" avx512bitalg\0"
" avx512vpopcntdq\0"
" avx5124nniw\0"
" avx5124fmaps\0"
"\0";
static const quint16 features_indices[] = {
306, 0, 6, 12, 19, 24, 32, 40,
47, 55, 60, 65, 71, 78, 83, 88,
94, 100, 105, 114, 124, 132, 144, 154,
164, 174, 179, 189, 199, 211, 224, 230,
236, 248, 262, 279, 292
};
enum X86CpuidLeaves {
Leaf1ECX,
Leaf1EDX,
Leaf7_0EBX,
Leaf7_0ECX,
Leaf7_0EDX,
X86CpuidMaxLeaf
};
static const quint8 x86_locators[] = {
Leaf1EDX*32 + 26, // sse2
Leaf1ECX*32 + 0, // sse3
Leaf1ECX*32 + 9, // ssse3
Leaf1ECX*32 + 12, // fma
Leaf1ECX*32 + 19, // sse4.1
Leaf1ECX*32 + 20, // sse4.2
Leaf1ECX*32 + 22, // movbe
Leaf1ECX*32 + 23, // popcnt
Leaf1ECX*32 + 25, // aes
Leaf1ECX*32 + 28, // avx
Leaf1ECX*32 + 29, // f16c
Leaf1ECX*32 + 30, // rdrnd
Leaf7_0EBX*32 + 3, // bmi
Leaf7_0EBX*32 + 4, // hle
Leaf7_0EBX*32 + 5, // avx2
Leaf7_0EBX*32 + 8, // bmi2
Leaf7_0EBX*32 + 11, // rtm
Leaf7_0EBX*32 + 16, // avx512f
Leaf7_0EBX*32 + 17, // avx512dq
Leaf7_0EBX*32 + 18, // rdseed
Leaf7_0EBX*32 + 21, // avx512ifma
Leaf7_0EBX*32 + 26, // avx512pf
Leaf7_0EBX*32 + 27, // avx512er
Leaf7_0EBX*32 + 28, // avx512cd
Leaf7_0EBX*32 + 29, // sha
Leaf7_0EBX*32 + 30, // avx512bw
Leaf7_0EBX*32 + 31, // avx512vl
Leaf7_0ECX*32 + 1, // avx512vbmi
Leaf7_0ECX*32 + 6, // avx512vbmi2
Leaf7_0ECX*32 + 8, // gfni
Leaf7_0ECX*32 + 9, // vaes
Leaf7_0ECX*32 + 11, // avx512vnni
Leaf7_0ECX*32 + 12, // avx512bitalg
Leaf7_0ECX*32 + 14, // avx512vpopcntdq
Leaf7_0EDX*32 + 2, // avx5124nniw
Leaf7_0EDX*32 + 3 // avx5124fmaps
};