In #2 there was discussion about how inline assembly interacts with the stack, and it was decided that:
nostack => option one: the stack is unusable, don't even look as rsp.
- default => option five: the stack is aligned and can be used (you just have to restore things when you exit the
asm! block_.
I'm interested in option four: the stack can be used, but isn't necessarily aligned. This comes up a bunch in the x86_64 crate, where we make frequent use of PUSH and POP (so we need the stack to be valid) but don't need the stack to have a particular alignment (example).
Do we see this being a common use case? Would a options(unaligned_stack) make sense?
How would this interact with LLVM's alignstack? We might be able to avoid setting alignstack if the unaligned_stack option is used. In LLVM, does not setting alignstack mean that the stack is potentially invalid?
In #2 there was discussion about how inline assembly interacts with the stack, and it was decided that:
nostack=> option one: the stack is unusable, don't even look asrsp.asm!block_.I'm interested in option four: the stack can be used, but isn't necessarily aligned. This comes up a bunch in the
x86_64crate, where we make frequent use ofPUSHandPOP(so we need the stack to be valid) but don't need the stack to have a particular alignment (example).Do we see this being a common use case? Would a
options(unaligned_stack)make sense?How would this interact with LLVM's
alignstack? We might be able to avoid settingalignstackif theunaligned_stackoption is used. In LLVM, does not settingalignstackmean that the stack is potentially invalid?