This patch solves a problem with passing varargs parameters under the PPC64
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Mon, 29 Oct 2012 21:18:16 +0000 (21:18 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Mon, 29 Oct 2012 21:18:16 +0000 (21:18 +0000)
commite6c56433de56fb89f1d476332134b6b2e22cfa28
tree76c7a3b8e0642cfe144506d32720862e6eca0da2
parent4830ccff925b8d57f589650a3ad6007ffa0536d5
This patch solves a problem with passing varargs parameters under the PPC64
ELF ABI.

A varargs parameter consisting of a single-precision floating-point value,
or of a single-element aggregate containing a single-precision floating-point
value, must be passed in the low-order (rightmost) four bytes of the
doubleword stack slot reserved for that parameter.  If there are GPR protocol
registers remaining, the parameter must also be mirrored in the low-order
four bytes of the reserved GPR.

Prior to this patch, such parameters were being passed in the high-order
four bytes of the stack slot and the mirrored GPR.

The patch adds a new test case to verify the correct code generation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166968 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelLowering.cpp
test/CodeGen/PowerPC/varargs-struct-float.ll [new file with mode: 0644]