PPC NCG: Fix float parameter passing on 64-bit.
authorPeter Trommler <ptrommler@acm.org>
Sat, 18 Jun 2016 10:28:41 +0000 (12:28 +0200)
committerBen Gamari <ben@smart-cactus.org>
Sat, 18 Jun 2016 22:27:06 +0000 (00:27 +0200)
commit2897be77123bf31cad1c60dd5560eba7f2f021ce
tree9c7e023e6f1995bd0bc1662b896ccb66384b2d23
parentf12fb8ab5d5ad7a26c84f98e446bc70064dcdcec
PPC NCG: Fix float parameter passing on 64-bit.

On Linux 64-bit PowerPC the first 13 floating point parameters are
passed in registers. We only passed the first 8 floating point params.

The alignment of a floating point single precision value in ELF v1.9 is
the second word of a doubleword. For ELF v2 we support only little
endian and the least significant word of a doubleword is the first word,
so no special handling is required.

Add a regression test.

Test Plan: validate on powerpc Linux and AIX

Reviewers: erikd, hvr, austin, simonmar, bgamari

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2327

GHC Trac Issues: #12134
compiler/nativeGen/PPC/CodeGen.hs
compiler/nativeGen/PPC/Regs.hs
testsuite/tests/ffi/should_run/T12134.hs [new file with mode: 0644]
testsuite/tests/ffi/should_run/T12134.stdout [new file with mode: 0644]
testsuite/tests/ffi/should_run/T12134_c.c [new file with mode: 0644]
testsuite/tests/ffi/should_run/all.T