Conversation
|
cc. @Zzzabiyaka |
|
Note that this is just non-normative text describing the purpose of the instruction. It apparently wasn't updated by the SIMD proposal. The normative specification of validation for select is here and allows vector types to be omitted as well. I updated the informal description. |
|
@rossberg thanks for the explanation. How do you know if We have the same question for other opcodes like From an initial look, the only way to infer the correct type of Just to explicitly state the problem, in the Chicory interpreter we use a fully untyped In this situation we don't know how many values to pop and this is the only opcode where it is, non-decidable(if I understand it correctly) without an additional type inference step. |
|
@andreaTP, well, semantically, it does not matter. And a jit will know the type. An interpreter using heterogeneous representations, however, may have to do some extra work, like storing type information from validation in a side table. That's certainly annoying, but that problem is neither specific to vector types (i32 and i64 may already be of different size), nor to the select instruction (e.g., consider the drop instruction). So while I was never in favour of expanding the legacy form to vector types personally, I don't think it introduced any novel problems. |
|
Thanks again for the prompt answer.
Agreed, I'm going to close this one. |
FWIW |
|
Thanks 👍 |
Opening in draft waiting for WebAssembly/spec#1901 to be resolved. --------- Co-authored-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
This is a fix on top of the recently merged #1899 .
From the spec:

With numtype:

Vector Types are not Number Types, hence the select type should be explicitly defined.