-
Notifications
You must be signed in to change notification settings - Fork 20
LLVM: wasm64, atomics (exception handling) not really implemented #12
Comments
I just see this is related to void Writer::createInitMemoryFunction(), in wasm_ld. If anyone knows if/when this could theoretically get 'fixed', thanks for any info :; |
cc @aardappel. Would you be able to update |
@tlively sure, I can have a look. @ecs-commonA note that while |
Possible fix: https://reviews.llvm.org/D92348 |
Thanks to you guys for reacting so quickly and taking care of this. I can confirm wasm64 in LLVM is REALLY nice already (thx Wouter), exception handling does yet appear to have problems: Compiling with -fwasm-exceptions and throwing/catching some works fine on wasm32 yet, but on wasm64 there is fatal error: error in backend: Cannot select: intrinsic %llvm.wasm.extract.exception PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: |
... I see, for wasm64 and EH to work also the $__wasm_init_tls func would need to be updated. This function also addresses a global (1) that most likely would need to be changed from i32 to i64 I think.... |
-fwasm-exceptions should not be expected to work right now, as we are updating it (both in the toolchain and V8) to reflect changes in the wasm EH spec. |
Hi, re: Possible fix: https://reviews.llvm.org/D92348 I see the fix has landed but it appears incomplete to me, I think all instructions marked with '+' below shall be i64.const. +i32.const(67616)
Regarding the new EH proposal (#3) I'm bit sad/disappointed, because I implemented #2 and found it's nice (LLVM win EH based, thx to Heejin). I really hope, #3 will be close to #2, at least for LLVM. |
+cc @aheejin |
As @dschuff said, we are implementing recent changes (WebAssembly/exception-handling#137 and WebAssembly/exception-handling#143) in the spec, so please don't expect to work it in both 32 and 64 bits some months. The existing support was not tested for wasm64, but I think extending the support to wasm64 after finishing the new spec implementation shouldn't be hard. |
@ecs-commonA the patch has not been merged yet, and as you can see here https://github.com/WebAssembly/memory64/blob/master/proposals/memory64/Overview.md the |
Aardappel, thank you. I did not yet see this. I can confirm the wasm64 support is very good yet, even wasi-libc > dlmalloc etc. work perfectly after I removed some static asserts. |
@ecs-commonA https://reviews.llvm.org/D92348 has been merged, please let us know if its working for you once you get the chance. |
Thanks Aardappel. Confirmed, function looks fine :) |
* Fix binary grammar definition of the branch hints custom section The overall section structure definition wasm missing.
Hi,
is anyone aware whether a working implementation of atomics instr. with target=wasm64 can be expected soon?
EH depends on it and some more.
Just many thanks for any information regarding this. I could not quickly find a better place to ask.
FUNC __wasm_init_memory with target=wasm64:
i32.const(67616) // of course NOT ;)
i32.const(0)
i32.const(1)
i32.atomic.rmw.cmpxchg(0 align 2)
if.op( extdatab @112)b1_len=11 b2_len=27 b1_stream_start=<4> b2_stream_start=11 stream_end=<26> depth=1 parent@0
i32.const(67616)
i32.const(1)
i64.const(-1)
i32.atomic.wait(0 align 2)
drop()
else.op()
i32.const(65536)
i32.const(0)
i32.const(8)
memory.init( extdatab @48)
i32.const(65544)
i32.const(0)
i32.const(16)
memory.init( extdatab @80)
i32.const(67616)
i32.const(2)
i32.atomic.store(0 align 2)
i32.const(67616)
i32.const(-1)
atomic.notify(0 align 2)
drop()
end()
data.drop()
data.drop()
The text was updated successfully, but these errors were encountered: