Skip to content

Commit

Permalink
Addressing review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepakRajendrakumaran committed Jan 24, 2025
1 parent 59ccb3e commit a479046
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/coreclr/jit/emitxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1896,13 +1896,13 @@ bool emitter::HasMaskReg(const instrDesc* id) const
regNumber AbsRegNumber(regNumber reg)
{
assert(reg < REG_STK);
if ((reg >= XMMBASE) && (reg < KBASE))
if (reg >= KBASE)
{
reg = (regNumber)(reg - XMMBASE);
return (regNumber)(reg - KBASE);
}
else if (reg >= KBASE)
else if (reg >= XMMBASE)
{
reg = (regNumber)(reg - KBASE);
return (regNumber)(reg - XMMBASE);
}
return reg;
}
Expand Down Expand Up @@ -4461,7 +4461,7 @@ inline UNATIVE_OFFSET emitter::emitInsSizeSV(instrDesc* id, code_t code, int var
static bool baseRegisterRequiresSibByte(regNumber base)
{
#ifdef TARGET_AMD64
return base == REG_ESP || base == REG_R12 || base == REG_R20 /*|| base == REG_R28*/;
return base == REG_ESP || base == REG_R12 || base == REG_R20;
#else
return base == REG_ESP;
#endif
Expand All @@ -4470,7 +4470,7 @@ static bool baseRegisterRequiresSibByte(regNumber base)
static bool baseRegisterRequiresDisplacement(regNumber base)
{
#ifdef TARGET_AMD64
return base == REG_EBP || base == REG_R13 || base == REG_R21 /*|| base == REG_R29*/;
return base == REG_EBP || base == REG_R13 || base == REG_R21;
#else
return base == REG_EBP;
#endif
Expand Down
12 changes: 10 additions & 2 deletions src/coreclr/jit/lsraxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3115,8 +3115,7 @@ int LinearScan::BuildIndir(GenTreeIndir* indirTree)
#endif
{
GenTree* data = indirTree->Data();
if (data->isContained() && (data->OperIs(GT_BSWAP, GT_BSWAP16) /* || data->OperIsHWIntrinsic()*/) &&
(int)varTypeUsesIntReg(source))
if (data->isContained() && (data->OperIs(GT_BSWAP, GT_BSWAP16)) && (int)varTypeUsesIntReg(source))
{
/// movbe cannot use eGPR
srcCount += BuildOperandUses(source, BuildApxIncompatibleGPRMask(source, RBM_NONE, true));
Expand Down Expand Up @@ -3306,6 +3305,15 @@ inline SingleTypeRegSet LinearScan::BuildEvexIncompatibleMask(GenTree* tree)
#endif
}

//------------------------------------------------------------------------------
// DoesThisUseGPR: Tries to determine if this node needs a GPR.
//
// Arguments:
// op - the GenTree node to check
//
// Return Value:
// true if certain that GPR is necessary.
//
inline bool LinearScan::DoesThisUseGPR(GenTree* op)
{
if (varTypeUsesIntReg(op->gtType))
Expand Down

0 comments on commit a479046

Please sign in to comment.