You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are 2 ways to do little-endian VMs on big-endian hosts:
Byteswap every load/store instruction.
This is very slow.
Adjust load/store addresses such that the VM sees the memory as little-endian, but no byteswaps are required.
This is faster, but requires byteswapping at the C API layer.
The former is faster for IO-bound tasks, whereas the latter is faster for CPU-bound tasks. In practice, nobody uses wasm for IO-bound tasks, because wasm was designed for CPU-bound tasks, as a replacement for asm.js. This means approach 2 is better for wasm.
However, approach 2 is a bit mind-bending, and so maybe not everyone wants to deal with it. Thus, leaving the C API undefined for big-endian hosts might be the best approach to take here.
So it'd be nice if wasm_memory_data wasn't, and instead the caller had to pass in a buffer for the runtime to copy things into.
The text was updated successfully, but these errors were encountered:
SoniEx2
changed the title
Undefine for big-endian hosts
Get rid of wasm_memory_data, use a copying wasm_get_memory_data instead
Oct 11, 2020
SoniEx2
changed the title
Get rid of wasm_memory_data, use a copying wasm_get_memory_data instead
Get rid of wasm_memory_data, use a copying wasm_(read/write)_memory_data instead
Oct 12, 2020
There are 2 ways to do little-endian VMs on big-endian hosts:
The former is faster for IO-bound tasks, whereas the latter is faster for CPU-bound tasks. In practice, nobody uses wasm for IO-bound tasks, because wasm was designed for CPU-bound tasks, as a replacement for asm.js. This means approach 2 is better for wasm.
However, approach 2 is a bit mind-bending, and so maybe not everyone wants to deal with it. Thus, leaving the C API undefined for big-endian hosts might be the best approach to take here.
See also WebAssembly/wabt#1557
So it'd be nice if wasm_memory_data wasn't, and instead the caller had to pass in a buffer for the runtime to copy things into.
The text was updated successfully, but these errors were encountered: