summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2018-08-31 07:02:02 +0100
committer David Srbecky <dsrbecky@google.com> 2018-08-31 07:37:03 +0100
commitb8e5ad19e064611df15998d8d12cd7e804ccdfd4 (patch)
tree98ad9feeff53686af61f8e94895ffbc5e06953ed
parent4a25727eba333c19dc6eacc35950c526c11041d4 (diff)
Fix interpreter intrinsic for rotate left/right.
Test: test.py --host -b -r -t 015-checker-rotate Change-Id: I0112aa026c565f0788ff6e926189d10db7d3ad44
-rw-r--r--runtime/interpreter/interpreter_intrinsics.cc4
-rw-r--r--runtime/interpreter/shadow_frame.h8
2 files changed, 6 insertions, 6 deletions
diff --git a/runtime/interpreter/interpreter_intrinsics.cc b/runtime/interpreter/interpreter_intrinsics.cc
index 69dae31b37..17b3cd45aa 100644
--- a/runtime/interpreter/interpreter_intrinsics.cc
+++ b/runtime/interpreter/interpreter_intrinsics.cc
@@ -116,10 +116,10 @@ UNARY_INTRINSIC(MterpLongNumberOfLeadingZeros, JAVASTYLE_CLZ, GetVRegLong, SetJ)
UNARY_INTRINSIC(MterpLongNumberOfTrailingZeros, JAVASTYLE_CTZ, GetVRegLong, SetJ);
// java.lang.Long.rotateRight(JI)J
-BINARY_JJ_INTRINSIC(MterpLongRotateRight, (Rot<int64_t, false>), SetJ);
+BINARY_JI_INTRINSIC(MterpLongRotateRight, (Rot<int64_t, false>), SetJ);
// java.lang.Long.rotateLeft(JI)J
-BINARY_JJ_INTRINSIC(MterpLongRotateLeft, (Rot<int64_t, true>), SetJ);
+BINARY_JI_INTRINSIC(MterpLongRotateLeft, (Rot<int64_t, true>), SetJ);
// java.lang.Long.signum(J)I
UNARY_INTRINSIC(MterpLongSignum, Signum, GetVRegLong, SetI);
diff --git a/runtime/interpreter/shadow_frame.h b/runtime/interpreter/shadow_frame.h
index f76b86c94f..0e4cf27e50 100644
--- a/runtime/interpreter/shadow_frame.h
+++ b/runtime/interpreter/shadow_frame.h
@@ -159,14 +159,14 @@ class ShadowFrame {
}
int64_t GetVRegLong(size_t i) const {
- DCHECK_LT(i, NumberOfVRegs());
+ DCHECK_LT(i + 1, NumberOfVRegs());
const uint32_t* vreg = &vregs_[i];
typedef const int64_t unaligned_int64 __attribute__ ((aligned (4)));
return *reinterpret_cast<unaligned_int64*>(vreg);
}
double GetVRegDouble(size_t i) const {
- DCHECK_LT(i, NumberOfVRegs());
+ DCHECK_LT(i + 1, NumberOfVRegs());
const uint32_t* vreg = &vregs_[i];
typedef const double unaligned_double __attribute__ ((aligned (4)));
return *reinterpret_cast<unaligned_double*>(vreg);
@@ -220,7 +220,7 @@ class ShadowFrame {
}
void SetVRegLong(size_t i, int64_t val) {
- DCHECK_LT(i, NumberOfVRegs());
+ DCHECK_LT(i + 1, NumberOfVRegs());
uint32_t* vreg = &vregs_[i];
typedef int64_t unaligned_int64 __attribute__ ((aligned (4)));
*reinterpret_cast<unaligned_int64*>(vreg) = val;
@@ -233,7 +233,7 @@ class ShadowFrame {
}
void SetVRegDouble(size_t i, double val) {
- DCHECK_LT(i, NumberOfVRegs());
+ DCHECK_LT(i + 1, NumberOfVRegs());
uint32_t* vreg = &vregs_[i];
typedef double unaligned_double __attribute__ ((aligned (4)));
*reinterpret_cast<unaligned_double*>(vreg) = val;