summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r--compiler/optimizing/instruction_builder.cc19
1 files changed, 13 insertions, 6 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index 55e3267427..f3676bbc02 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -1953,16 +1953,14 @@ bool HInstructionBuilder::BuildSimpleIntrinsic(ArtMethod* method,
ReceiverArg receiver_arg = method->IsStatic() ? ReceiverArg::kNone : ReceiverArg::kNullCheckedArg;
HInstruction* instruction = nullptr;
switch (intrinsic) {
- case Intrinsics::kIntegerRotateLeft:
- instruction = new (allocator_) HRol(kInt32, /*value=*/ nullptr, /*distance=*/ nullptr);
- break;
case Intrinsics::kIntegerRotateRight:
+ case Intrinsics::kIntegerRotateLeft:
+ // For rotate left, we negate the distance below.
instruction = new (allocator_) HRor(kInt32, /*value=*/ nullptr, /*distance=*/ nullptr);
break;
- case Intrinsics::kLongRotateLeft:
- instruction = new (allocator_) HRol(kInt64, /*value=*/ nullptr, /*distance=*/ nullptr);
- break;
case Intrinsics::kLongRotateRight:
+ case Intrinsics::kLongRotateLeft:
+ // For rotate left, we negate the distance below.
instruction = new (allocator_) HRor(kInt64, /*value=*/ nullptr, /*distance=*/ nullptr);
break;
case Intrinsics::kIntegerCompare:
@@ -2081,6 +2079,15 @@ bool HInstructionBuilder::BuildSimpleIntrinsic(ArtMethod* method,
}
switch (intrinsic) {
+ case Intrinsics::kIntegerRotateLeft:
+ case Intrinsics::kLongRotateLeft: {
+ // Negate the distance value for rotate left.
+ DCHECK(instruction->IsRor());
+ HNeg* neg = new (allocator_) HNeg(kInt32, instruction->InputAt(1u));
+ AppendInstruction(neg);
+ instruction->SetRawInputAt(1u, neg);
+ break;
+ }
case Intrinsics::kFloatIsNaN:
case Intrinsics::kDoubleIsNaN:
// Set the second input to be the same as first.