Skip to content

Commit df488b1

Browse files
author
mirali777
committed
(CpuId) Add AVX512 VNNI feature detection
Adds AVX512 VNNI to NX86 CPU feature detection and cached flags, plus the corresponding CpuId unit-test hook. This PR is limited to `util/system/` changes. Verification: - `ya make -tt util/system/ut -F TestCpuId` commit_hash:be9c9e83f684838f3e5d9e390636c2bd5e1e0342
1 parent ba12733 commit df488b1

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

util/system/cpu_id.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ bool NX86::HaveAVX512VL() noexcept {
231231
return HaveAVX512F() && ((TX86CpuInfo(0x7, 0).EBX >> 31) & 1u);
232232
}
233233

234+
bool NX86::HaveAVX512VNNI() noexcept {
235+
return HaveAVX512F() && ((TX86CpuInfo(0x7, 0).ECX >> 11) & 1u);
236+
}
237+
234238
bool NX86::HavePREFETCHWT1() noexcept {
235239
return TX86CpuInfo(0x0).EAX >= 0x7 && ((TX86CpuInfo(0x7, 0).ECX >> 0) & 1u);
236240
}

util/system/cpu_id.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
F(AVX512CD) \
2929
F(AVX512BW) \
3030
F(AVX512VL) \
31+
F(AVX512VNNI) \
3132
F(AVX512VBMI) \
3233
F(PREFETCHWT1) \
3334
F(SHA) \
@@ -58,6 +59,7 @@
5859
F(AVX512CD) \
5960
F(AVX512BW) \
6061
F(AVX512VL) \
62+
F(AVX512VNNI) \
6163
F(AVX512VBMI) \
6264
F(PREFETCHWT1) \
6365
F(SHA) \

0 commit comments

Comments
 (0)