[custom-descriptors] Branching descriptor casts #7622
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement basic support for
br_on_cast_desc
andbr_on_cast_desc_fail
as new variants of
BrOn
. Include binary and text parsing and printingas 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.