default encoding is always evex
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 @@
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()
@@ -831,6 +833,7 @@
} c;
const uint8_t tbl[] = {
0x62, 0xF2, 0x75, 0x08, 0x50, 0xC2,
+ 0x62, 0xF2, 0x75, 0x08, 0x50, 0xC2,
0xC4, 0xE2, 0x71, 0x50, 0xC2,
};
const size_t n = sizeof(tbl) / sizeof(tbl[0]);
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 @@
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;
}