Skip to content

Commit 04bdc1b

Browse files
Change check
1 parent 48e9522 commit 04bdc1b

File tree

4 files changed

+12
-34
lines changed

4 files changed

+12
-34
lines changed

src/coreclr/jit/emit.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3782,6 +3782,12 @@ const IS_INFO emitter::emitGetSchedInfo(insFormat insFmt)
37823782
assert(!"Unsupported insFmt");
37833783
return IS_NONE;
37843784
}
3785+
3786+
bool emitter::HasApxPpx(instruction ins)
3787+
{
3788+
insFlags flags = CodeGenInterface::instInfo[ins];
3789+
return (flags & INS_Flags_Has_PPX) != 0;
3790+
}
37853791
#endif // TARGET_XARCH
37863792

37873793
//------------------------------------------------------------------------

src/coreclr/jit/emit.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1795,7 +1795,7 @@ class emitter
17951795

17961796
bool idIsEvexNfContextSet() const
17971797
{
1798-
return _idEvexNfContext != 0;
1798+
return (_idEvexNfContext != 0) && !(HasApxPpx(_idIns));
17991799
}
18001800

18011801
void idSetEvexNfContext()
@@ -2394,6 +2394,7 @@ class emitter
23942394
int emitGetInsCDinfo(instrDesc* id);
23952395

23962396
static const IS_INFO emitGetSchedInfo(insFormat f);
2397+
static bool HasApxPpx(instruction ins);
23972398
#endif // TARGET_XARCH
23982399

23992400
cnsval_ssize_t emitGetInsSC(const instrDesc* id) const;

src/coreclr/jit/emitxarch.cpp

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,6 @@ bool emitter::HasApxNf(instruction ins)
256256
return (flags & INS_Flags_Has_NF) != 0;
257257
}
258258

259-
bool emitter::HasApxPpx(instruction ins)
260-
{
261-
insFlags flags = CodeGenInterface::instInfo[ins];
262-
return (flags & INS_Flags_Has_PPX) != 0;
263-
}
264-
265259
bool emitter::IsVexEncodableInstruction(instruction ins) const
266260
{
267261
if (!UseVEXEncoding())
@@ -414,27 +408,6 @@ bool emitter::IsApxNFEncodableInstruction(instruction ins) const
414408
return HasApxNf(ins);
415409
}
416410

417-
//------------------------------------------------------------------------
418-
// IsApxNFToBeSet: is idIsEvexNfContextSet() true for this instruction and not a PPX instruction.
419-
//
420-
// Arguments:
421-
// id - The instruction descriptor to check.
422-
//
423-
// Returns:
424-
// `true` if ins is EVEX.NF flag is to be set.
425-
//
426-
bool emitter::IsApxNFToBeSet(const instrDesc* id) const
427-
{
428-
#ifdef TARGET_AMD64
429-
if (id->idIsEvexNfContextSet() && !HasApxPpx(id->idIns()))
430-
{
431-
return true;
432-
}
433-
#endif
434-
435-
return false;
436-
}
437-
438411
//------------------------------------------------------------------------
439412
// IsApxExtendedEvexInstruction: Answer the question - does this instruction have apx extended evex form.
440413
//
@@ -1842,7 +1815,7 @@ bool emitter::TakesEvexPrefix(const instrDesc* id) const
18421815
return true;
18431816
}
18441817

1845-
if (IsApxNFToBeSet(id) && IsBMIInstruction(ins))
1818+
if (id->idIsEvexNfContextSet() && IsBMIInstruction(ins))
18461819
{
18471820
// Only a few BMI instructions shall be promoted to APX-EVEX due to NF feature.
18481821
// TODO-XArch-APX: convert the check into forms like Has* as above.
@@ -2003,7 +1976,7 @@ bool emitter::TakesApxExtendedEvexPrefix(const instrDesc* id) const
20031976
return true;
20041977
}
20051978

2006-
if (IsApxNFToBeSet(id))
1979+
if (id->idIsEvexNfContextSet())
20071980
{
20081981
return true;
20091982
}
@@ -2121,7 +2094,7 @@ emitter::code_t emitter::AddEvexPrefix(const instrDesc* id, code_t code, emitAtt
21212094
code |= ND_BIT_IN_BYTE_EVEX_PREFIX;
21222095
}
21232096

2124-
if (IsApxNFToBeSet(id))
2097+
if (id->idIsEvexNfContextSet())
21252098
{
21262099
code |= NF_BIT_IN_BYTE_EVEX_PREFIX;
21272100
}
@@ -12694,7 +12667,7 @@ void emitter::emitDispIns(
1269412667
/* Display the instruction name */
1269512668

1269612669
#ifdef TARGET_AMD64
12697-
if (IsApxNFEncodableInstruction(id->idIns()) && IsApxNFToBeSet(id))
12670+
if (IsApxNFEncodableInstruction(id->idIns()) && id->idIsEvexNfContextSet())
1269812671
{
1269912672
// print the EVEX.NF indication in psudeo prefix style.
1270012673
printf("{nf} ");

src/coreclr/jit/emitxarch.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,11 @@ static regNumber getSseShiftRegNumber(instruction ins);
132132
static bool HasRex2Encoding(instruction ins);
133133
static bool HasApxNdd(instruction ins);
134134
static bool HasApxNf(instruction ins);
135-
static bool HasApxPpx(instruction ins);
136135
bool IsVexEncodableInstruction(instruction ins) const;
137136
bool IsEvexEncodableInstruction(instruction ins) const;
138137
bool IsRex2EncodableInstruction(instruction ins) const;
139138
bool IsApxNDDEncodableInstruction(instruction ins) const;
140139
bool IsApxNFEncodableInstruction(instruction ins) const;
141-
bool IsApxNFToBeSet(const instrDesc* id) const;
142140
bool IsApxExtendedEvexInstruction(instruction ins) const;
143141
bool IsShiftInstruction(instruction ins) const;
144142
bool IsLegacyMap1(code_t code) const;

0 commit comments

Comments
 (0)