Stream: git-wasmtime

Topic: wasmtime / issue #6104 Support bitcasting between scalar ...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 27 2023 at 17:25):

bjorn3 opened issue #6104:

Feature

See title. For example v0 = vconst.i64x2 ...; bitcast.i128 little v0.

Benefit

This allows bitcasting between the two without having to go through memory. Cg_clif needs this bitcasting for implementing mem::transmute and float to 128bit int casts on Windows. Currently it has to go through the stack, which is slower and inhibits optimizations.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 27 2023 at 17:28):

jameysharp labeled issue #6104:

Feature

See title. For example v0 = vconst.i64x2 ...; bitcast.i128 little v0.

Benefit

This allows bitcasting between the two without having to go through memory. Cg_clif needs this bitcasting for implementing mem::transmute and float to 128bit int casts on Windows. Currently it has to go through the stack, which is slower and inhibits optimizations.

view this post on Zulip Wasmtime GitHub notifications bot (May 23 2024 at 15:13):

afonso360 added the cranelift:E-compiler-easy label to Issue #6104.

view this post on Zulip Wasmtime GitHub notifications bot (May 23 2024 at 15:21):

afonso360 commented on issue #6104:

This seems like a good starter issue. It currently affects all of our 4 backends.

Here's a test demonstrating the issue:

test compile
target aarch64

function %bitcast_vec_to_int(i64x2) -> i128 {
block0(v0: i64x2):
    v1 = bitcast.i128 little v0
    return v1
}

function %bitcast_int_to_vec(i128) -> i64x2 {
block0(v0: i128):
    v1 = bitcast.i64x2 little v0
    return v1
}

When running this test it fails with: should be implemented in ISLE: inst = v1 = bitcast.i128 little v0, type = Some(types::I128)

Happy to help anyone who wants to try working on this!

view this post on Zulip Wasmtime GitHub notifications bot (May 23 2024 at 15:21):

afonso360 added the cranelift:area:aarch64 label to Issue #6104.

view this post on Zulip Wasmtime GitHub notifications bot (May 23 2024 at 15:21):

afonso360 added the cranelift:area:s390x label to Issue #6104.

view this post on Zulip Wasmtime GitHub notifications bot (May 23 2024 at 15:21):

afonso360 added the cranelift:area:riscv64 label to Issue #6104.

view this post on Zulip Wasmtime GitHub notifications bot (May 23 2024 at 15:21):

afonso360 added the cranelift:area:x64 label to Issue #6104.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 05 2024 at 20:39):

aidenfoxivey commented on issue #6104:

@afonso360 It seems like the only remaining part to fix is s390x, right?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 05 2024 at 20:53):

afonso360 commented on issue #6104:

Yes, I think that's correct

view this post on Zulip Wasmtime GitHub notifications bot (Oct 05 2024 at 20:55):

aidenfoxivey commented on issue #6104:

Yes, I think that's correct

I'll take a look at how to get a VM running on my ARM MacBook.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 05 2024 at 20:56):

aidenfoxivey commented on issue #6104:

Maybe I can take on that remaining part.


Last updated: Oct 23 2024 at 20:03 UTC