-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I'm opening this issue to consolidate some scattered discussion about what is needed to make inline assembly for Wasm work. This is tracked along with the other architectures at #93335. That thread notes:
- It must have clobber_abi.
- It must be possible to clobber every register that is normally clobbered by a function call.
- Generally review that the exposed register classes make sense.
So, for Wasm specifically:
- Syntax seems to be the biggest question (see below discussion), WAT vs. LLVM's format
- There are not any registers to be clobbered. Should there be some way to indicate the asm clobbers the top N elements on the stack?
- Should we be restricting dir specs (
in
,out
,lateout
,inout
,inlateout
) or options (pure
,nomem
,readonly
,preserves_flags
,noreturn
,nostack
,raw
)? We should probably rejectpreserves_flags
. I'm not sure iflateout
andinlateout
make sense. - Is the LLVM side generally considered stable? It appears unchanging, but I don't see any of its constraints documented in langref https://llvm.org/docs/LangRef.html#inline-asm-constraint-string
Cc @daxpedda @hanna-kruppe @alexcrichton @hoodmane @solomatov, I think you have all been involved in the wasm-inline-asm discussion in different places.
solomatov, Momijiichigo and silence48
Metadata
Metadata
Assignees
Labels
A-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.