diff options
author | Carl Love <cel@us.ibm.com> | 2017-05-10 15:54:41 +0000 |
---|---|---|
committer | Carl Love <carll@gcc.gnu.org> | 2017-05-10 15:54:41 +0000 |
commit | 5562ebfc6456b545c500b7d22ea8bceb446fb9fc (patch) | |
tree | 959bca95f6b285b26140d8471b51231b5badc09f /gcc/testsuite | |
parent | b1ce66fa69ba89a8a63da74780283bff20f98331 (diff) | |
download | gcc-5562ebfc6456b545c500b7d22ea8bceb446fb9fc.zip gcc-5562ebfc6456b545c500b7d22ea8bceb446fb9fc.tar.gz gcc-5562ebfc6456b545c500b7d22ea8bceb446fb9fc.tar.bz2 |
rs6000-c: Add support for built-in functions vector signed char vec_neg (vector...
gcc/ChangeLog:
2017-05-10 Carl Love <cel@us.ibm.com>
* config/rs6000/rs6000-c: Add support for built-in functions
vector signed char vec_neg (vector signed char)
vector signed short int vec_neg (vector short int)
vector signed int vec_neg (vector signed int)
vector signed long long vec_neg (vector signed long long)
vector float vec_neg (vector float)
vector double vec_neg (vector double)
* config/rs6000/rs6000-builtin.def: Add definitions for NEG function
overload.
* config/rs6000/altivec.h: Add define for vec_neg
* doc/extend.texi: Update the built-in documentation for the
new built-in functions.
gcc/testsuite/ChangeLog:
2017-05-10 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/builtins-3.c: Add tests for the new built-ins to
to the test suite file.
* gcc.target/powerpc/builtins-3-p8.c: Add tests for the new built-ins to
to the test suite file.
From-SVN: r247841
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/builtins-3-p8.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/builtins-3.c | 47 |
3 files changed, 58 insertions, 8 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e300900..ef45039 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-05-10 Carl Love <cel@us.ibm.com> + * gcc.target/powerpc/builtins-3.c: Add tests for the new built-ins to + to the test suite file. + * gcc.target/powerpc/builtins-3-p8.c: Add tests for the new built-ins to + to the test suite file. + 2017-05-10 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> PR tree-optimization/77644 diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3-p8.c b/gcc/testsuite/gcc.target/powerpc/builtins-3-p8.c index 90e573d..629a692 100644 --- a/gcc/testsuite/gcc.target/powerpc/builtins-3-p8.c +++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-p8.c @@ -36,18 +36,25 @@ test_vui_packs_vull_vull (vector unsigned long long x, return vec_packs (x, y); } +vector long long +test_neg_long_long (vector long long x) +{ + return vec_neg (x); +} + /* Expected test results: test_eq_long_long 1 vcmpequd inst test_pack_float 1 vpkudum inst test_nabs_long_long 1 vspltisw, 1 vsubudm, 1 vminsd test_vsi_packs_vsll_vsll 1 vpksdss - test_vui_packs_vull_vull 1 vpkudus */ + test_vui_packs_vull_vull 1 vpkudus + test_neg_long_long 1 vspltisw, 1 vsubudm */ /* { dg-final { scan-assembler-times "vcmpequd" 1 } } */ /* { dg-final { scan-assembler-times "vpkudum" 1 } } */ -/* { dg-final { scan-assembler-times "vspltisw" 1 } } */ -/* { dg-final { scan-assembler-times "vsubudm" 1 } } */ +/* { dg-final { scan-assembler-times "vspltisw" 2 } } */ +/* { dg-final { scan-assembler-times "vsubudm" 2 } } */ /* { dg-final { scan-assembler-times "vminsd" 1 } } */ /* { dg-final { scan-assembler-times "vpksdss" 1 } } */ /* { dg-final { scan-assembler-times "vpkudus" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3.c b/gcc/testsuite/gcc.target/powerpc/builtins-3.c index bddd0ac..5998c08 100644 --- a/gcc/testsuite/gcc.target/powerpc/builtins-3.c +++ b/gcc/testsuite/gcc.target/powerpc/builtins-3.c @@ -58,6 +58,36 @@ test_nabs_double (vector double x) return vec_nabs (x); } +vector signed char +test_neg_char (vector signed char x) +{ + return vec_neg (x); +} + +vector short +test_neg_short (vector short x) +{ + return vec_neg (x); +} + +vector int +test_neg_int (vector int x) +{ + return vec_neg (x); +} + +vector float +test_neg_float (vector float x) +{ + return vec_neg (x); +} + +vector double +test_neg_double (vector double x) +{ + return vec_neg (x); +} + /* Expected test results: test_eq_char 1 vcmpequb inst @@ -68,19 +98,26 @@ test_nabs_double (vector double x) test_nabs_short 1 vspltisw, 1 vsubuhm, 1 vminsh test_nabs_int 1 vspltisw, 1 vsubuwm, 1 vminsw test_nabs_float 1 xvnabssp - test_nabs_double 1 xvnabsdp */ + test_nabs_double 1 xvnabsdp + test_neg_char 1 vspltisw, 1 vsububm + test_neg_short 1 vspltisw, 1 vsubuhm + test_neg_int 1 vspltisw, 1 vsubuwm + test_neg_float 1 xvnegsp + test_neg_float 1 xvnegdp */ /* { dg-final { scan-assembler-times "vcmpequb" 1 } } */ /* { dg-final { scan-assembler-times "vcmpequh" 1 } } */ /* { dg-final { scan-assembler-times "vcmpequw" 1 } } */ /* { dg-final { scan-assembler-times "vsldoi" 1 } } */ -/* { dg-final { scan-assembler-times "vsububm" 1 } } */ -/* { dg-final { scan-assembler-times "vsubuhm" 1 } } */ -/* { dg-final { scan-assembler-times "vsubuwm" 1 } } */ +/* { dg-final { scan-assembler-times "vsububm" 2 } } */ +/* { dg-final { scan-assembler-times "vsubuhm" 2 } } */ +/* { dg-final { scan-assembler-times "vsubuwm" 2 } } */ /* { dg-final { scan-assembler-times "vminsb" 1 } } */ /* { dg-final { scan-assembler-times "vminsh" 1 } } */ /* { dg-final { scan-assembler-times "vminsw" 1 } } */ -/* { dg-final { scan-assembler-times "vspltisw" 3 } } */ +/* { dg-final { scan-assembler-times "vspltisw" 6 } } */ /* { dg-final { scan-assembler-times "xvnabssp" 1 } } */ /* { dg-final { scan-assembler-times "xvnabsdp" 1 } } */ +/* { dg-final { scan-assembler-times "xvnegsp" 1 } } */ +/* { dg-final { scan-assembler-times "xvnegdp" 1 } } */ |