diff --git a/test/misc.cpp b/test/misc.cpp index 0d79e64..2f0413e 100644 --- a/test/misc.cpp +++ b/test/misc.cpp @@ -821,7 +821,9 @@ CYBOZU_TEST_AUTO(vnni) struct Code : Xbyak::CodeGenerator { Code() { - vpdpbusd(xm0, xm1, xm2); // EVEX + // default encoding is EVEX + vpdpbusd(xm0, xm1, xm2); + vpdpbusd(xm0, xm1, xm2, EvexEncoding); // EVEX vpdpbusd(xm0, xm1, xm2, VexEncoding); // VEX } void badVex() @@ -830,6 +832,7 @@ CYBOZU_TEST_AUTO(vnni) } } c; const uint8_t tbl[] = { + 0x62, 0xF2, 0x75, 0x08, 0x50, 0xC2, 0x62, 0xF2, 0x75, 0x08, 0x50, 0xC2, 0xC4, 0xE2, 0x71, 0x50, 0xC2, }; diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h index d60ee8d..9a740b1 100644 --- a/xbyak/xbyak.h +++ b/xbyak/xbyak.h @@ -2306,12 +2306,11 @@ private: void opVnni(const Xmm& x1, const Xmm& x2, const Operand& op, int type, int code0, PreferredEncoding encoding) { if (encoding == DefaultEncoding) { -#ifdef XBYAK_DISABLE_AVX512 - encoding = VexEncoding; -#else encoding = EvexEncoding; -#endif } +#ifdef XBYAK_DISABLE_AVX512 + if (encoding == EvexEncoding) XBYAK_THROW(ERR_EVEX_IS_INVALID) +#endif if (encoding == EvexEncoding) { type |= T_MUST_EVEX; }