diff options
author | Prachi Godbole <prachi.godbole@imgtec.com> | 2017-03-06 10:19:52 +0000 |
---|---|---|
committer | Prachi Godbole <prachigodbole@gcc.gnu.org> | 2017-03-06 10:19:52 +0000 |
commit | 5ada812cedf5c5e4f602c6fc21bfc3744aa2ddcd (patch) | |
tree | 46e2f266fff6cdce667b6a38763d789aea8b7c6a /gcc | |
parent | 334b3c4b8400c23382b44c14779a5d789b8cb1d4 (diff) | |
download | gcc-5ada812cedf5c5e4f602c6fc21bfc3744aa2ddcd.zip gcc-5ada812cedf5c5e4f602c6fc21bfc3744aa2ddcd.tar.gz gcc-5ada812cedf5c5e4f602c6fc21bfc3744aa2ddcd.tar.bz2 |
mips-msa.md (msa_dotp_<su>_d, [...]): Fix MODE for vec_select.
gcc/
* config/mips/mips-msa.md (msa_dotp_<su>_d, msa_dpadd_<su>_d,
msa_dpsub_<su>_d): Fix MODE for vec_select.
gcc/testsuite/
* gcc.target/mips/msa-dotp.c: New tests.
From-SVN: r245911
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/mips/mips-msa.md | 12 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/mips/msa-dotp.c | 32 |
4 files changed, 47 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5157670..b588b47 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2017-03-06 Prachi Godbole <prachi.godbole@imgtec.com> + * config/mips/mips-msa.md (msa_dotp_<su>_d, msa_dpadd_<su>_d, + msa_dpsub_<su>_d): Fix MODE for vec_select. + +2017-03-06 Prachi Godbole <prachi.godbole@imgtec.com> + * config/mips/mips.c (mips_gen_const_int_vector): Change type of last argument. * config/mips/mips-protos.h (mips_gen_const_int_vector): Likewise. diff --git a/gcc/config/mips/mips-msa.md b/gcc/config/mips/mips-msa.md index a29c4f0..521b094 100644 --- a/gcc/config/mips/mips-msa.md +++ b/gcc/config/mips/mips-msa.md @@ -1230,10 +1230,10 @@ (parallel [(const_int 0) (const_int 2)])))) (mult:V2DI (any_extend:V2DI - (vec_select:V4SI (match_dup 1) + (vec_select:V2SI (match_dup 1) (parallel [(const_int 1) (const_int 3)]))) (any_extend:V2DI - (vec_select:V4SI (match_dup 2) + (vec_select:V2SI (match_dup 2) (parallel [(const_int 1) (const_int 3)]))))))] "ISA_HAS_MSA" "dotp_<su>.d\t%w0,%w1,%w2" @@ -1319,10 +1319,10 @@ (parallel [(const_int 0) (const_int 2)])))) (mult:V2DI (any_extend:V2DI - (vec_select:V4SI (match_dup 2) + (vec_select:V2SI (match_dup 2) (parallel [(const_int 1) (const_int 3)]))) (any_extend:V2DI - (vec_select:V4SI (match_dup 3) + (vec_select:V2SI (match_dup 3) (parallel [(const_int 1) (const_int 3)]))))) (match_operand:V2DI 1 "register_operand" "0")))] "ISA_HAS_MSA" @@ -1414,10 +1414,10 @@ (parallel [(const_int 0) (const_int 2)])))) (mult:V2DI (any_extend:V2DI - (vec_select:V4SI (match_dup 2) + (vec_select:V2SI (match_dup 2) (parallel [(const_int 1) (const_int 3)]))) (any_extend:V2DI - (vec_select:V4SI (match_dup 3) + (vec_select:V2SI (match_dup 3) (parallel [(const_int 1) (const_int 3)])))))))] "ISA_HAS_MSA" "dpsub_<su>.d\t%w0,%w2,%w3" diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ed9bcb1..9a44150 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2017-03-06 Prachi Godbole <prachi.godbole@imgtec.com> + * gcc.target/mips/msa-dotp.c: New tests. + +2017-03-06 Prachi Godbole <prachi.godbole@imgtec.com> + * gcc.target/mips/msa-bclri.c: New test. 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com> diff --git a/gcc/testsuite/gcc.target/mips/msa-dotp.c b/gcc/testsuite/gcc.target/mips/msa-dotp.c new file mode 100644 index 0000000..e45028f --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/msa-dotp.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* { dg-options "-mno-mips16 -mfp64 -mhard-float -mmsa" } */ + +typedef int v4i32 __attribute__ ((vector_size(16))); +typedef long long v2i64 __attribute__ ((vector_size(16))); + +/* Test MSA dot product family for CSE optimization. */ + +static v4i32 g = {0, 92, 93, 94}; +static v4i32 h = {12, 24, 36, 48}; +static v2i64 l = {84, 98}; + +void +dotp_d_msa (v2i64 *c) +{ + l = __builtin_msa_dotp_s_d (g, h); +} +/* { dg-final { scan-assembler "dotp_s.d" } } */ + +void +dpadd_d_msa (v2i64 *c) +{ + *c = __builtin_msa_dpadd_s_d (l, g, h); +} +/* { dg-final { scan-assembler "dpadd_s.d" } } */ + +void +dpsub_d_msa (v2i64 *c) +{ + *c = __builtin_msa_dpsub_s_d (l, g, h); +} +/* { dg-final { scan-assembler "dpsub_s.d" } } */ |