[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)
commitfdb6eb65c75124061056788fecee0116ac278e3d
tree967525cd75b5edddff6b883f568cb4f87907b573
parent6f7e87c7514c5d287cff80b033f1877059133177
[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.)

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