Hi, > -----Original Message----- > From: Matthew Fortune > Sent: 19 September 2016 15:46 > To: Robert Suchanek; catherine_mo...@mentor.com > Cc: gcc-patches@gcc.gnu.org > Subject: RE: [PATCH 4/4] [MIPS] Add tests for MSA > > Hi Robert, > > Sorry for the long delay. Just a couple of cleanup bits in here but > otherwise OK. Unless you want me to read through again please go > ahead and commit once you've addressed the comments. > > We could do more in mips.exp for inferring -mfp64 and -mhard-float > but I'm not sure it is worth it currently. Let's leave it for a > round of testsuite changes at a later date.
Will do. > > Thanks, > Matthew > > >--- > > gcc/testsuite/gcc.dg/vect/slp-26.c | 7 +- > > gcc/testsuite/gcc.dg/vect/tree-vect.h | 2 + > > gcc/testsuite/gcc.target/mips/mips.exp | 8 + > > gcc/testsuite/gcc.target/mips/msa-builtins.c | 1086 > ++++++++++++++++++++++++++ > > gcc/testsuite/gcc.target/mips/msa.c | 631 +++++++++++++++ > > gcc/testsuite/lib/target-supports.exp | 191 ++++- > > 6 files changed, 1895 insertions(+), 30 deletions(-) > > create mode 100644 gcc/testsuite/gcc.target/mips/msa-builtins.c > > create mode 100644 gcc/testsuite/gcc.target/mips/msa.c > > > >diff --git a/gcc/testsuite/gcc.dg/vect/slp-26.c > b/gcc/testsuite/gcc.dg/vect/slp-26.c > >index 8b224ff..01f4e4e 100644 > >--- a/gcc/testsuite/gcc.dg/vect/slp-26.c > >+++ b/gcc/testsuite/gcc.dg/vect/slp-26.c > >@@ -46,6 +46,7 @@ int main (void) > > return 0; > > } > > > >-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */ > >-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" > } } */ > >- > >+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target > >{ > ! mips_msa } } } } */ > >+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target > >{ > mips_msa } } } } */ > >+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" > >{ > target { ! mips_msa } } } } */ > >+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" > >{ > target { mips_msa } } } } */ > > Why can we vectorise this with MSA but presumably no other arch can? AFAICT, the reason being is that MSA supports integer division in hardware, thus, we can vectorize the loop. > > >diff --git a/gcc/testsuite/gcc.target/mips/mips.exp > b/gcc/testsuite/gcc.target/mips/mips.exp > >index 3258105..7c24140 100644 > >--- a/gcc/testsuite/gcc.target/mips/mips.exp > >+++ b/gcc/testsuite/gcc.target/mips/mips.exp > >@@ -290,6 +290,7 @@ foreach option { > > relax-pic-calls > > mcount-ra-address > > odd-spreg > >+ msa > > } { > > lappend mips_option_groups $option "-m(no-|)$option" > > } > >@@ -820,6 +821,12 @@ proc mips-dg-init {} { > > "-mno-synci", > > #endif > > > >+ #ifdef __mips_msa > >+ "-mmsa" > >+ #else > >+ "-mno-msa" > >+ #endif > >+ > > 0 > > }; > > }] > >@@ -1368,6 +1375,7 @@ proc mips-dg-options { args } { > > mips_option_dependency options "-mfpxx" "-mno-paired-single" > > mips_option_dependency options "-msoft-float" "-mno-paired-single" > > mips_option_dependency options "-mno-paired-single" "-mno-mips3d" > >+ mips_option_dependency options "-mmsa" "-mno-mips16" > > > > # If the test requires an unsupported option, change run tests > > # to link tests. > >diff --git a/gcc/testsuite/gcc.target/mips/msa-builtins.c > b/gcc/testsuite/gcc.target/mips/msa-builtins.c > >new file mode 100644 > >index 0000000..f5e1efa > >--- /dev/null > >+++ b/gcc/testsuite/gcc.target/mips/msa-builtins.c > >@@ -0,0 +1,1086 @@ > >+/* Test builtins for MIPS MSA ASE instructions */ > >+/* { dg-do compile } */ > >+/* { dg-options "-mfp64 -mhard-float -mmsa" } */ > >+/* { dg-skip-if "needs asm output" { *-*-* } { "-flto" } { "-ffat-lto- > objects" } } */ > > This should not be necessary. The scan-assembler directive forces fat-lto- > objects > via some higher level code. I have seen this fail at times but never tracked > it > down > please remove dg-skip-if and see if you still get any -fno-fat-lto-objects > builds > of this file. I placed it temporarily to work around occasional failures with the bare-metal toolchain. As discussed, this is going to be fixed so I removed these from the tests. > > >+ > >+/* { dg-final { scan-assembler "msa_addv_b.*:.*addv\\.b.*msa_addv_b" } } */ > > Should these be seen only once: I.e. scan-assembler-times? I changed the test to scan-assembler-times with some additional changes to fit the correct matching and counting. I applied changes as suggested in all the remaining comments. Committed as r241054. Regards, Robert