From acd360c38fbe1612c7e2ecb3a88bd3440b27cf26 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Mon, 30 Aug 2021 14:16:08 +0900 Subject: [PATCH] add Cpu::tAVX512_FP16 --- sample/test_util.cpp | 1 + xbyak/xbyak_util.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sample/test_util.cpp b/sample/test_util.cpp index cd23984..79a2d32 100644 --- a/sample/test_util.cpp +++ b/sample/test_util.cpp @@ -83,6 +83,7 @@ void putCPUinfo() { Cpu::tAMX_INT8, "amx(int8)" }, { Cpu::tAMX_BF16, "amx(bf16)" }, { Cpu::tAVX_VNNI, "avx_vnni" }, + { Cpu::tAVX512_FP16, "avx512_fp16" }, }; 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 41ba6c6..f2f651f 100644 --- a/xbyak/xbyak_util.h +++ b/xbyak/xbyak_util.h @@ -367,7 +367,8 @@ public: static const Type tAMX_INT8 = uint64_t(1) << 60; static const Type tAMX_BF16 = uint64_t(1) << 61; static const Type tAVX_VNNI = uint64_t(1) << 62; - // 11, 18, 63 + static const Type tAVX512_FP16 = uint64_t(1) << 11; + // 18, 63 Cpu() : type_(NONE) @@ -468,6 +469,7 @@ public: if (EDX & (1U << 2)) type_ |= tAVX512_4VNNIW; if (EDX & (1U << 3)) type_ |= tAVX512_4FMAPS; if (EDX & (1U << 8)) type_ |= tAVX512_VP2INTERSECT; + if ((type_ & tAVX512BW) && (EDX & (1U << 23))) type_ |= tAVX512_FP16; } } }