stdarch-gen-wasm32: Tool that creates spec sheet from wasm32's C and Rust source files.#1910
Draft
madhav-madhusoodanan wants to merge 3 commits intorust-lang:mainfrom
Draft
Conversation
Collaborator
|
r? @folkertdev rustbot has assigned @folkertdev. Use |
Contributor
Author
|
i just realized that for this specific intrinsic, it may be difficult to match the C version of the arguments with its Rust version: (Also noticed a bug where the |
stdarch-gen-wasm32: Tool that creates spec sheet from C and Rust source files.stdarch-gen-wasm32: Tool that creates spec sheet from wasm32's C and Rust source files.
f731d86 to
b78dc49
Compare
b78dc49 to
93b452f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does
stdarch-gen-wasm32do?wasm_simd128.hfile (for the definitions in C)tree-sittercrate)How to run
Context
C Abstract Syntax Tree
Take an intrinsic definition for example:
For a C intrinsic, the immediate children would have their grammar names as:
static__inline____DEFAULT_FN_ATTRS. The parser doesn't recognize it as a valid part of the tree and annotates it as ERROR.wasm_u32x4_make(uint32_t __c0, uint32_t __c1, uint32_t __c2, uint32_t __c3)The immediate children of the
function_declaratornode would have their grammar as follows:wasm_u32x4_make(uint32_t __c0, uint32_t __c1, uint32_t __c2, uint32_t __c3)The immediate children of a parameter_list node would have their grammar as follows:
uint32_t __c0uint32_t __c1uint32_t __c2uint32_t __c3Each node with the grammar name parameter_declaration could have its children structured in a few ways:
int x:v128_t, which is actually a type (but the parser is unaware of the same).x.*and identifier (which is__mem).Rust Abstract Syntax Tree
Take a Rust intrinsic definition for example:
For this Rust intrinsic, the immediate children would have their grammar names as:
pubunsafe. May not always be presentfnv128_load64_splatconstgeneric arguments. (This is not always present)(m: *const u64)v128The children of the
const_parametersnode have theirgrammar_namesas the following (assuming 2 generic arguments):constgeneric argumentconstgeneric argumentThe children of the
parametersnode have theirgrammar_namesas the following (assuming 2 arguments):cc: @Amanieu @folkertdev