[PATCH] D30049: x86 interrupt calling convention: re-align stack pointer on 64-bit if an error code was pushed

H.J Lu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 13 11:23:53 PDT 2017


hjl.tools added a comment.

In https://reviews.llvm.org/D30049#682363, @phil-opp wrote:

> > No, there is no need to realign stack in 64-bit mode.
>
> I'm not sure if I understand you correctly. Yes, there is no need to //dynamically// realign the stack in 64-bit mode since the CPU aligns the stack on a 16 byte boundary on interrupt entry. However, for some exceptions, the CPU pushes an 8 byte error code afterwards. In that case it is necessary to subtract another 8 bytes from RSP to restore the 16-byte alignment.


Can we verify how stack is aligned when there is an error code?


https://reviews.llvm.org/D30049





More information about the llvm-commits mailing list