Stream: git-wasmtime

Topic: wasmtime / issue #6200 Remove unsound `bitselect` => `{u,...


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

jameysharp commented on issue #6200:

Oooh, right. I think these rules might still be correct on vector types; I believe icmp returns 0 or -1 in each lane, and I think bitselect is defined on vectors.

On scalar types I think we could have a rule rewriting (bitselect ty (bmask ty c) x y) to (select ty c x y). That would give us a correct version of these bitselect rules in terms of the rules for select, and also be useful in its own right.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 12 2023 at 17:29):

Kmeakin commented on issue #6200:

Is bitselect only intended for vector types? If so, we might want to constrain it to only be used on vector types

view this post on Zulip Wasmtime GitHub notifications bot (Apr 12 2023 at 17:34):

jameysharp commented on issue #6200:

Ah, I see what happened. These rules were sort of correct before we removed vselect in #5918. That instruction only applied to vectors, so replacing it with bitselect was correct except that the "only vectors" constraint was lost at that point.

Our current way to express that a type is any vector type is to match it against (multi_lane _ _). Adding that constraint to all these rules should fix this.

The bitselect instruction is useful on scalar values too. It's just that this particular transformation was wrong for scalars.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 12 2023 at 17:42):

jameysharp commented on issue #6200:

Once this is fixed we should backport it to the release-8.0.0 branch too. #5918 merged after 7.0.0 forked off main so we don't have to backport this fix further than that. It's nice that 8.0.0 hasn't been released yet. Thanks for spotting this bug, @Kmeakin!

view this post on Zulip Wasmtime GitHub notifications bot (Apr 12 2023 at 17:54):

Kmeakin commented on issue #6200:

Abandoned in favour of https://github.com/bytecodealliance/wasmtime/pull/6200

view this post on Zulip Wasmtime GitHub notifications bot (Apr 12 2023 at 17:55):

Kmeakin edited a comment on issue #6200:

Abandoned in favour of https://github.com/bytecodealliance/wasmtime/pull/6201


Last updated: Nov 22 2024 at 16:03 UTC