Stream: git-wasmtime

Topic: wasmtime / PR #2385 [RFC] Support WebAssembly memory inst...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2020 at 16:52):

uweigand opened PR #2385 from endian-memory to main:

This patch fixes issue
https://github.com/bytecodealliance/wasmtime/issues/2124
by adding support in the Cranelift WebAssembly translator for
correctly handling memory instructions on big-endian platforms.

Since memory instructions always access little-endian data per
the WebAssembly spec, we must byte-swap on big-endian platforms.

This is done by creating two new instructions in the CraneliftIR
LoadRev and StoreRev
which operate just like Load and Store, except by also byte-swapping
the values read or written.

The translator code is changed to use those instruction on big-
endian platforms instead of normal loads and stores.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Nov 16 2020 at 17:48):

uweigand updated PR #2385 from endian-memory to main:

This patch fixes issue
https://github.com/bytecodealliance/wasmtime/issues/2124
by adding support in the Cranelift WebAssembly translator for
correctly handling memory instructions on big-endian platforms.

Since memory instructions always access little-endian data per
the WebAssembly spec, we must byte-swap on big-endian platforms.

This is done by creating two new instructions in the CraneliftIR
LoadRev and StoreRev
which operate just like Load and Store, except by also byte-swapping
the values read or written.

The translator code is changed to use those instruction on big-
endian platforms instead of normal loads and stores.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Dec 15 2020 at 08:53):

uweigand closed without merge PR #2385.


Last updated: Oct 23 2024 at 20:03 UTC