From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20413 invoked by alias); 26 Jan 2015 16:19:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 19881 invoked by uid 89); 26 Jan 2015 16:18:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Received: from Unknown (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Jan 2015 16:18:27 +0000 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 920F3230A99FA for ; Mon, 26 Jan 2015 16:17:52 +0000 (GMT) Received: from hhmail02.hh.imgtec.org (10.100.10.20) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 26 Jan 2015 16:17:55 +0000 Received: from hhmail02.hh.imgtec.org ([::1]) by hhmail02.hh.imgtec.org ([::1]) with mapi id 14.03.0224.002; Mon, 26 Jan 2015 16:17:54 +0000 From: Robert Suchanek To: "gcc-patches@gcc.gnu.org" Subject: [PATCH RFC] Running auto-vectorization tests multiple times Date: Mon, 26 Jan 2015 17:42:00 -0000 Message-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg02296.txt.bz2 Hi, I'm trying to lift the restriction to run auto-vectorization tests=20 more than once and would like to check if I'm going in the right direction. I attached a draft patch. Currently, auto-vectorization tests are enabled by a call to check_vect_support_and_set_flags procedure and if there is support then the global DEFAULT_VECTFLAGS is modified and the procedure returns true. However, this is problematic in the MIPS case as we have Loongson vector support, Paired-Single (PS) instructions and the new MIPS SIMD ASE (MSA). Loongson is the easiest as it cannot be executed along with the options for PS and MSA (both require -mfp64) and vice versa, but we can vectorise PS and MSA in a single run. This obviously requires a possibility to run the same tests twice, with -mpaired-single and -mmsa. check_vect_support_and_set_flags is called in a few places: - gcc.dg/graphite/graphite.exp - gcc.dg/vect/vect.exp - gfortran.dg/graphite/graphite.exp - gfortran.dg/vect/vect.exp - g++.dg/vect/vect.exp The first complication is the use of variations of dg-runtest: gcc-dg-runtest, g++-dg-runtest, gfortran-dg-runtest and the plain dg-runtest. The idea to enable multi execution is to add a new procedure, et-dg-runtest, with similar arguments as the above but with an additional argument taking the name of procedure for a callback. et-dg-runtest would iterate over a list of all effective targets i.e. global ET_TARGETS, setup by check_vect_support_and_set_flags, add needed options for a target and check if we want to just compile or run the tests by calling helpers. Implementation would require a couple of helper procedures to make it work, thus, for each e.g. mips_loongson, mips_msa we would define the following procedures in lib/target-supports.exp: - add_options_for_ (optional) returning flags needed for - check_effective_target_ to check if we can compile - check_effective_target__hw_available to check if we can run - check_effective_target__runtime (optional) - calls the two above plus any other additional checks like OS environment, etc. If a port wants to exploit multiple execution then would=20 need to be appended in vect_support_and_set_flags to the global ET_TARGETS and add the aforementioned helper procedures. Some ports already follow this convention to certain extent. However, DEFAULT_VECTCFLAGS should not be set as the appropriate flags will be added on the fly via add_options_for_ if it's defined. If the port supports only one vector extension, no other changes are needed and DEFAULT_VECTCFLAGS should be modified as per old behaviour. Any other thoughts/suggestions?=20 The patch is a concept and will not run MSA tests as the MSA support is not in the trunk yet. Regards, Robert [PATCH] Run vector tests for more than one effective target. gcc/testsuite * g++.dg/vect/vect.exp: Add and set new global ET_TARGETS. Call g++-dg-runtest via et-dg-runtest. * gcc.dg/graphite/graphite.exp: Likewise, but for gcc-dg-runtest. * gcc.dg/vect/vect.exp: Likewise. * gfortran.dg/graphite/graphite.exp: Likewise, but for gfortran-dg-runtest. * gfortran.dg/vect/vect.exp: Likewise. * lib/target-supports.exp (check_mpaired_single_hw_available): New. (check_mips_loongson_hw_available): Likewise. (check_mips_msa_hw_available): Likewise. (check_effective_target_mpaired_single_runtime): Likewise. (check_effective_target_mips_loongson_runtime): Likewise. (check_effective_target_mips_msa_runtime): Likewise. (add_options_for_mpaired_single): Likewise. (add_options_for_mips_msa): Likewise. (check_effective_target_mips_msa): Likewise. (et-dg-runtest): Likewise. (vect_support_and_set_flags): Add supported MIPS targets to ET_TARGETS list. --- gcc/testsuite/g++.dg/vect/vect.exp | 16 +- gcc/testsuite/gcc.dg/graphite/graphite.exp | 6 +- gcc/testsuite/gcc.dg/vect/vect.exp | 157 +++++++++++------- gcc/testsuite/gfortran.dg/graphite/graphite.exp | 7 +- gcc/testsuite/gfortran.dg/vect/vect.exp | 45 ++++-- gcc/testsuite/lib/target-supports.exp | 195 +++++++++++++++++++= +++- 6 files changed, 340 insertions(+), 86 deletions(-) diff --git a/gcc/testsuite/g++.dg/vect/vect.exp b/gcc/testsuite/g++.dg/vect= /vect.exp index aba1866..1e02d6b 100644 --- a/gcc/testsuite/g++.dg/vect/vect.exp +++ b/gcc/testsuite/g++.dg/vect/vect.exp @@ -39,6 +39,10 @@ set save-dg-do-what-default ${dg-do-what-default} global DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS "" =20 +# Reset list of effective targets to be checked against tests. +global ET_TARGETS +set ET_TARGETS "" + # These flags are used for all targets. lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fno-vect-cost-model" =20 @@ -58,10 +62,10 @@ lappend VECT_SLP_CFLAGS "-fdump-tree-slp-details" dg-init =20 # Main loop. -g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.{c,cc,S} ]] \ - "" $DEFAULT_VECTCFLAGS -g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/slp-pr*.{c,cc,S} ]= ] \ - "" $VECT_SLP_CFLAGS +et-dg-runtest g++-dg-runtest [lsort [glob -nocomplain \ + $srcdir/$subdir/pr*.{c,cc,S} ]] "" $DEFAULT_VECTCFLAGS +et-dg-runtest g++-dg-runtest [lsort [glob -nocomplain \ + $srcdir/$subdir/slp-pr*.{c,cc,S} ]] "" $VECT_SLP_CFLAGS =20 #### Tests with special options global SAVED_DEFAULT_VECTCFLAGS @@ -70,8 +74,8 @@ set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS # --param max-aliased-vops=3D0 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "--param max-aliased-vops=3D0" -g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/param-max-aliased*= .\[cS\]]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest g++-dg-runtest [lsort [glob -nocomplain \ + $srcdir/$subdir/param-max-aliased*.\[cS\]]] "" $DEFAULT_VECTCFLAGS =20 # Clean up. set dg-do-what-default ${save-dg-do-what-default}=20 diff --git a/gcc/testsuite/gcc.dg/graphite/graphite.exp b/gcc/testsuite/gcc= .dg/graphite/graphite.exp index 9dba5d6..4f42982 100644 --- a/gcc/testsuite/gcc.dg/graphite/graphite.exp +++ b/gcc/testsuite/gcc.dg/graphite/graphite.exp @@ -60,8 +60,12 @@ dg-runtest $block_files "" "-O2 -floop-block -fno-= loop-strip-mine -fno-loo global DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS "-O2 -fgraphite-identity -ftree-vectorize -fno-vect= -cost-model -fdump-tree-vect-details -ffast-math" =20 +# Reset list of effective targets to be checked against tests. +global ET_TARGETS +set ET_TARGETS "" + if [check_vect_support_and_set_flags] { - dg-runtest $vect_files "" $DEFAULT_VECTCFLAGS + et-dg-runtest dg-runtest $vect_files "" $DEFAULT_VECTCFLAGS } =20 # The default action for the rest of the files is 'compile'. diff --git a/gcc/testsuite/gcc.dg/vect/vect.exp b/gcc/testsuite/gcc.dg/vect= /vect.exp index b7d0b07..1325aad 100644 --- a/gcc/testsuite/gcc.dg/vect/vect.exp +++ b/gcc/testsuite/gcc.dg/vect/vect.exp @@ -24,6 +24,10 @@ load_lib clearcap.exp global DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS "" =20 +# Reset list of effective targets to be checked against tests. +global ET_TARGETS +set ET_TARGETS "" + # If the target system supports vector instructions, the default action # for a test is 'run', otherwise it's 'compile'. Save current default. # Executing vector instructions on a system without hardware vector support @@ -62,13 +66,15 @@ lappend O_VECTCFLAGS "-fdump-tree-vect-details" lappend DEFAULT_VECTCFLAGS "-O2" =20 # Tests that should be run without generating dump info -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/nodump-*.\[cS\]]] \ +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/nodump-*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS =20 # "-O -fdump-tree-veclower2" lappend VEC_FLAGS "-O" "-fdump-tree-veclower2" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vec-scal-*.\[cS\]]] \ - "" $VEC_FLAGS +et-dg-runtest dg-runtest [lsort [glob -nocomplain \ + $srcdir/$subdir/vec-scal-*.\[cS\]]] \ + "" $VEC_FLAGS =20 set VECT_SLP_CFLAGS $DEFAULT_VECTCFLAGS =20 @@ -81,14 +87,18 @@ if { [check_effective_target_lto] } { lappend VECT_ADDITIONAL_FLAGS "-flto -ffat-lto-objects" } foreach flags $VECT_ADDITIONAL_FLAGS { - dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.\[cS\]]] \ + et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/pr*.\[cS\]]] \ + $flags $DEFAULT_VECTCFLAGS + et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/vect-*.\[cS\]]] \ $flags $DEFAULT_VECTCFLAGS - dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vect-*.\[cS\]]] \ + et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/slp-*.\[cS\]]] \ $flags $DEFAULT_VECTCFLAGS - dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/slp-*.\[cS\]]] \ - $flags $DEFAULT_VECTCFLAGS - dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/bb-slp*.\[cS\]]] \ - $flags $VECT_SLP_CFLAGS + et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/bb-slp*.\[cS\]]] \ + $flags $VECT_SLP_CFLAGS } =20 #### Tests with special options @@ -99,141 +109,164 @@ set SAVED_VECT_SLP_CFLAGS $VECT_SLP_CFLAGS # --param vect-max-version-for-alias-checks=3D0 tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=3D= 0" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-vfa-*.\[cS\]]] \ +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-vfa-*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS =20 # -ffast-math tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-ffast-math" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-\[ipsv\]*.\[= cS\]]] \ +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/fast-math-\[ipsv\]*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS =20 # -ffast-math SLP tests set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS lappend VECT_SLP_CFLAGS "-ffast-math" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-bb-slp-*.\[c= S\]]] \ - "" $VECT_SLP_CFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/fast-math-bb-slp-*.\[cS\]]] \ + "" $VECT_SLP_CFLAGS =20 # -fno-fast-math tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-fast-math" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-fast-math-*.\[cS\]]= ] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-fast-math-*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS =20 # -fno-math-errno tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-math-errno" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-math-errno-*.\[cS\]= ]] \ +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-math-errno-*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS =20 # -fwrapv tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fwrapv" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/wrapv-*.\[cS\]]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/wrapv-*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS =20 # -ftrapv tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-ftrapv" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/trapv-*.\[cS\]]] \ +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/trapv-*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS =20 # -fno-tree-dce tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-tree-dce" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-dce-*.\[cS\]]]= \ +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-tree-dce-*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS =20 # -fsection-anchors tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fsection-anchors" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/section-anchors-*.\[cS= \]]] \ +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/section-anchors-*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS =20 # alignment-sensitive -fsection-anchors tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fsection-anchors" \ "-fdump-ipa-increase_alignment-details" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/aligned-section-anchor= s-*.\[cS\]]] \ +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/aligned-section-anchors-*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS =20 # -fno-section-anchors tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-section-anchors" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-section-anchors-*.\= [cS\]]] \ +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-section-anchors-*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS =20 # -funswitch-loops tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-funswitch-loops" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/unswitch-loops-*.\[cS\= ]]] \ +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/unswitch-loops-*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS =20 # -fno-trapping-math tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-trapping-math" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-trapping-math-*.\[c= S\]]] \ +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-trapping-math-*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS =20 # -fno-tree-scev-cprop set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-vect-*.\[cS= \]]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-scevccp-vect-*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS =20 # -fno-tree-scev-cprop set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-pr*.\[cS\]]= ] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-scevccp-pr*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS =20 # -fno-tree-scev-cprop set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-outer-*.\[c= S\]]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-scevccp-outer-*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS =20 # -fno-tree-scev-cprop -fno-tree-reassoc set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" "-fno-tree-reassoc" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-noreassoc-*= .\[cS\]]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-scevccp-noreassoc-*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS =20 # -fno-tree-scev-cprop set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-slp-*.\[cS\= ]]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-scevccp-slp-*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS =20 # -fno-tree-dominator-opts set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-tree-dominator-opts" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-dom-*.\[cS\]]]= \ +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-tree-dom-*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS =20 # -fno-tree-pre set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-tree-pre" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-pre-*.\[cS\]]]= \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-tree-pre-*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS =20 # With -Os set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-Os" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/Os-vect-*.\[cS\]]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/Os-vect-*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS =20 # With --param ggc-min-expand=3D0 --param ggc-min-heapsize=3D0=20 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "--param" "ggc-min-expand=3D0" "--param" "ggc-m= in-heapsize=3D0" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/ggc-*.\[cS\]]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/ggc-*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS =20 # -ftree-loop-if-convert-stores set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-ftree-loop-if-convert-stores" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/if-cvt-stores-vect-*.\= [cS\]]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/if-cvt-stores-vect-*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS =20 # With -O3. # Don't allow IPA cloning, because it throws our counts out of whack. @@ -242,40 +275,48 @@ lappend DEFAULT_VECTCFLAGS "-O3" "-fno-ipa-cp-clone" if [istarget "spu-*-*"] { lappend DEFAULT_VECTCFLAGS "-funroll-loops" } -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O3-*.\[cS\]]] \ - "" $DEFAULT_VECTCFLAGS + +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/O3-*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS =20 # With -O1 -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O1-*.\[cS\]]] \ - "" $O1_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/O1-*.\[cS\]]] \ + "" $O1_VECTCFLAGS =20 # With -O -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O-*.\[cS\]]] \ - "" $O_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/O-*.\[cS\]]] \ + "" $O_VECTCFLAGS =20 # -fno-tree-reassoc set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS lappend VECT_SLP_CFLAGS "-fno-tree-reassoc" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-reassoc-bb-slp= -*.\[cS\]]] \ - "" $VECT_SLP_CFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-tree-reassoc-bb-slp-*.\[cS\]]] \ + "" $VECT_SLP_CFLAGS =20 # -fno-tree-fre set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-tree-fre" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-fre-*.\[cS\]]]= \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-tree-fre-*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS =20 # -fno-tree-fre -fno-tree-pre set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-tree-fre" "-fno-tree-pre" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-fre-pre*.\[cS\]]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-fre-pre*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS =20 # -fno-tree-sra set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS lappend VECT_SLP_CFLAGS "-fno-tree-sra" -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-sra-bb-slp-*.\= [cS\]]] \ - "" $VECT_SLP_CFLAGS +et-dg-runtest dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/no-tree-sra-bb-slp-*.\[cS\]]] \ + "" $VECT_SLP_CFLAGS =20 =20 # Clean up. diff --git a/gcc/testsuite/gfortran.dg/graphite/graphite.exp b/gcc/testsuit= e/gfortran.dg/graphite/graphite.exp index 1df46ea..52add75 100644 --- a/gcc/testsuite/gfortran.dg/graphite/graphite.exp +++ b/gcc/testsuite/gfortran.dg/graphite/graphite.exp @@ -52,9 +52,14 @@ gfortran-dg-runtest $id_files "" "-O2 -fgraphit= e-identity -ffast-math" gfortran-dg-runtest $interchange_files "" "-O2 -floop-interchange -fno-loo= p-block -fno-loop-strip-mine -ffast-math -fdump-tree-graphite-all" gfortran-dg-runtest $block_files "" "-O2 -floop-block -fno-loop-stri= p-mine -fno-loop-interchange -ffast-math -fdump-tree-graphite-all" =20 +# Reset list of effective targets to be checked against tests. +global ET_TARGETS +set ET_TARGETS "" + # Vectorizer tests, to be run or compiled, depending on target capabilitie= s. if [check_vect_support_and_set_flags] { - gfortran-dg-runtest $vect_files "" "-O2 -fgraphite-identity -ftree-vec= torize -fno-vect-cost-model -fdump-tree-vect-details -ffast-math" + et-dg-runtest gfortran-dg-runtest $vect_files "" \ + "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdum= p-tree-vect-details -ffast-math" } =20 # Tests to be run. diff --git a/gcc/testsuite/gfortran.dg/vect/vect.exp b/gcc/testsuite/gfortr= an.dg/vect/vect.exp index e8f2b1c..09688a1 100644 --- a/gcc/testsuite/gfortran.dg/vect/vect.exp +++ b/gcc/testsuite/gfortran.dg/vect/vect.exp @@ -24,6 +24,10 @@ load_lib target-supports.exp global DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS "" =20 +# Reset list of effective targets to be checked against tests. +global ET_TARGETS +set ET_TARGETS "" + # These flags are used for all targets. lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model=3Du= nlimited" \ "-fdump-tree-vect-details" @@ -47,8 +51,10 @@ if ![check_vect_support_and_set_flags] { dg-init =20 # Main loop. -gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vect-*.\[fF\]= {,90,95,03,08} ]] "" $DEFAULT_VECTCFLAGS -gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.\[fF\]{,9= 0,95,03,08} ]] "" $DEFAULT_VECTCFLAGS +et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \ + $srcdir/$subdir/vect-*.\[fF\]{,90,95,03,08} ]] "" $DEFAULT_VECTCFLAGS +et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \ + $srcdir/$subdir/pr*.\[fF\]{,90,95,03,08} ]] "" $DEFAULT_VECTCFLAGS =20 #### Tests with special options global SAVED_DEFAULT_VECTCFLAGS @@ -57,44 +63,51 @@ set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS # -ffast-math tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-ffast-math" -gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-*.\= [fF\]{,90,95,03,08} ]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \ + $srcdir/$subdir/fast-math-*.\[fF\]{,90,95,03,08} ]] \ + "" $DEFAULT_VECTCFLAGS =20 # -ffast-math tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-ffast-math" "-fdefault-real-8" -gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-rea= l8*.\[fF\]{,90,95,03,08} ]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \ + $srcdir/$subdir/fast-math-real8*.\[fF\]{,90,95,03,08} ]] \ + "" $DEFAULT_VECTCFLAGS =20 # -fvect-cost-model tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fvect-cost-model=3Ddynamic" -gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/cost-model-*.= \[fF\]{,90,95,03,08} ]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \ + $srcdir/$subdir/cost-model-*.\[fF\]{,90,95,03,08} ]] \ + "" $DEFAULT_VECTCFLAGS =20 # --param vect-max-version-for-alias-checks=3D0 tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=3D= 0" -gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-vfa-*.\[fF= \]{,90,95,03,08} ]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \ + $srcdir/$subdir/no-vfa-*.\[fF\]{,90,95,03,08} ]] \ + "" $DEFAULT_VECTCFLAGS =20 # With -O3 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-O3" -gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O3-*.\[fF\]{,= 90,95,03,08} ]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \ + $srcdir/$subdir/O3-*.\[fF\]{,90,95,03,08} ]] \ + "" $DEFAULT_VECTCFLAGS =20 # With -Ofast set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-Ofast" -gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/Ofast-*.\[fF\= ]{,90,95,03,08} ]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \ + $srcdir/$subdir/Ofast-*.\[fF\]{,90,95,03,08} ]] \ + "" $DEFAULT_VECTCFLAGS =20 # With -fno-tree-copy-prop -fno-tree-fre -O3 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fno-tree-copy-prop" "-fno-tree-fre" "-O3" -gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-fre-no-cop= y-prop-O3-*.\[fF\]{,90,95,03,08} ]] \ - "" $DEFAULT_VECTCFLAGS +et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \ + $srcdir/$subdir/no-fre-no-copy-prop-O3-*.\[fF\]{,90,95,03,08} ]] \ + "" $DEFAULT_VECTCFLAGS =20 # Clean up. set dg-do-what-default ${save-dg-do-what-default} diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/targ= et-supports.exp index e51d07d..c603cbc 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1408,6 +1408,85 @@ proc check_sse_hw_available { } { }] } =20 +# Return 1 if the target supports executing MIPS Paired-Single instruction= s, 0 +# otherwise. Cache the result. + +proc check_mpaired_single_hw_available { } { + return [check_cached_effective_target mpaired_single_hw_available { + # If this is not the right target then we can skip the test. + if { !([istarget mips*-*-*]) } { + expr 0 + } else { + check_runtime_nocache mpaired_single_hw_available { + int main() + { + asm volatile ("pll $f2,$f4,$f6"); + return v[0]; + } + #endif + } "" + } + }] +} + +# Return 1 if the target supports executing Loongson vector instructions, 0 +# otherwise. Cache the result. + +proc check_mips_loongson_hw_available { } { + return [check_cached_effective_target mips_loongson_hw_available { + # If this is not the right target then we can skip the test. + if { !([istarget mips*-*-*]) } { + expr 0 + } else { + check_runtime_nocache mips_loongson_hw_available { + #include + int main() + { + asm volatile ("paddw $f2,$f4,$f6"); + return v[0]; + } + #endif + } "" + } + }] +} + +# Return 1 if the target supports executing MIPS MSA instructions, 0 +# otherwise. Cache the result. + +proc check_mips_msa_hw_available { } { + return [check_cached_effective_target msa_hw_available { + # If this is not the right target then we can skip the test. + if { !([istarget mips*-*-*]) } { + expr 0 + } else { + check_runtime_nocache msa_hw_available { + #if !defined(__mips_msa) + #error "MSA NOT AVAIL" + #else + #if !(((__mips =3D=3D 64) || (__mips =3D=3D 32)) && (__mips_isa_rev= >=3D 2)) + #error "MSA NOT AVAIL FOR ISA REV < 2" + #endif + #if !defined(__mips_hard_float) + #error "MSA HARD_FLOAT REQUIRED" + #endif + #if __mips_fpr !=3D 64 + #error "MSA 64 FPR REQUIRED" + #endif + #include + + int main() + { + v8i16 v =3D __builtin_msa_ldi_h (0); + v[0] =3D 0; + return v[0]; + } + #endif + } "-mmsa" + } + }] +} + # Return 1 if the target supports executing SSE2 instructions, 0 # otherwise. Cache the result. =20 @@ -1477,6 +1556,37 @@ proc check_effective_target_sse2_runtime { } { return 0 } =20 +# Return 1 if the target supports running MIPS Paired-Single +# executables, 0 otherwise. + +proc check_effective_target_mpaired_single_runtime { } { + if { [check_effective_target_mpaired_single] + && [check_mpaired_single_hw_available] } { + return 1 + } + return 0 +} + +# Return 1 if the target supports running Loongson executables, 0 otherwis= e. + +proc check_effective_target_mips_loongson_runtime { } { + if { [check_effective_target_mips_loongson] + && [check_mips_loongson_hw_available] } { + return 1 + } + return 0 +} + +# Return 1 if the target supports running MIPS MSA executables, 0 otherwis= e. + +proc check_effective_target_mips_msa_runtime { } { + if { [check_effective_target_mips_msa] + && [check_mips_msa_hw_available] } { + return 1 + } + return 0 +} + # Return 1 if the target supports running AVX executables, 0 otherwise. =20 proc check_effective_target_avx_runtime { } { @@ -3025,6 +3135,24 @@ proc check_effective_target_arm_neonv2 { } { } } =20 +# Add the options needed for MIPS Paired-Single. + +proc add_options_for_mpaired_single { flags } { + if { ! [check_effective_target_mpaired_single] } { + return "$flags" + } + return "$flags -mpaired-single" +} + +# Add the options needed for MIPS SIMD Architecture. + +proc add_options_for_mips_msa { flags } { + if { ! [check_effective_target_mips_msa] } { + return "$flags" + } + return "$flags -mmsa" +} + # Return 1 if this a Loongson-2E or -2F target using an ABI that supports # the Loongson vector modes. =20 @@ -3036,6 +3164,37 @@ proc check_effective_target_mips_loongson { } { }] } =20 +# Return 1 if a msa program can be compiled to object + +proc check_effective_target_mips_msa { } { + if ![check_effective_target_nomips16] { + return 0 + } + return [check_no_compiler_messages msa object { + #if !defined(__mips_msa) + #error "MSA NOT AVAIL" + #else + #if !(((__mips =3D=3D 64) || (__mips =3D=3D 32)) && (__mips_isa_rev >= =3D 2)) + #error "MSA NOT AVAIL FOR ISA REV < 2" + #endif + #if !defined(__mips_hard_float) + #error "MSA HARD_FLOAT REQUIRED" + #endif + #if __mips_fpr !=3D 64 + #error "MSA 64 FPR REQUIRED" + #endif + #include + + int main() + { + v8i16 v =3D __builtin_msa_ldi_h (1); + + return v[0]; + } + #endif + } "-mmsa" ] +} + # Return 1 if this is an ARM target that adheres to the ABI for the ARM # Architecture. =20 @@ -5265,6 +5424,29 @@ proc is-effective-target-keyword { arg } { } } =20 +# Execute tests for all effective targets. + +proc et-dg-runtest { runtest testcases flags default-extra-flags } { + global ET_TARGETS + + if { [llength $ET_TARGETS] > 0 } { + foreach target $ET_TARGETS { + set target_flags $flags + set dg-do-what-default compile + if { [info procs add_options_for_${target}] !=3D [list] } { + set target_flags [add_options_for_${target} "$flags"] + } + if { [info procs check_effective_target_${target}_runtime] + !=3D [list] && [check_effective_target_${target}_runtime] } { + set dg-do-what-default run + } + $runtest $testcases $target_flags ${default-extra-flags} + } + } else { + $runtest $testcases $flags ${default-extra-flags} + } +} + # Return 1 if target default to short enums =20 proc check_effective_target_short_enums { } { @@ -5913,6 +6095,7 @@ proc check_effective_target_stpcpy {} { proc check_vect_support_and_set_flags { } { global DEFAULT_VECTCFLAGS global dg-do-what-default + global ET_TARGETS =20 if [istarget powerpc-*paired*] { lappend DEFAULT_VECTCFLAGS "-mpaired" @@ -5953,13 +6136,17 @@ proc check_vect_support_and_set_flags { } { set dg-do-what-default compile } } elseif { [istarget mips*-*-*] - && ([check_effective_target_mpaired_single] - || [check_effective_target_mips_loongson]) && [check_effective_target_nomips16] } { if { [check_effective_target_mpaired_single] } { - lappend DEFAULT_VECTCFLAGS "-mpaired-single" + lappend ET_TARGETS "mpaired_single" } - set dg-do-what-default run + if { [check_effective_target_mips_loongson] } { + lappend ET_TARGETS "mips_loongson" + } + if { [check_effective_target_mips_msa] } { + lappend ET_TARGETS "mips_msa" + } + return [llength $ET_TARGETS] } elseif [istarget sparc*-*-*] { lappend DEFAULT_VECTCFLAGS "-mcpu=3Dultrasparc" "-mvis" if [check_effective_target_ultrasparc_hw] { --=20 1.7.9.5