[PowerPC] Fix on-stack AltiVec arguments with 64-bit SVR4
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Mon, 23 Jun 2014 12:36:34 +0000 (12:36 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Mon, 23 Jun 2014 12:36:34 +0000 (12:36 +0000)
commit9ba552db891eac048a423e1c94a4fc6093b6ad25
treeb107ee7f445f6c6f5f0cc1ce589c817d64436de8
parent3b8c86b985f3f09b51b5b377c3b577d1ff83f72b
[PowerPC] Fix on-stack AltiVec arguments with 64-bit SVR4

Current 64-bit SVR4 code seems to have some remnants of Darwin code
in AltiVec argument handing.  This had the effect that AltiVec arguments
(or subsequent arguments) were not correctly placed in the parameter area
in some cases.

The correct behaviour with the 64-bit SVR4 ABI is:
- All AltiVec arguments take up space in the parameter area, just like
  any other arguments, whether vararg or not.
- They are always 16-byte aligned, skipping a parameter area doubleword
  (and the associated GPR, if any), if necessary.

This patch implements the correct behaviour and adds a test case.
(Verified against GCC behaviour via the ABI compat test suite.)

llvm-svn: 211492
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/test/CodeGen/PowerPC/ppc64-altivec-abi.ll [new file with mode: 0644]