From a9ea161d628b73aafc07960797031c3b66ccfe9c Mon Sep 17 00:00:00 2001 From: Will Schmidt Date: Fri, 26 Jan 2018 15:20:45 +0000 Subject: [PATCH] powerpcfold-vec-neg-longlong.h: New. [testsuite] 2018-01-23 Will Schmidt * gcc.target/powerpcfold-vec-neg-longlong.h: New. * gcc.target/powerpc/fold-vec-neg-longlong.p8.c: New. * gcc.target/powerpc/fold-vec-neg-longlong.p9.c: New. * gcc.target/powerpc/fold-vec-neg-longlong.c: Delete. * gcc.target/powerpc/fold-vec-neg-int.c: Remove scan-assembler stanzas. * gcc.target/powerpc/fold-vec-neg-int.p7.c: New. * gcc.target/powerpc/fold-vec-neg-int.p8.c: New. * gcc.target/powerpc/fold-vec-neg-int.p9.c: New. From-SVN: r257092 --- gcc/testsuite/ChangeLog | 11 +++++++++++ .../gcc.target/powerpc/fold-vec-neg-int.c | 4 +--- .../gcc.target/powerpc/fold-vec-neg-int.p7.c | 19 +++++++++++++++++++ .../gcc.target/powerpc/fold-vec-neg-int.p8.c | 19 +++++++++++++++++++ .../gcc.target/powerpc/fold-vec-neg-int.p9.c | 18 ++++++++++++++++++ .../powerpc/fold-vec-neg-longlong.h | 17 +++++++++++++++++ ...-longlong.c => fold-vec-neg-longlong.p8.c} | 10 +++------- .../powerpc/fold-vec-neg-longlong.p9.c | 14 ++++++++++++++ 8 files changed, 102 insertions(+), 10 deletions(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p7.c create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p8.c create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p9.c create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.h rename gcc/testsuite/gcc.target/powerpc/{fold-vec-neg-longlong.c => fold-vec-neg-longlong.p8.c} (66%) create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.p9.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 92bbe451eb1..56e12714905 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2018-01-26 Will Schmidt + + * gcc.target/powerpc/fold-vec-neg-longlong.h: New. + * gcc.target/powerpc/fold-vec-neg-longlong.p8.c: New. + * gcc.target/powerpc/fold-vec-neg-longlong.p9.c: New. + * gcc.target/powerpc/fold-vec-neg-longlong.c: Delete. + * gcc.target/powerpc/fold-vec-neg-int.c: Remove scan-assembler stanzas. + * gcc.target/powerpc/fold-vec-neg-int.p7.c: New. + * gcc.target/powerpc/fold-vec-neg-int.p8.c: New. + * gcc.target/powerpc/fold-vec-neg-int.p9.c: New. + 2018-01-26 Richard Biener PR rtl-optimization/84003 diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c index d6ca1283bc9..4f358560c98 100644 --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c @@ -13,6 +13,4 @@ test1 (vector signed int x) return vec_neg (x); } -/* { dg-final { scan-assembler-times "xxspltib|vspltisw|vxor" 1 } } */ -/* { dg-final { scan-assembler-times "vsubuwm" 1 } } */ -/* { dg-final { scan-assembler-times "vmaxsw" 0 } } */ +/* Scan-assembler stanzas have been moved to fold-vec-neg-int.p*.c tests. */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p7.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p7.c new file mode 100644 index 00000000000..8e99de38271 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p7.c @@ -0,0 +1,19 @@ +/* Verify that overloaded built-ins for vec_neg with int + inputs produce the right code when -mcpu=power7 is specified. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2 -mcpu=power7" } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */ + +#include + +vector signed int +test1 (vector signed int x) +{ + return vec_neg (x); +} + +/* { dg-final { scan-assembler-times "xxspltib|vspltisw|vxor" 1 } } */ +/* { dg-final { scan-assembler-times "vsubuwm" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsw" 0 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p8.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p8.c new file mode 100644 index 00000000000..91067ab6916 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p8.c @@ -0,0 +1,19 @@ +/* Verify that overloaded built-ins for vec_neg with int + inputs produce the right code when -mcpu=power8 is specified. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2 -mcpu=power8" } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ + +#include + +vector signed int +test1 (vector signed int x) +{ + return vec_neg (x); +} + +/* { dg-final { scan-assembler-times "xxspltib|vspltisw|vxor" 1 } } */ +/* { dg-final { scan-assembler-times "vsubuwm" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsw" 0 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p9.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p9.c new file mode 100644 index 00000000000..44732c89ad3 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.p9.c @@ -0,0 +1,18 @@ +/* Verify that overloaded built-ins for vec_neg with int + inputs produce the right code when -mcpu=power9 is specified. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2 -mcpu=power9" } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ + +#include + +vector signed int +test1 (vector signed int x) +{ + return vec_neg (x); +} + +/* { dg-final { scan-assembler-times "vnegw" 1 } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.h b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.h new file mode 100644 index 00000000000..53312ac00d0 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.h @@ -0,0 +1,17 @@ +/* Verify that overloaded built-ins for vec_neg with long long + inputs produce the right code. */ + +/* vec_neg testcase, included by fold-vec-neg-longlong.p*.c */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2" } */ + +#include + +vector signed long long +test3 (vector signed long long x) +{ + return vec_neg (x); +} + diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.p8.c similarity index 66% rename from gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.c rename to gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.p8.c index 48f71788648..90f9abcc441 100644 --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.c +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.p8.c @@ -3,15 +3,11 @@ /* { dg-do compile } */ /* { dg-require-effective-target powerpc_p8vector_ok } */ -/* { dg-options "-mpower8-vector -O2" } */ +/* { dg-options "-mpower8-vector -mcpu=power8 -O2" } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ -#include -vector signed long long -test3 (vector signed long long x) -{ - return vec_neg (x); -} +#include "fold-vec-neg-longlong.h" /* { dg-final { scan-assembler-times "xxspltib|vspltisw" 1 } } */ /* { dg-final { scan-assembler-times "vsubudm" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.p9.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.p9.c new file mode 100644 index 00000000000..39fbaf1e49d --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.p9.c @@ -0,0 +1,14 @@ +/* Verify that overloaded built-ins for vec_neg with long long + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-options "-mcpu=power9 -O2" } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ + +#include "fold-vec-neg-longlong.h" + + +/* { dg-final { scan-assembler-times "vnegd" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsd" 0 } } */ + -- 2.30.2