From 38c40c02e623638489775763f2af4ee6a5d50fe5 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Wed, 11 May 2022 14:04:22 +0900 Subject: [PATCH] detection of clflushopt --- sample/test_util.cpp | 1 + xbyak/xbyak_util.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/sample/test_util.cpp b/sample/test_util.cpp index 60cf77a..39ed906 100644 --- a/sample/test_util.cpp +++ b/sample/test_util.cpp @@ -84,6 +84,7 @@ void putCPUinfo() { Cpu::tAVX_VNNI, "avx_vnni" }, { Cpu::tAVX512_FP16, "avx512_fp16" }, { Cpu::tWAITPKG, "waitpkg" }, + { Cpu::tCLFLUSHOPT, "clflushopt" }, }; for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) { if (cpu.has(tbl[i].type)) printf(" %s", tbl[i].str); diff --git a/xbyak/xbyak_util.h b/xbyak/xbyak_util.h index 1db92cb..86d8d15 100644 --- a/xbyak/xbyak_util.h +++ b/xbyak/xbyak_util.h @@ -428,6 +428,7 @@ public: static const Type tAMX_INT8; static const Type tAMX_BF16; static const Type tAVX_VNNI; + static const Type tCLFLUSHOPT; CpuT() : type_(NONE) @@ -543,6 +544,7 @@ public: if (EBX & (1U << 18)) type_ |= tRDSEED; if (EBX & (1U << 19)) type_ |= tADX; if (EBX & (1U << 20)) type_ |= tSMAP; + if (EBX & (1U << 23)) type_ |= tCLFLUSHOPT; if (EBX & (1U << 4)) type_ |= tHLE; if (EBX & (1U << 11)) type_ |= tRTM; if (EBX & (1U << 14)) type_ |= tMPX; @@ -647,6 +649,7 @@ template const Type CpuT::tAMX_TILE = uint64_t(1) << 59; template const Type CpuT::tAMX_INT8 = uint64_t(1) << 60; template const Type CpuT::tAMX_BF16 = uint64_t(1) << 61; template const Type CpuT::tAVX_VNNI = uint64_t(1) << 62; +template const Type CpuT::tCLFLUSHOPT = Type(1) << 63; } // local