Skip to content

Commit 071e2aa

Browse files
authored
Merge commit from fork
* fix: remove SIMD prefix handling from interpreter and update opcode definitions * test: add case for classic interpreter handling of unsupported SIMD opcodes
1 parent 33fdc4a commit 071e2aa

File tree

5 files changed

+30
-10
lines changed

5 files changed

+30
-10
lines changed

core/iwasm/interpreter/wasm_interp_classic.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6580,12 +6580,10 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
65806580
HANDLE_OP(WASM_OP_CATCH_ALL)
65816581
HANDLE_OP(EXT_OP_TRY)
65826582
#endif
6583-
#if WASM_ENABLE_JIT != 0 && WASM_ENABLE_SIMD != 0
65846583
/* SIMD isn't supported by interpreter, but when JIT is
65856584
enabled, `iwasm --interp <wasm_file>` may be run to
65866585
trigger the SIMD opcode in interpreter */
65876586
HANDLE_OP(WASM_OP_SIMD_PREFIX)
6588-
#endif
65896587
HANDLE_OP(WASM_OP_UNUSED_0x16)
65906588
HANDLE_OP(WASM_OP_UNUSED_0x17)
65916589
HANDLE_OP(WASM_OP_UNUSED_0x27)

core/iwasm/interpreter/wasm_opcode.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -790,13 +790,6 @@ typedef enum WASMAtomicEXTOpcode {
790790
#endif
791791
#define SET_GOTO_TABLE_ELEM(opcode) [opcode] = HANDLE_OPCODE(opcode)
792792

793-
#if WASM_ENABLE_SIMDE != 0
794-
#define SET_GOTO_TABLE_SIMD_PREFIX_ELEM() \
795-
SET_GOTO_TABLE_ELEM(WASM_OP_SIMD_PREFIX),
796-
#else
797-
#define SET_GOTO_TABLE_SIMD_PREFIX_ELEM()
798-
#endif
799-
800793
#if WASM_ENABLE_SIMDE != 0
801794
#define DEF_EXT_V128_HANDLE() \
802795
SET_GOTO_TABLE_ELEM(EXT_OP_SET_LOCAL_FAST_V128), /* 0xdd */ \
@@ -1038,7 +1031,7 @@ typedef enum WASMAtomicEXTOpcode {
10381031
HANDLE_OPCODE(EXT_OP_TRY), /* 0xdb */ \
10391032
SET_GOTO_TABLE_ELEM(WASM_OP_GC_PREFIX), /* 0xfb */ \
10401033
SET_GOTO_TABLE_ELEM(WASM_OP_MISC_PREFIX), /* 0xfc */ \
1041-
SET_GOTO_TABLE_SIMD_PREFIX_ELEM() /* 0xfd */ \
1034+
SET_GOTO_TABLE_ELEM(WASM_OP_SIMD_PREFIX), /* 0xfd */ \
10421035
SET_GOTO_TABLE_ELEM(WASM_OP_ATOMIC_PREFIX), /* 0xfe */ \
10431036
DEF_DEBUG_BREAK_HANDLE() DEF_EXT_V128_HANDLE() \
10441037
};
91 Bytes
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
(module
2+
(type (;0;) (func))
3+
(func (;0;) (type 0)
4+
i32.const 0
5+
i32.const 16
6+
v128.load
7+
i32.const 32
8+
v128.load
9+
i64x2.eq
10+
v128.store)
11+
(memory (;0;) 1 1)
12+
(export "mem" (memory 0))
13+
(export "main" (func 0)))

tests/regression/ba-issues/running_config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,6 +1802,22 @@
18021802
"stdout content": "Exception: unreachable",
18031803
"description": "no 'frame offset overflow'"
18041804
}
1805+
},
1806+
{
1807+
"deprecated": false,
1808+
"ids": [
1809+
980001
1810+
],
1811+
"runtime": "iwasm-llvm-jit",
1812+
"file": "v128.wasm",
1813+
"mode": "classic-interp",
1814+
"options": "-f main",
1815+
"argument": "",
1816+
"expected return": {
1817+
"ret code": 1,
1818+
"stdout content": "Exception: unsupported opcode",
1819+
"description": "classic-interp will exit gracefully when meeting simd opcodes"
1820+
}
18051821
}
18061822
]
18071823
}

0 commit comments

Comments
 (0)