[Bug] Fixed VPERMQ incorrectly reporting AVX2 instead of AVX512-F features (X86 features API)

This commit is contained in:
kobalicek
2021-02-09 02:41:57 +01:00
parent 2ab380e0bd
commit 5a5fb8af4c

View File

@@ -1607,11 +1607,15 @@ Error InstInternal::queryFeatures(uint32_t arch, const BaseInst& inst, const Ope
mustUseEvex = opCount >= 2 && x86::Reg::isGp(operands[1]); mustUseEvex = opCount >= 2 && x86::Reg::isGp(operands[1]);
break; break;
// Special case: VPERMPD only supports YMM predicate in AVX mode, immediate // Special case: VPERMPD - AVX2 vs AVX512-F case.
// precicate is only supported by AVX512-F and newer.
case Inst::kIdVpermpd: case Inst::kIdVpermpd:
mustUseEvex = opCount >= 3 && !operands[2].isImm(); mustUseEvex = opCount >= 3 && !operands[2].isImm();
break; break;
// Special case: VPERMQ - AVX2 vs AVX512-F case.
case Inst::kIdVpermq:
mustUseEvex = opCount >= 3 && (operands[1].isMem() || !operands[2].isImm());
break;
} }
if (!(usesAvx512 | mustUseEvex | regAnalysis.highVecUsed)) if (!(usesAvx512 | mustUseEvex | regAnalysis.highVecUsed))