Skip to content

Commit

Permalink
add detection of AESKLE, WIDE_KL
Browse files Browse the repository at this point in the history
  • Loading branch information
herumi committed Dec 19, 2023
1 parent e2d36c6 commit 68a30b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sample/test_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ void putCPUinfo(bool onlyCpuidFeature)
{ Cpu::tAVX_VNNI_INT16, "avx_vnni_int16" },
{ Cpu::tAPX_F, "apx_f" },
{ Cpu::tAVX10, "avx10" },
{ Cpu::tAESKLE, "aeskle" },
{ Cpu::tWIDE_KL, "wide_kl" },
};
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
if (cpu.has(tbl[i].type)) printf(" %s", tbl[i].str);
Expand Down
7 changes: 7 additions & 0 deletions xbyak/xbyak_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ class Cpu {
XBYAK_DEFINE_TYPE(81, tAVX_VNNI_INT16);
XBYAK_DEFINE_TYPE(82, tAPX_F);
XBYAK_DEFINE_TYPE(83, tAVX10);
XBYAK_DEFINE_TYPE(84, tAESKLE);
XBYAK_DEFINE_TYPE(84, tWIDE_KL);

#undef XBYAK_SPLIT_ID
#undef XBYAK_DEFINE_TYPE
Expand Down Expand Up @@ -635,6 +637,11 @@ class Cpu {
if (EDX & (1U << 21)) type_ |= tAPX_F;
}
}
if (maxNum >= 0x19) {
getCpuidEx(0x19, 0, data);
if (EBX & (1U << 0)) type_ |= tAESKLE;
if (EBX & (1U << 2)) type_ |= tWIDE_KL;
}
if (has(tAVX10) && maxNum >= 0x24) {
getCpuidEx(0x24, 0, data);
avx10version_ = EBX & mask(7);
Expand Down

0 comments on commit 68a30b9

Please sign in to comment.