Skip to content

Commit 5453487

Browse files
committed
Ensure canUseVexEncoding is true when ForceEVEXEncoding is set
1 parent f3fe4f8 commit 5453487

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/coreclr/jit/compiler.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9197,6 +9197,13 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
91979197
#ifdef TARGET_XARCH
91989198
bool canUseVexEncoding() const
91999199
{
9200+
#ifdef DEBUG
9201+
if (JitConfig.JitForceEVEXEncoding())
9202+
{
9203+
return true;
9204+
}
9205+
#endif // DEBUG
9206+
92009207
return compOpportunisticallyDependsOn(InstructionSet_AVX);
92019208
}
92029209

src/coreclr/jit/emitxarch.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,23 +1033,27 @@ bool emitter::TakesSimdPrefix(const instrDesc* id) const
10331033
//
10341034
bool emitter::TakesEvexPrefix(const instrDesc* id) const
10351035
{
1036-
if (!emitComp->DoJitStressEvexEncoding())
1036+
instruction ins = id->idIns();
1037+
1038+
if (!IsEvexEncodedInstruction(ins))
10371039
{
10381040
return false;
10391041
}
10401042

1041-
instruction ins = id->idIns();
1043+
if (!emitComp->DoJitStressEvexEncoding())
1044+
{
1045+
return false;
1046+
}
10421047

10431048
if (HasHighSIMDReg(id))
10441049
{
1045-
assert(IsEvexEncodedInstruction(ins));
10461050
// TODO-XARCH-AVX512 remove this check once k registers have been implemented
10471051
assert(!HasKMaskRegisterDest(ins));
10481052
return true;
10491053
}
10501054

10511055
// TODO-XArch-AVX512: Revisit 'HasKMaskRegisterDest()' check once KMask support is added.
1052-
return IsEvexEncodedInstruction(ins) && !HasKMaskRegisterDest(ins);
1056+
return !HasKMaskRegisterDest(ins);
10531057
}
10541058

10551059
// Intel AVX-512 encoding is defined in "Intel 64 and ia-32 architectures software developer's manual volume 2", Section

0 commit comments

Comments
 (0)