add detection of avx10/apx_f
diff --git a/sample/test_util.cpp b/sample/test_util.cpp
index 35c2fa8..66869ee 100644
--- a/sample/test_util.cpp
+++ b/sample/test_util.cpp
@@ -103,12 +103,17 @@
{ Cpu::tSM3, "sm3" },
{ Cpu::tSM4, "sm4" },
{ Cpu::tAVX_VNNI_INT16, "avx_vnni_int16" },
+ { Cpu::tAPX_F, "apx_f" },
+ { Cpu::tAVX10, "avx10" },
};
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
if (cpu.has(tbl[i].type)) printf(" %s", tbl[i].str);
}
printf("\n");
if (onlyCpuidFeature) return;
+ if (cpu.has(Cpu::tAVX10)) {
+ printf("AVX10 version %d\n", cpu.getAVX10version());
+ }
if (cpu.has(Cpu::tPOPCNT)) {
const int n = 0x12345678; // bitcount = 13
const int ok = 13;
diff --git a/xbyak/xbyak_util.h b/xbyak/xbyak_util.h
index 0bcc134..950cc2d 100644
--- a/xbyak/xbyak_util.h
+++ b/xbyak/xbyak_util.h
@@ -144,6 +144,7 @@
uint32_t dataCacheSize_[maxNumberCacheLevels];
uint32_t coresSharignDataCache_[maxNumberCacheLevels];
uint32_t dataCacheLevels_;
+ uint32_t avx10version_;
uint32_t get32bitAsBE(const char *x) const
{
@@ -470,6 +471,8 @@
XBYAK_DEFINE_TYPE(79, tSM3);
XBYAK_DEFINE_TYPE(80, tSM4);
XBYAK_DEFINE_TYPE(81, tAVX_VNNI_INT16);
+ XBYAK_DEFINE_TYPE(82, tAPX_F);
+ XBYAK_DEFINE_TYPE(83, tAVX10);
#undef XBYAK_SPLIT_ID
#undef XBYAK_DEFINE_TYPE
@@ -481,6 +484,7 @@
, dataCacheSize_()
, coresSharignDataCache_()
, dataCacheLevels_(0)
+ , avx10version_(0)
{
uint32_t data[4] = {};
const uint32_t& EAX = data[0];
@@ -627,8 +631,14 @@
if (EDX & (1U << 5)) type_ |= tAVX_NE_CONVERT;
if (EDX & (1U << 10)) type_ |= tAVX_VNNI_INT16;
if (EDX & (1U << 14)) type_ |= tPREFETCHITI;
+ if (EDX & (1U << 19)) type_ |= tAVX10;
+ if (EDX & (1U << 21)) type_ |= tAPX_F;
}
}
+ if (has(tAVX10) && maxNum >= 24) {
+ getCpuidEx(0x24, 0, data);
+ avx10version_ = EBX & mask(7);
+ }
setFamily();
setNumCores();
setCacheHierarchy();
@@ -645,6 +655,7 @@
{
return (type & type_) == type;
}
+ int getAVX10version() const { return avx10version_; }
};
#ifndef XBYAK_ONLY_CLASS_CPU