From c2d5f6da90c10bf498588a8d3956807c13f48286 Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Wed, 9 Sep 2020 09:40:09 -0700 Subject: [PATCH] block_of_code: Add HasAVX512_Icelake Detect AVX512 feature support up to the [Icelake-level featureset](https://en.wikipedia.org/wiki/AVX-512#CPUs_with_AVX-512) --- src/backend/x64/block_of_code.cpp | 15 +++++++++++++++ src/backend/x64/block_of_code.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/backend/x64/block_of_code.cpp b/src/backend/x64/block_of_code.cpp index 15c42dbd..4d15eb73 100644 --- a/src/backend/x64/block_of_code.cpp +++ b/src/backend/x64/block_of_code.cpp @@ -384,6 +384,21 @@ bool BlockOfCode::HasAVX512_Skylake() const { && DoesCpuSupport(Xbyak::util::Cpu::tAVX512VL); } +bool BlockOfCode::HasAVX512_Icelake() const { + return DoesCpuSupport(Xbyak::util::Cpu::tAVX512F) + && DoesCpuSupport(Xbyak::util::Cpu::tAVX512CD) + && DoesCpuSupport(Xbyak::util::Cpu::tAVX512BW) + && DoesCpuSupport(Xbyak::util::Cpu::tAVX512DQ) + && DoesCpuSupport(Xbyak::util::Cpu::tAVX512VL) + && DoesCpuSupport(Xbyak::util::Cpu::tAVX512_VPOPCNTDQ) + && DoesCpuSupport(Xbyak::util::Cpu::tAVX512_VNNI) + && DoesCpuSupport(Xbyak::util::Cpu::tGFNI) + && DoesCpuSupport(Xbyak::util::Cpu::tVAES) + && DoesCpuSupport(Xbyak::util::Cpu::tAVX512_VBMI2) + && DoesCpuSupport(Xbyak::util::Cpu::tAVX512_BITALG) + && DoesCpuSupport(Xbyak::util::Cpu::tVPCLMULQDQ); +} + bool BlockOfCode::HasAVX512_BITALG() const { return DoesCpuSupport(Xbyak::util::Cpu::tAVX512_BITALG); } diff --git a/src/backend/x64/block_of_code.h b/src/backend/x64/block_of_code.h index 43c26cbd..23ed1683 100644 --- a/src/backend/x64/block_of_code.h +++ b/src/backend/x64/block_of_code.h @@ -158,6 +158,7 @@ public: bool HasFMA() const; bool HasAVX2() const; bool HasAVX512_Skylake() const; + bool HasAVX512_Icelake() const; bool HasAVX512_BITALG() const; private: