Skip to content

Conversation

@bnoordhuis
Copy link

Copy link
Owner

@sunfishcode sunfishcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

| Mnemonic | Opcode | Immediates | Signature | Families |
| ----------- | ------ | --------------------------------------------------- | ------------------------------------------- | -------- |
| `select` | 0x1b | | `($T[1], $T[1], $condition: i32) : ($T[1])` | |
| `select` | 0x1c | `$signature`: [array] of [value types]; length is 1 | `($T[1], $T[1], $condition: i32) : ($T[1])` | |
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think "array" is correct here because "array" as defined in this document includes an encoding of the length, which the actual binary encoding for typed select doesn't have. Instead of saying it's an array with "length is 1", could we just say there's a single type? The spec does have wording leaving open the possibility of having more types, but the binary encoding doesn't reflect that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The octets for typed select look like this: 1C 01 7F - the last one is the actual type; the second one is always 1 but I think that qualifies as array-like?

(Just guessing but I suspect it's to allow future extension for a select where the two operands have different types?)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you're right. I misread the spec. Could you then move the length is 1 out and add it as a Validation requirement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants