wasmer-python icon indicating copy to clipboard operation
wasmer-python copied to clipboard

How to support simd instructions in wasmer-python?

Open orangeC23 opened this issue 1 year ago • 0 comments

Summary

How to support simd instructions in wasmer-python?

Additional details

import os

from wasmer import engine, wat2wasm, Store, Module, Instance
from wasmer_compiler_llvm import Compiler

engine = engine.Universal(Compiler)

store = Store(engine)

__dir__ = os.path.dirname(os.path.realpath(__file__))
module = Module(Store(), open(__dir__ + '/tmp.wasm', 'rb').read())

instance = Instance(module)

func1 = instance.exports.x
results = func1()

print(results)

I tried to execute the simd instruction, but print: RuntimeError: WebAssembly translation error: Unsupported feature: proposed simd operator I16x8ExtAddPairwiseI8x16U

The wat file is : (module (type (;0;) (func (result v128))) (func (;0;) (type 0) (result v128) v128.const i32x4 0x733c3e67 0x3c3e6776 0x3e677673 0x6776733c i64x2.abs i64x2.bitmask i8x16.splat v128.const i32x4 0x733c3e67 0x3c3e6776 0x3e677673 0x6776733c i64x2.ge_s f32x4.floor v128.not i16x8.extadd_pairwise_i8x16_u) (export "x" (func 0)))

orangeC23 avatar Apr 09 '23 02:04 orangeC23