[PATCH] D12498: X86: add an interrupt calling convention

Amjad Aboud via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 01:40:01 PST 2015


aaboud added a comment.

I understand that this implementation have a gap with respect to the final proposal.
However, we can close this gap, right?

Peter, how do you suggest to go further from here? Do you want to make the needed changes and upload a new patch?


================
Comment at: lib/Target/X86/X86CallingConv.td:711
@@ -710,1 +710,3 @@
 
+def CC_X86_Intr : CallingConv<[
+  // Error codes aren't necessarily 32 bits wide, but fill a 32-bit slot.
----------------
tari wrote:
> aaboud wrote:
> > I think we need to define argument convention for x86-32 and another for x86-64.
> > X86-32: the arguments need to have size 4 and alignment 4
> > X86-64: the arguments need to have size 8 and alignment 8
> > 
> > Also, why do we need to promote types to i32? Do we expect to have smaller types? Should not that be considered as illegal interrupt?
> According to the AMD documentation, the error code in long mode (x86-64) is still 32 bits wide, but is padded to 64 bits when placed on the stack. So the handling of the error code from a user's perspective is the same in both 32- and 64-bit code.
> 
> Arguments that are not 32 bits wide should probably be made illegal, yes.
OK, I understand why error code in x86_64 configuration should be also with size 4 (and with alignment 8)
But I still think that in x86_32 configuration the alignment should be 4. There is no need to consume more memory than actually needed, right?

X86-32: the arguments need to have size 4 and alignment 4
X86-64: the arguments need to have size 4 and alignment 8


Repository:
  rL LLVM

http://reviews.llvm.org/D12498





More information about the llvm-commits mailing list