Skip to content

Commit de1d635

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 ea7ac26 commit de1d635

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
@@ -6572,12 +6572,10 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
65726572
HANDLE_OP(WASM_OP_CATCH_ALL)
65736573
HANDLE_OP(EXT_OP_TRY)
65746574
#endif
6575-
#if WASM_ENABLE_JIT != 0 && WASM_ENABLE_SIMD != 0
65766575
/* SIMD isn't supported by interpreter, but when JIT is
65776576
enabled, `iwasm --interp <wasm_file>` may be run to
65786577
trigger the SIMD opcode in interpreter */
65796578
HANDLE_OP(WASM_OP_SIMD_PREFIX)
6580-
#endif
65816579
HANDLE_OP(WASM_OP_UNUSED_0x16)
65826580
HANDLE_OP(WASM_OP_UNUSED_0x17)
65836581
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
@@ -1770,6 +1770,22 @@
17701770
"stdout content": "Exception: unreachable",
17711771
"description": "no 'frame offset overflow'"
17721772
}
1773+
},
1774+
{
1775+
"deprecated": false,
1776+
"ids": [
1777+
980001
1778+
],
1779+
"runtime": "iwasm-llvm-jit",
1780+
"file": "v128.wasm",
1781+
"mode": "classic-interp",
1782+
"options": "-f main",
1783+
"argument": "",
1784+
"expected return": {
1785+
"ret code": 1,
1786+
"stdout content": "Exception: unsupported opcode",
1787+
"description": "classic-interp will exit gracefully when meeting simd opcodes"
1788+
}
17731789
}
17741790
]
17751791
}

0 commit comments

Comments
 (0)