Description
According to the ISA document function arguments passed on the stack are all essentially stored in 32-bit slots, which matches how GCC for Xtensa behaves. Meanwhile LLVM for Xtensa passes smaller arguments packed together. This means that passing more than 6 arguments to a function between code compiled by GCC and LLVM is currently broken.
E.g.:
GCC:
| 8-bit | padding | 16-bit | padding | 32-bit |
LLVM:
| 8-bit | 16-bit | 32-bit |
I see in CC_Xtensa_Custom
that i8
and i16
are promoted to i32
for non-byval arguments:
llvm-project/llvm/lib/Target/Xtensa/XtensaISelLowering.cpp
Lines 744 to 753 in 1e28f73
But the same promotion s not being done for byval ones:
llvm-project/llvm/lib/Target/Xtensa/XtensaISelLowering.cpp
Lines 733 to 742 in 1e28f73
I was considering trying to submit a patch for this, but I'm not sure if you're currently accepting patches for the Xtensa part, or if so how you're accepting them.