Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
formatting
  • Loading branch information
EgorBo committed Sep 3, 2020
commit b85c87bcb3e6bac0faeb6016683ed26d334c2f78
6 changes: 4 additions & 2 deletions src/coreclr/src/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4085,8 +4085,10 @@ void CodeGen::genCodeForShift(GenTree* tree)
{
int typeWidth = genTypeSize(genActualType(targetType)) * 8;
int shiftByValue = (int)shiftBy->AsIntConCommon()->IconValue();
if (compiler->compOpportunisticallyDependsOn(InstructionSet_BMI2) && tree->OperIs(GT_ROL) && (shiftByValue > 0) &&
(shiftByValue < typeWidth))

// Try to emit rorx if BMI is available instead of rol
if (compiler->compOpportunisticallyDependsOn(InstructionSet_BMI2) && tree->OperIs(GT_ROL) &&
(shiftByValue > 0) && (shiftByValue < typeWidth))
{
assert((typeWidth == 32) || (typeWidth == 64));

Expand Down