aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--xbyak/xbyak_util.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/xbyak/xbyak_util.h b/xbyak/xbyak_util.h
index 649bb4c..6ff9aab 100644
--- a/xbyak/xbyak_util.h
+++ b/xbyak/xbyak_util.h
@@ -385,7 +385,6 @@ public:
const unsigned int& EDX = data[3];
getCpuid(0, data);
const unsigned int maxNum = EAX;
- unsigned int maxLeaf7Subleafs;
static const char intel[] = "ntel";
static const char amd[] = "cAMD";
if (ECX == get32bitAsBE(amd)) {
@@ -450,7 +449,6 @@ public:
#endif
{
getCpuidEx(7, 0, data);
- maxLeaf7Subleafs = EAX;
if (EBX & (1U << 16)) type_ |= tAVX512F;
if (type_ & tAVX512F) {
if (EBX & (1U << 17)) type_ |= tAVX512DQ;
@@ -472,18 +470,12 @@ public:
if (EDX & (1U << 3)) type_ |= tAVX512_4FMAPS;
if (EDX & (1U << 8)) type_ |= tAVX512_VP2INTERSECT;
}
- if (maxLeaf7Subleafs >= 1) {
- getCpuidEx(7, 1, data); // EAX=07H, ECX=1
- if (type_ & tAVX512F) {
- if (EAX & (1U << 5)) type_ |= tAVX512_BF16;
- }
- }
}
}
}
if (maxNum >= 7) {
getCpuidEx(7, 0, data);
- maxLeaf7Subleafs = EAX;
+ const uint32_t maxNumSubLeaves = EAX;
if (type_ & tAVX && (EBX & (1U << 5))) type_ |= tAVX2;
if (EBX & (1U << 3)) type_ |= tBMI1;
if (EBX & (1U << 8)) type_ |= tBMI2;
@@ -499,9 +491,12 @@ public:
if (EDX & (1U << 24)) type_ |= tAMX_TILE;
if (EDX & (1U << 25)) type_ |= tAMX_INT8;
if (EDX & (1U << 22)) type_ |= tAMX_BF16;
- if (maxLeaf7Subleafs >= 1) {
+ if (maxNumSubLeaves >= 1) {
getCpuidEx(7, 1, data);
if (EAX & (1U << 4)) type_ |= tAVX_VNNI;
+ if (type_ & tAVX512F) {
+ if (EAX & (1U << 5)) type_ |= tAVX512_BF16;
+ }
}
}
setFamily();