This patch addresses PR13947.
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Thu, 11 Oct 2012 15:38:20 +0000 (15:38 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Thu, 11 Oct 2012 15:38:20 +0000 (15:38 +0000)
commit22162470ba127c626e674b0fdc90456c69ffd2cd
treea969518839e091a6e43175592d1e4079678a4499
parent6be23ce8214faac1c0bbba82860c85427fc6479f
This patch addresses PR13947.

For function calls on the 64-bit PowerPC SVR4 target, each parameter
is mapped to as many doublewords in the parameter save area as
necessary to hold the parameter.  The first 13 non-varargs
floating-point values are passed in registers; any additional
floating-point parameters are passed in the parameter save area.  A
single-precision floating-point parameter (32 bits) must be mapped to
the second (rightmost, low-order) word of its assigned doubleword
slot.

Currently LLVM violates this ABI requirement by mapping such a
parameter to the first (leftmost, high-order) word of its assigned
doubleword slot.  This is internally self-consistent but will not
interoperate correctly with libraries compiled with an ABI-compliant
compiler.

This patch corrects the problem by adjusting the parameter addressing
on both sides of the calling convention.

llvm-svn: 165714
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/test/CodeGen/PowerPC/floatPSA.ll [new file with mode: 0644]