This patch adds support for the signed and unsigned int versions of the...
authorBill Seurer <seurer@linux.vnet.ibm.com>
Fri, 20 May 2016 15:25:04 +0000 (15:25 +0000)
committerBill Seurer <seurer@gcc.gnu.org>
Fri, 20 May 2016 15:25:04 +0000 (15:25 +0000)
commit92466115766cbe8b053694bc1974f5b5653f7cda
tree0880c3512cb9b6968f798f3a246b818039b58584
parent9a385c2d3d74ffed78f2ed9ad47b844d2f294105
This patch adds support for the signed and unsigned int versions of the...

This patch adds support for the signed and unsigned int versions of the
vec_addec altivec builtins from the Power Architecture 64-Bit ELF V2 ABI
OpenPOWER ABI for Linux Supplement (16 July 2015 Version 1.1). There are
many of the builtins that are missing and this is part of a series
of patches to add them.

There aren't instructions for the int versions of vec_addec so the
output code is built from other built-ins that do have instructions
which in this case is the following.

vec_addec (va, vb, carryv) == vec_or (vec_addc (va, vb),
vec_addc(vec_add(va, vb),
 vec_and (carryv, 0x1)))

The new test cases are executable tests which verify that the generated
code produces expected values. C macros were used so that the same
test case could be used for both the signed and unsigned versions. An
extra executable test case is also included to ensure that the modified
support for the __int128 versions of vec_addec is not broken. The same
test case could not be used for both int and __int128 because of some
differences in loading and storing the vectors.

Bootstrapped and tested on powerpc64le-unknown-linux-gnu and
powerpc64-unknown-linux-gnu with no regressions. Is this ok for trunk?

[gcc]

2016-05-20  Bill Seurer  <seurer@linux.vnet.ibm.com>

* config/rs6000/rs6000-builtin.def (vec_addec): Change vec_addec to a
special case builtin.
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Add
support for ALTIVEC_BUILTIN_VEC_ADDEC.
* config/rs6000/rs6000.c (altivec_init_builtins): Add definition
for __builtin_vec_addec.

[gcc/testsuite]

2016-05-20  Bill Seurer  <seurer@linux.vnet.ibm.com>

* gcc.target/powerpc/vec-addec.c: New test.
* gcc.target/powerpc/vec-addec-int128.c: New test.

From-SVN: r236515
ChangeLog
gcc/config/rs6000/rs6000-builtin.def
gcc/config/rs6000/rs6000-c.c
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/vec-addec-int128.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-addec.c [new file with mode: 0644]