Open
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.