Auto merge of #44066 - cuviper:powerpc64-extern-abi, r=alexcrichton
authorbors <bors@rust-lang.org>
Sat, 2 Sep 2017 19:46:51 +0000 (19:46 +0000)
committerXimin Luo <infinity0@debian.org>
Wed, 25 Oct 2017 18:27:30 +0000 (19:27 +0100)
commit7ab0a6129e51d5d1ed4c47fc8a2e51762a2c72d4
tree440c58d11f41ec5a6767bce1c88665ebe6174805
parentc1131d50e83a5cf2cc2bcb7a106c9442a1a45752
Auto merge of #44066 - cuviper:powerpc64-extern-abi, r=alexcrichton

powerpc64: improve extern struct ABI

These fixes all have to do with the 64-bit PowerPC ELF ABI for big-endian
targets.  The ELF v2 ABI for powerpc64le already worked well.

- Return after marking return aggregates indirect. Fixes #42757.
- Pass one-member float aggregates as direct argument values.
- Aggregate arguments less than 64-bit must be written in the least-
  significant bits of the parameter space.
- Larger aggregates are instead padded at the tail.
  (i.e. filling MSBs, padding the remaining LSBs.)

New tests were also added for the single-float aggregate, and a 3-byte
aggregate to check that it's filled into LSBs.  Overall, at least these
formerly-failing tests now pass on powerpc64:

- run-make/extern-fn-struct-passing-abi
- run-make/extern-fn-with-packed-struct
- run-pass/extern-pass-TwoU16s.rs
- run-pass/extern-pass-TwoU8s.rs
- run-pass/struct-return.rs

Gbp-Pq: Name u-ppc64-extern-struct-abi.patch
src/librustc_trans/cabi_powerpc64.rs
src/librustc_trans/cabi_x86.rs
src/test/run-make/extern-fn-struct-passing-abi/test.c
src/test/run-make/extern-fn-struct-passing-abi/test.rs
src/test/run-make/extern-fn-with-packed-struct/test.c
src/test/run-make/extern-fn-with-packed-struct/test.rs