fixed compilation with avx but without EVEX

This commit is contained in:
Stanislav Shwartsman 2020-02-20 05:29:13 +00:00
parent 9eb1cf233c
commit 086f2779f5

View File

@ -1739,22 +1739,25 @@ BxDecodeError assign_srcs(bxInstruction_c *i, unsigned ia_opcode, bx_bool is_64,
break; break;
case BX_SRC_NNN: case BX_SRC_NNN:
i->setSrcReg(n, nnn); i->setSrcReg(n, nnn);
#if BX_SUPPORT_EVEX
if (type == BX_KMASK_REG) { if (type == BX_KMASK_REG) {
if (nnn >= 8) return BX_EVEX_ILLEGAL_KMASK_REGISTER; if (nnn >= 8) return BX_EVEX_ILLEGAL_KMASK_REGISTER;
// vector instruction using opmask as source or dest // vector instruction using opmask as source or dest
if (i->isZeroMasking()) if (i->isZeroMasking())
return BX_EVEX_ILLEGAL_ZERO_MASKING_WITH_KMASK_SRC_OR_DEST; return BX_EVEX_ILLEGAL_ZERO_MASKING_WITH_KMASK_SRC_OR_DEST;
} }
#endif
break; break;
case BX_SRC_RM: case BX_SRC_RM:
if (i->modC0()) { if (i->modC0()) {
#if BX_SUPPORT_EVEX
if (type == BX_KMASK_REG) { if (type == BX_KMASK_REG) {
rm &= 0x7; rm &= 0x7;
// vector instruction using opmask as source or dest // vector instruction using opmask as source or dest
if (i->isZeroMasking()) if (i->isZeroMasking())
return BX_EVEX_ILLEGAL_ZERO_MASKING_WITH_KMASK_SRC_OR_DEST; return BX_EVEX_ILLEGAL_ZERO_MASKING_WITH_KMASK_SRC_OR_DEST;
} }
#endif
i->setSrcReg(n, rm); i->setSrcReg(n, rm);
} }
else { else {
@ -1780,12 +1783,14 @@ BxDecodeError assign_srcs(bxInstruction_c *i, unsigned ia_opcode, bx_bool is_64,
case BX_SRC_VVV: case BX_SRC_VVV:
i->setSrcReg(n, vvv); i->setSrcReg(n, vvv);
use_vvv = true; use_vvv = true;
#if BX_SUPPORT_EVEX
if (type == BX_KMASK_REG) { if (type == BX_KMASK_REG) {
if (vvv >= 8) return BX_EVEX_ILLEGAL_KMASK_REGISTER; if (vvv >= 8) return BX_EVEX_ILLEGAL_KMASK_REGISTER;
// vector instruction using opmask as source or dest // vector instruction using opmask as source or dest
if (i->isZeroMasking()) if (i->isZeroMasking())
return BX_EVEX_ILLEGAL_ZERO_MASKING_WITH_KMASK_SRC_OR_DEST; return BX_EVEX_ILLEGAL_ZERO_MASKING_WITH_KMASK_SRC_OR_DEST;
} }
#endif
break; break;
case BX_SRC_VIB: case BX_SRC_VIB:
if (is_64) { if (is_64) {