blob: b53921761ae614eedb5beee23e88f8836ac6b4d0 [file] [edit]
--- a/core/iwasm/interpreter/wasm_interp_fast.c
+++ b/core/iwasm/interpreter/wasm_interp_fast.c
@@ -1002,7 +1002,8 @@
uint32 buf[16] = { 0 }, i;
uint32 *tmp_buf = buf;
uint8 cell;
- int16 src, buf_index = 0;
+ /* j is signed like src, which is negative for constants */
+ int16 src, buf_index = 0, j;
uint16 dst;
#if WASM_ENABLE_GC != 0
uint8 ref_buf[4];
@@ -1034,21 +1035,11 @@
for (i = 0; i < arity; i++) {
cell = cells[i * CELL_SIZE];
src = src_offsets[i];
- if (cell == 1) {
- tmp_buf[buf_index] = frame_lp[src];
+ for (j = 0; j < cell; j++) {
+ tmp_buf[buf_index + j] = frame_lp[src + j];
#if WASM_ENABLE_GC != 0
- tmp_ref_buf[buf_index] = frame_ref[src];
- frame_ref[src] = 0;
-#endif
- }
- else {
- tmp_buf[buf_index] = frame_lp[src];
- tmp_buf[buf_index + 1] = frame_lp[src + 1];
-#if WASM_ENABLE_GC != 0
- tmp_ref_buf[buf_index] = frame_ref[src];
- tmp_ref_buf[buf_index + 1] = frame_ref[src + 1];
- frame_ref[src] = 0;
- frame_ref[src + 1] = 0;
+ tmp_ref_buf[buf_index + j] = frame_ref[src + j];
+ frame_ref[src + j] = 0;
#endif
}
buf_index += cell;
@@ -1059,18 +1050,10 @@
for (i = 0; i < arity; i++) {
cell = cells[i * CELL_SIZE];
dst = dst_offsets[i];
- if (cell == 1) {
- frame_lp[dst] = tmp_buf[buf_index];
-#if WASM_ENABLE_GC != 0
- frame_ref[dst] = tmp_ref_buf[buf_index];
-#endif
- }
- else {
- frame_lp[dst] = tmp_buf[buf_index];
- frame_lp[dst + 1] = tmp_buf[buf_index + 1];
+ for (j = 0; j < cell; j++) {
+ frame_lp[dst + j] = tmp_buf[buf_index + j];
#if WASM_ENABLE_GC != 0
- frame_ref[dst] = tmp_ref_buf[buf_index];
- frame_ref[dst + 1] = tmp_ref_buf[buf_index + 1];
+ frame_ref[dst + j] = tmp_ref_buf[buf_index + j];
#endif
}
buf_index += cell;
@@ -5707,6 +5690,14 @@
PUT_I64_TO_ADDR((uint32 *)(frame_lp + local_offset),
GET_I64_FROM_ADDR(frame_lp + addr1));
}
+#if WASM_ENABLE_SIMDE != 0
+ /* rive patch: the loader only emits the fast v128 forms for
+ locals below cell 256, the rest land here */
+ else if (local_type == VALUE_TYPE_V128) {
+ PUT_V128_TO_ADDR((uint32 *)(frame_lp + local_offset),
+ GET_V128_FROM_ADDR(frame_lp + addr1));
+ }
+#endif
#if WASM_ENABLE_GC != 0
else if (wasm_is_type_reftype(local_type)) {
PUT_REF_TO_ADDR((uint32 *)(frame_lp + local_offset),