Skip to content

[custom-descriptors] Branching descriptor casts #7622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tlively
Copy link
Member

@tlively tlively commented May 24, 2025

Implement basic support for br_on_cast_desc and br_on_cast_desc_fail
as new variants of BrOn. Include binary and text parsing and printing
as well as validation. Also handle the new operations anywhere the
compiler would otherwise complain about a non-exhaustive switch over the
BrCastOp enum.

For validation of type immediates during parsing, relax the requirement
that the cast type is a subtype of the input type. Continue validating
in the IR that the non-descriptor branching casts are downcasts, but do
not validate this for the new descriptor casts. See
WebAssembly/custom-descriptors#37 for context.

Add new validation and parsing tests in the form of spec tests in
preparation for creating an upstream spec test suite. While we're at it,
move the ref.get_desc tests to spec tests, add a few test cases, and fix
a bug when the ref.get_desc operand is null.

Implement basic support for `br_on_cast_desc` and `br_on_cast_desc_fail`
as new variants of `BrOn`. Include binary and text parsing and printing
as well as validation. Also handle the new operations anywhere the
compiler would otherwise complain about a non-exhaustive switch over the
`BrCastOp` enum.

For validation of type immediates during parsing, relax the requirement
that the cast type is a subtype of the input type. Continue validating
in the IR that the non-descriptor branching casts are downcasts, but do
not validate this for the new descriptor casts. See
WebAssembly/custom-descriptors#37 for context.

Add new validation and parsing tests in the form of spec tests in
preparation for creating an upstream spec test suite. While we're at it,
move the ref.get_desc tests to spec tests, add a few test cases, and fix
a bug when the ref.get_desc operand is null.
@tlively tlively requested a review from kripken May 24, 2025 02:55
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.

1 participant