Stream: git-wasmtime

Topic: wasmtime / issue #1172 Improve shift codegen using knowle...


view this post on Zulip Wasmtime GitHub notifications bot (May 04 2022 at 22:29):

cfallin commented on issue #1172:

@abrown is this still an issue with the current backend? (Doing some issue gardening at the moment)

view this post on Zulip Wasmtime GitHub notifications bot (May 04 2022 at 23:27):

abrown commented on issue #1172:

No, I think this is resolved by the current emit.rs code of Inst::ShiftR:

https://github.com/bytecodealliance/wasmtime/blob/5e712990e9626e25cbb42203934a7d42b36b9e4c/cranelift/codegen/src/isa/x64/inst/emit.rs#L920-L935

view this post on Zulip Wasmtime GitHub notifications bot (May 04 2022 at 23:27):

abrown closed issue #1172:

What is the feature or code improvement you would like to do in Cranelift?

As described in https://github.com/WebAssembly/simd/issues/117#issuecomment-573494583, Wasm shifts do extra runtime work to ensure the shift value is within a certain range. This is extra work that could be removed if we had knowledge that the shift value was constant and in the required range. This knowledge could also be used to lower the Wasm shifts to instructions using an immediate.

What is the value of adding this in Cranelift?

Emit faster code.

Do you have an implementation plan, and/or ideas for data structures or algorithms to use?

I think this type of optimization may apply to more than just Wasm shifts so I hope this approach works for those as well:

Have you considered alternative implementations? If so, how are they better or worse than your proposal?

No, open to suggestions.


Last updated: Dec 23 2024 at 12:05 UTC