summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/interpreter/mterp/riscv64/array.S8
-rw-r--r--runtime/interpreter/mterp/riscv64/object.S16
2 files changed, 18 insertions, 6 deletions
diff --git a/runtime/interpreter/mterp/riscv64/array.S b/runtime/interpreter/mterp/riscv64/array.S
index d880c12142..80bb535fd8 100644
--- a/runtime/interpreter/mterp/riscv64/array.S
+++ b/runtime/interpreter/mterp/riscv64/array.S
@@ -113,9 +113,11 @@
% elif width == "32":
sh2add t0, t1, t0
lw t0, MIRROR_INT_ARRAY_DATA_OFFSET(t0)
-% else: # width = 64:
+% elif width == "64":
sh3add t0, t1, t0
ld t0, MIRROR_WIDE_ARRAY_DATA_OFFSET(t0)
+% else:
+% assert False, width
%#:
// t0 := *(array obj + data offset + idx * elem_size)
srliw t1, xINST, 8 // t1 := AA
@@ -218,9 +220,11 @@
% elif width == "32":
sh2add t0, t1, t0
sw t2, MIRROR_INT_ARRAY_DATA_OFFSET(t0)
-% else: # width = 64:
+% elif width == "64":
sh3add t0, t1, t0
sd t2, MIRROR_WIDE_ARRAY_DATA_OFFSET(t0)
+% else:
+% assert False, width
%#:
FETCH_ADVANCE_INST 2
GET_INST_OPCODE t0
diff --git a/runtime/interpreter/mterp/riscv64/object.S b/runtime/interpreter/mterp/riscv64/object.S
index 73e5abbe5a..ce1560febf 100644
--- a/runtime/interpreter/mterp/riscv64/object.S
+++ b/runtime/interpreter/mterp/riscv64/object.S
@@ -26,8 +26,10 @@
lh $dst, ($src)
% elif width == "32":
lw $dst, ($src)
-% else: # width = 64:
+% elif width == "64":
ld $dst, ($src)
+% else:
+% assert False, width
%#:
@@ -38,8 +40,10 @@
sh $src, ($dst)
% elif width == "32":
sw $src, ($dst)
-% else: # width 64:
+% elif width == "64":
sd $src, ($dst)
+% else:
+% assert False, width
%#:
@@ -259,8 +263,10 @@
fence rw, rw
% elif width == "32":
amoswap.w.rl zero, $value, ($z0)
-% else: # width == 64:
+% elif width == "64":
amoswap.d.rl zero, $value, ($z0)
+% else:
+% assert False, width
%#:
FETCH_ADVANCE_INST 2
@@ -612,8 +618,10 @@
fence rw, rw
% elif width == "32":
amoswap.w.rl zero, $value, ($z0)
-% else: # width == 64:
+% elif width == "64":
amoswap.d.rl zero, $value, ($z0)
+% else:
+% assert False, width
%#:
FETCH_ADVANCE_INST 2