[x64] Add `kX64EmitGFNI` emitter feature-flag

This determines support for the `gf2p8affineqb` instruction. Even though `GFNI` is typically found with AVX512-enabled chips, it _is_ possible for there to be a chip with `GFNI` but does not support `AVX` or `AVX2` of any sort. An example of this is Tremont(Lakefield) chips as well as Jasper Lake.

13df339fe7/GenuineIntel/GenuineIntel00806A1_Lakefield_LC_InstLatX64.txt (L1297-L1299)

13df339fe7/GenuineIntel/GenuineIntel00906C0_JasperLake_InstLatX64.txt (L1252-L1254)
This commit is contained in:
Wunkolo 2021-12-28 20:08:48 -08:00 committed by Rick Gibbed
parent 5d1b53cd6f
commit fba23e3e75
3 changed files with 12 additions and 8 deletions

View File

@ -37,10 +37,11 @@ DEFINE_int32(x64_extension_mask, -1,
" 16 = BMI2\n"
" 32 = F16C\n"
" 64 = Movbe\n"
" 128 = AVX512F\n"
" 256 = AVX512VL\n"
" 512 = AVX512BW\n"
" 1024 = AVX512DQ\n"
" 128 = GFNI\n"
" 256 = AVX512F\n"
" 512 = AVX512VL\n"
" 1024 = AVX512BW\n"
" 2048 = AVX512DQ\n"
" -1 = Detect and utilize all possible processor features\n",
"x64");

View File

@ -88,6 +88,8 @@ X64Emitter::X64Emitter(X64Backend* backend, XbyakAllocator* allocator)
feature_flags_ |= cpu_.has(Xbyak::util::Cpu::tF16C) ? kX64EmitF16C : 0;
if (cvars::x64_extension_mask & kX64EmitMovbe)
feature_flags_ |= cpu_.has(Xbyak::util::Cpu::tMOVBE) ? kX64EmitMovbe : 0;
if (cvars::x64_extension_mask & kX64EmitGFNI)
feature_flags_ |= cpu_.has(Xbyak::util::Cpu::tGFNI) ? kX64EmitGFNI : 0;
if (cvars::x64_extension_mask & kX64EmitAVX512F)
feature_flags_ |=
cpu_.has(Xbyak::util::Cpu::tAVX512F) ? kX64EmitAVX512F : 0;

View File

@ -132,12 +132,13 @@ enum X64EmitterFeatureFlags {
kX64EmitBMI2 = 1 << 4,
kX64EmitF16C = 1 << 5,
kX64EmitMovbe = 1 << 6,
kX64EmitGFNI = 1 << 7,
kX64EmitAVX512F = 1 << 7,
kX64EmitAVX512VL = 1 << 8,
kX64EmitAVX512F = 1 << 8,
kX64EmitAVX512VL = 1 << 9,
kX64EmitAVX512BW = 1 << 9,
kX64EmitAVX512DQ = 1 << 10,
kX64EmitAVX512BW = 1 << 10,
kX64EmitAVX512DQ = 1 << 11,
kX64EmitAVX512Ortho = kX64EmitAVX512F | kX64EmitAVX512VL,
kX64EmitAVX512Ortho64 = kX64EmitAVX512Ortho | kX64EmitAVX512DQ