Skip to content

asm2wasm fails to convert SIMD instructions #855

Closed
@CryZe

Description

@CryZe

When it encounters a SIMD instruction it fails to compile the asm.js code to wasm:

/home/Chris/Projekte/wasm/emsdk_portable/clang/fastcomp/build_incoming_64/bin/llvm-nm: /home/Chris/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libcompiler_builtins-e428224f6caf212a.rlib(rust.metadata.bin) The end of the file was unexpectedly encountered

HEAPU8
asm2wasm: /home/Chris/.emscripten_ports/binaryen/binaryen-version_19/src/asm2wasm.h:1335: auto wasm::Asm2WasmBuilder::processFunction(cashew::Ref)::(anonymous class)::operator()(cashew::Ref) const: Assertion `mappedGlobals.find(name) != mappedGlobals.end() ? true : (std::cerr << name.str << '\n', false)' failed.
Traceback (most recent call last):
  File "/home/Chris/Projekte/wasm/emsdk_portable/emscripten/incoming/emcc", line 13, in <module>
    emcc.run()
  File "/home/Chris/Projekte/wasm/emsdk_portable/emscripten/incoming/emcc.py", line 2030, in run
    subprocess.check_call(cmd, stdout=open(wasm_text_target, 'w'))
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '[u'/home/Chris/.emscripten_ports/binaryen/binaryen-version_19/bin/asm2wasm', '/mnt/d/Projekte/wasm/advent-of-code-2016/day-05/target/wasm32-unknown-emscripten/release/aoc.asm.js', '--total-memory=16777216', '-O3', '--mem-init=/mnt/d/Projekte/wasm/advent-of-code-2016/day-05/target/wasm32-unknown-emscripten/release/aoc.js.mem', '--mem-base=1024', '--wasm-only']' returned non-zero exit status -6

The asm.js line looks like this:

 temp_Int32x4_ptr = $context$i;SIMD_Int32x4_store(HEAPU8, temp_Int32x4_ptr, SIMD_Int32x4(0,0,1732584193,-271733879));

If this is not intended to work yet, what can I do to prevent emscripten from generating vector instructions then? -fno-vectorize -s SIMD=0 and the following llvm-args -disable-loop-vectorization -disable-slp-vectorization -vectorize-loops=false -vectorize-slp=false -vectorize-slp-aggressive=false didn't do anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions