[MIPS] Fix a mips64 mterp bug.
The bug was causing adb install to get a java exception for Mips64.
Change-Id: Ia1b9f11a5896e4018db80fc68381adfedf9e7c00
diff --git a/runtime/interpreter/mterp/mips64/footer.S b/runtime/interpreter/mterp/mips64/footer.S
index 9994169..4063162 100644
--- a/runtime/interpreter/mterp/mips64/footer.S
+++ b/runtime/interpreter/mterp/mips64/footer.S
@@ -217,7 +217,8 @@
b MterpDone
/*
* Returned value is expected in a0 and if it's not 64-bit, the 32 most
- * significant bits of a0 must be 0.
+ * significant bits of a0 must be zero-extended or sign-extended
+ * depending on the return type.
*/
MterpReturn:
ld a2, OFF_FP_RESULT_REGISTER(rFP)
diff --git a/runtime/interpreter/mterp/mips64/op_return.S b/runtime/interpreter/mterp/mips64/op_return.S
index ec986b8..b10c03f 100644
--- a/runtime/interpreter/mterp/mips64/op_return.S
+++ b/runtime/interpreter/mterp/mips64/op_return.S
@@ -1,7 +1,8 @@
+%default {"instr":"GET_VREG"}
/*
* Return a 32-bit value.
*
- * for: return, return-object
+ * for: return (sign-extend), return-object (zero-extend)
*/
/* op vAA */
.extern MterpThreadFenceForConstructor
@@ -14,5 +15,5 @@
jal MterpSuspendCheck # (self)
1:
srl a2, rINST, 8 # a2 <- AA
- GET_VREG_U a0, a2 # a0 <- vAA
+ $instr a0, a2 # a0 <- vAA
b MterpReturn
diff --git a/runtime/interpreter/mterp/mips64/op_return_object.S b/runtime/interpreter/mterp/mips64/op_return_object.S
index 67f1871..b69b880 100644
--- a/runtime/interpreter/mterp/mips64/op_return_object.S
+++ b/runtime/interpreter/mterp/mips64/op_return_object.S
@@ -1 +1 @@
-%include "mips64/op_return.S"
+%include "mips64/op_return.S" {"instr":"GET_VREG_U"}
diff --git a/runtime/interpreter/mterp/out/mterp_mips64.S b/runtime/interpreter/mterp/out/mterp_mips64.S
index a061f1e..88e972f 100644
--- a/runtime/interpreter/mterp/out/mterp_mips64.S
+++ b/runtime/interpreter/mterp/out/mterp_mips64.S
@@ -651,7 +651,7 @@
/*
* Return a 32-bit value.
*
- * for: return, return-object
+ * for: return (sign-extend), return-object (zero-extend)
*/
/* op vAA */
.extern MterpThreadFenceForConstructor
@@ -664,7 +664,7 @@
jal MterpSuspendCheck # (self)
1:
srl a2, rINST, 8 # a2 <- AA
- GET_VREG_U a0, a2 # a0 <- vAA
+ GET_VREG a0, a2 # a0 <- vAA
b MterpReturn
/* ------------------------------ */
@@ -697,7 +697,7 @@
/*
* Return a 32-bit value.
*
- * for: return, return-object
+ * for: return (sign-extend), return-object (zero-extend)
*/
/* op vAA */
.extern MterpThreadFenceForConstructor
@@ -710,7 +710,7 @@
jal MterpSuspendCheck # (self)
1:
srl a2, rINST, 8 # a2 <- AA
- GET_VREG_U a0, a2 # a0 <- vAA
+ GET_VREG_U a0, a2 # a0 <- vAA
b MterpReturn
@@ -12298,7 +12298,8 @@
b MterpDone
/*
* Returned value is expected in a0 and if it's not 64-bit, the 32 most
- * significant bits of a0 must be 0.
+ * significant bits of a0 must be zero-extended or sign-extended
+ * depending on the return type.
*/
MterpReturn:
ld a2, OFF_FP_RESULT_REGISTER(rFP)