public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
@ 2015-08-10 12:15 Robert Suchanek
  2016-01-05 16:16 ` Robert Suchanek
  2016-05-05 15:14 ` Robert Suchanek
  0 siblings, 2 replies; 17+ messages in thread
From: Robert Suchanek @ 2015-08-10 12:15 UTC (permalink / raw)
  To: Catherine_Moore, Matthew Fortune; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 6200 bytes --]

Hi,

This patch allows to run auto-vectorization tests for more than one effective
target.  The initial proposal

https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02289.html

had some issues that have been addressed and should work as expected now.

The idea was to add a wrapper procedure that would:
1. Iterative over a list of EFFECTIVE_TARGETS e.g. mips_msa, mpaired_single.
2. Add necessary compile time options for each effective target.
3. Check if it's possible to compile and/or run on a target, and set
   dg-do-what-default accordingly.
4. Set the target index to tell check_effective_target_vect_* which target is
   currently being processed.
5. Invoke {gfortran-,g++-,}dg-runtest with the list of vector tests as normal.

The above required that every vector feature e.g. vect_int that caches the result is
capable of tracking what target supports a feature.  The result is saved to a list
at an index controlled by the wrapper (et-dg-runtest).  Ports not using this feature,
set DEFAULT_VECTFLAGS and the tests should run as they used to.

The patch was additionally tested on x86_64-unknown-linux-gnu and aarch64-linux-gnu.

Regards,
Robert

gcc/testsuite/ChangeLog:

	* g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS. Call
	g++-dg-runtest via et-dg-runtest.
	* gcc.dg/graphite/graphite.exp: Likewise, but for 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_effective_target_mpaired_single_runtime): Likewise.
	(check_effective_target_mips_loongson_runtime): Likewise.
	(add_options_for_mpaired_single): Likewise.
	(check_effective_target_vect_int): Add global et_index.
	Check and save the supported feature for a target selected by
	the et_index target.  Break long lines where appropriate.  Call
	et-is-effective-target for MIPS with an argument instead of
	check_effective_target_* where appropriate.
	(check_effective_target_vect_intfloat_cvt): Likewise.
	(check_effective_target_vect_uintfloat_cvt): Likewise.
	(check_effective_target_vect_floatint_cvt): Likewise.
	(check_effective_target_vect_floatuint_cvt): Likewise.
	(check_effective_target_vect_simd_clones): Likewise.
	(check_effective_target_vect_shift): ewise.
	(check_effective_target_whole_vector_shift): Likewise.
	(check_effective_target_vect_bswap): Likewise.
	(check_effective_target_vect_shift_char): Likewise.
	(check_effective_target_vect_long): Likewise.
	(check_effective_target_vect_float): Likewise.
	(check_effective_target_vect_double): Likewise.
	(check_effective_target_vect_long_long): Likewise.
	(check_effective_target_vect_no_int_max): Likewise.
	(check_effective_target_vect_no_int_add): Likewise.
	(check_effective_target_vect_no_bitwise): Likewise.
	(check_effective_target_vect_widen_shift): Likewise.
	(check_effective_target_vect_no_align): Likewise.
	(check_effective_target_vect_hw_misalign): Likewise.
	(check_effective_target_vect_element_align): Likewise.
	(check_effective_target_vect_condition): Likewise.
	(check_effective_target_vect_cond_mixed): Likewise.
	(check_effective_target_vect_char_mult): Likewise.
	(check_effective_target_vect_short_mult): Likewise.
	(check_effective_target_vect_int_mult): Likewise.
	(check_effective_target_vect_extract_even_odd): Likewise.
	(check_effective_target_vect_interleave): Likewise.
	(check_effective_target_vect_stridedN): Likewise.
	(check_effective_target_vect_multiple_sizes): Likewise.
	(check_effective_target_vect64): Likewise.
	(check_effective_target_vect_call_copysignf): Likewise.
	(check_effective_target_vect_call_sqrtf): Likewise.
	(check_effective_target_vect_call_lrint): Likewise.
	(check_effective_target_vect_call_btrunc): Likewise.
	(check_effective_target_vect_call_btruncf): Likewise.
	(check_effective_target_vect_call_ceil): Likewise.
	(check_effective_target_vect_call_ceilf): Likewise.
	(check_effective_target_vect_call_floor): Likewise.
	(check_effective_target_vect_call_floorf): Likewise.
	(check_effective_target_vect_call_lceil): Likewise.
	(check_effective_target_vect_call_lfloor): Likewise.
	(check_effective_target_vect_call_nearbyint): Likewise.
	(check_effective_target_vect_call_nearbyintf): Likewise.
	(check_effective_target_vect_call_round): Likewise.
	(check_effective_target_vect_call_roundf): Likewise.
	(check_effective_target_vect_perm): Likewise, but also append *_saved
	to the existing global name to properly cache the result.
	(check_effective_target_vect_perm_byte): Likewise.
	(check_effective_target_vect_perm_short): Likewise.
	(check_effective_target_vect_widen_sum_hi_to_si_pattern): Likewise.
	(check_effective_target_vect_widen_sum_hi_to_si): Likewise.
	(check_effective_target_vect_widen_sum_qi_to_hi): Likewise.
	(check_effective_target_vect_widen_sum_qi_to_si): Likewise.
	(check_effective_target_vect_widen_mult_qi_to_hi_pattern): Likewise.
	(check_effective_target_vect_widen_mult_qi_to_hi): Likewise.
	(check_effective_target_vect_widen_mult_hi_to_si_pattern): Likewise.
	(check_effective_target_vect_widen_mult_si_to_di_pattern): Likewise.
	(check_effective_target_vect_sdot_qi): Likewise.
	(check_effective_target_vect_udot_qi): Likewise.
	(check_effective_target_vect_sdot_hi): Likewise.
	(check_effective_target_vect_udot_hi): Likewise.
	(check_effective_target_vect_usad_char): Likewise.
	(check_effective_target_vect_pack_trunc): Likewise.
	(check_effective_target_vect_unpack): Likewise.
	(check_effective_target_vect_aligned_arrays): Likewise.
	(check_effective_target_vect_natural_alignment): Likewise.
	(check_effective_target_vector_alignment_reachable): Likewise.
	(check_effective_target_vector_alignment_reachable_for_64bit): Likewise.
	(is-effective-target): Initialize et_index if undefined.
	(et-dg-runtest): New.
	(et-is-effective-target): Likewise.
	(check_vect_support_and_set_flags): Add supported MIPS targets to
	EFFECTIVE_TARGETS list.  Return the number of supported targets.

[-- Attachment #2: 0003-Add-support-to-run-auto-vectorization-tests-for-mult.patch --]
[-- Type: application/octet-stream, Size: 109016 bytes --]

From 6a3e8e0383aa9232c142e877248fb150faf0d23d Mon Sep 17 00:00:00 2001
From: Robert Suchanek <robert.suchanek@imgtec.com>
Date: Wed, 5 Aug 2015 16:47:06 +0100
Subject: [PATCH 3/4] Add support to run auto-vectorization tests for multiple
 effective targets.

---
 gcc/testsuite/g++.dg/vect/vect.exp              |   17 +-
 gcc/testsuite/gcc.dg/graphite/graphite.exp      |    7 +-
 gcc/testsuite/gcc.dg/vect/vect.exp              |  158 ++--
 gcc/testsuite/gfortran.dg/graphite/graphite.exp |    8 +-
 gcc/testsuite/gfortran.dg/vect/vect.exp         |   46 +-
 gcc/testsuite/lib/target-supports.exp           | 1106 ++++++++++++++---------
 6 files changed, 851 insertions(+), 491 deletions(-)

diff --git a/gcc/testsuite/g++.dg/vect/vect.exp b/gcc/testsuite/g++.dg/vect/vect.exp
index 0492cc3..18ccc17 100644
--- a/gcc/testsuite/g++.dg/vect/vect.exp
+++ b/gcc/testsuite/g++.dg/vect/vect.exp
@@ -39,6 +39,11 @@ set save-dg-do-what-default ${dg-do-what-default}
 global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS ""
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_TARGETS ""
+
 # These flags are used for all targets.
 lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fno-vect-cost-model"
 
@@ -58,10 +63,10 @@ lappend VECT_SLP_CFLAGS "-fdump-tree-slp-details"
 dg-init
 
 # Main loop.
-g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/{pr,simd}*.{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,simd}*.{c,cc,S} ]] "" $DEFAULT_VECTCFLAGS
+et-dg-runtest g++-dg-runtest [lsort [glob -nocomplain \
+	$srcdir/$subdir/slp-pr*.{c,cc,S} ]] "" $VECT_SLP_CFLAGS
 
 #### Tests with special options
 global SAVED_DEFAULT_VECTCFLAGS
@@ -70,8 +75,8 @@ set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
 # --param max-aliased-vops=0
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "--param max-aliased-vops=0"
-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
 
 # Clean up.
 set dg-do-what-default ${save-dg-do-what-default} 
diff --git a/gcc/testsuite/gcc.dg/graphite/graphite.exp b/gcc/testsuite/gcc.dg/graphite/graphite.exp
index 9e7ede6..5311329 100644
--- a/gcc/testsuite/gcc.dg/graphite/graphite.exp
+++ b/gcc/testsuite/gcc.dg/graphite/graphite.exp
@@ -37,6 +37,11 @@ set save-dg-do-what-default ${dg-do-what-default}
 # Initialize `dg'.
 dg-init
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_TARGETS ""
+
 set wait_to_run_files [lsort [glob -nocomplain $srcdir/$subdir/*.c ] ]
 set scop_files        [lsort [glob -nocomplain $srcdir/$subdir/scop-*.c ] ]
 set id_files          [lsort [glob -nocomplain $srcdir/$subdir/id-*.c ] ]
@@ -63,7 +68,7 @@ global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details -ffast-math"
 
 if [check_vect_support_and_set_flags] {
-    dg-runtest $vect_files        "" $DEFAULT_VECTCFLAGS
+    et-dg-runtest dg-runtest $vect_files        "" $DEFAULT_VECTCFLAGS
 }
 
 # 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..bd30d8a 100644
--- a/gcc/testsuite/gcc.dg/vect/vect.exp
+++ b/gcc/testsuite/gcc.dg/vect/vect.exp
@@ -24,6 +24,11 @@ load_lib clearcap.exp
 global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS ""
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_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 +67,15 @@ lappend O_VECTCFLAGS "-fdump-tree-vect-details"
 lappend DEFAULT_VECTCFLAGS "-O2"
 
 # 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
 
 # "-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
 
 set VECT_SLP_CFLAGS $DEFAULT_VECTCFLAGS
 
@@ -81,14 +88,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
 }
 
 #### Tests with special options
@@ -99,141 +110,164 @@ set SAVED_VECT_SLP_CFLAGS $VECT_SLP_CFLAGS
 # --param vect-max-version-for-alias-checks=0 tests
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=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
 
 # -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
 
 # -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-*.\[cS\]]]  \
-        "" $VECT_SLP_CFLAGS
+et-dg-runtest dg-runtest [lsort \
+	[glob -nocomplain $srcdir/$subdir/fast-math-bb-slp-*.\[cS\]]] \
+	"" $VECT_SLP_CFLAGS
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 # 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-anchors-*.\[cS\]]]  \
+et-dg-runtest dg-runtest [lsort \
+	[glob -nocomplain $srcdir/$subdir/aligned-section-anchors-*.\[cS\]]] \
 	"" $DEFAULT_VECTCFLAGS
 
 # -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
 
 # -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
 
 # -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-*.\[cS\]]]  \
+et-dg-runtest dg-runtest [lsort \
+	[glob -nocomplain $srcdir/$subdir/no-trapping-math-*.\[cS\]]] \
 	"" $DEFAULT_VECTCFLAGS
 
 # -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
 
 # -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
 
 # -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-*.\[cS\]]]  \
-        "" $DEFAULT_VECTCFLAGS
+et-dg-runtest dg-runtest [lsort \
+	[glob -nocomplain $srcdir/$subdir/no-scevccp-outer-*.\[cS\]]] \
+	"" $DEFAULT_VECTCFLAGS
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 # 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
 
 # With --param ggc-min-expand=0 --param ggc-min-heapsize=0 
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "--param" "ggc-min-expand=0" "--param" "ggc-min-heapsize=0"
-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
 
 # -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
 
 # With -O3.
 # Don't allow IPA cloning, because it throws our counts out of whack.
@@ -242,40 +276,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
 
 # 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
 
 # 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
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 
 # Clean up.
diff --git a/gcc/testsuite/gfortran.dg/graphite/graphite.exp b/gcc/testsuite/gfortran.dg/graphite/graphite.exp
index 1df46ea..d154ff0 100644
--- a/gcc/testsuite/gfortran.dg/graphite/graphite.exp
+++ b/gcc/testsuite/gfortran.dg/graphite/graphite.exp
@@ -52,9 +52,15 @@ gfortran-dg-runtest $id_files          "" "-O2 -fgraphite-identity -ffast-math"
 gfortran-dg-runtest $interchange_files "" "-O2 -floop-interchange -fno-loop-block -fno-loop-strip-mine -ffast-math -fdump-tree-graphite-all"
 gfortran-dg-runtest $block_files       "" "-O2 -floop-block -fno-loop-strip-mine -fno-loop-interchange -ffast-math -fdump-tree-graphite-all"
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_TARGETS ""
+
 # Vectorizer tests, to be run or compiled, depending on target capabilities.
 if [check_vect_support_and_set_flags] {
-    gfortran-dg-runtest $vect_files "" "-O2 -fgraphite-identity -ftree-vectorize -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 -fdump-tree-vect-details -ffast-math"
 }
 
 # Tests to be run.
diff --git a/gcc/testsuite/gfortran.dg/vect/vect.exp b/gcc/testsuite/gfortran.dg/vect/vect.exp
index e8f2b1c..466178d 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect.exp
+++ b/gcc/testsuite/gfortran.dg/vect/vect.exp
@@ -24,6 +24,11 @@ load_lib target-supports.exp
 global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS ""
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_TARGETS ""
+
 # These flags are used for all targets.
 lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model=unlimited" \
   "-fdump-tree-vect-details"
@@ -47,8 +52,10 @@ if ![check_vect_support_and_set_flags] {
 dg-init
 
 # 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\]{,90,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
 
 #### Tests with special options
 global SAVED_DEFAULT_VECTCFLAGS
@@ -57,44 +64,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
 
 # -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-real8*.\[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
 
 # -fvect-cost-model tests
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "-fvect-cost-model=dynamic"
-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
 
 # --param vect-max-version-for-alias-checks=0 tests
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=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
 
 # 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
 
 # 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
 
 # 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-copy-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
 
 # 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/target-supports.exp
index 1988301..661fa2f 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1445,6 +1445,47 @@ proc check_sse_hw_available { } {
     }]
 }
 
+# Return 1 if the target supports executing MIPS Paired-Single instructions,
+# 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.ps $f2,$f4,$f6");
+		return 0;
+	      }
+	    } ""
+	}
+    }]
+}
+
+# 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 <loongson.h>
+	      int main()
+	      {
+		asm volatile ("paddw $f2,$f4,$f6");
+		return 0;
+	      }
+	    } ""
+	}
+    }]
+}
+
 # Return 1 if the target supports executing SSE2 instructions, 0
 # otherwise.  Cache the result.
 
@@ -1514,6 +1555,27 @@ proc check_effective_target_sse2_runtime { } {
     return 0
 }
 
+# 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 otherwise.
+
+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 AVX executables, 0 otherwise.
 
 proc check_effective_target_avx_runtime { } {
@@ -2229,11 +2291,12 @@ proc check_effective_target_vect_cmdline_needed { } {
 
 proc check_effective_target_vect_int { } {
     global et_vect_int_saved
+    global et_index
 
-    if [info exists et_vect_int_saved] {
+    if [info exists et_vect_int_saved($et_index)] {
 	verbose "check_effective_target_vect_int: using cached result" 2
     } else {
-	set et_vect_int_saved 0
+	set et_vect_int_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
              || ([istarget powerpc*-*-*]
                   && ![istarget powerpc-*-linux*paired*])
@@ -2244,13 +2307,14 @@ proc check_effective_target_vect_int { } {
 	      || [istarget aarch64*-*-*]
 	      || [check_effective_target_arm32]
 	      || ([istarget mips*-*-*]
-		  && [check_effective_target_mips_loongson]) } {
-	   set et_vect_int_saved 1
+		  && [et-is-effective-target mips_loongson]) } {
+	    set et_vect_int_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_int: returning $et_vect_int_saved" 2
-    return $et_vect_int_saved
+    verbose "check_effective_target_vect_int:\
+	     returning $et_vect_int_saved($et_index)" 2
+    return $et_vect_int_saved($et_index)
 }
 
 # Return 1 if the target supports signed int->float conversion 
@@ -2258,22 +2322,25 @@ proc check_effective_target_vect_int { } {
 
 proc check_effective_target_vect_intfloat_cvt { } {
     global et_vect_intfloat_cvt_saved
+    global et_index
 
-    if [info exists et_vect_intfloat_cvt_saved] {
-        verbose "check_effective_target_vect_intfloat_cvt: using cached result" 2
+    if [info exists et_vect_intfloat_cvt_saved($et_index)] {
+        verbose "check_effective_target_vect_intfloat_cvt:\
+		 using cached result" 2
     } else {
-        set et_vect_intfloat_cvt_saved 0
+	set et_vect_intfloat_cvt_saved($et_index) 0
         if { [istarget i?86-*-*] || [istarget x86_64-*-*]
               || ([istarget powerpc*-*-*]
                    && ![istarget powerpc-*-linux*paired*])
               || ([istarget arm*-*-*]
                   && [check_effective_target_arm_neon_ok])} {
-           set et_vect_intfloat_cvt_saved 1
+	   set et_vect_intfloat_cvt_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_intfloat_cvt: returning $et_vect_intfloat_cvt_saved" 2
-    return $et_vect_intfloat_cvt_saved
+    verbose "check_effective_target_vect_intfloat_cvt:\
+	     returning $et_vect_intfloat_cvt_saved($et_index)" 2
+    return $et_vect_intfloat_cvt_saved($et_index)
 }
 
 #Return 1 if we're supporting __int128 for target, 0 otherwise.
@@ -2295,23 +2362,26 @@ proc check_effective_target_int128 { } {
 
 proc check_effective_target_vect_uintfloat_cvt { } {
     global et_vect_uintfloat_cvt_saved
+    global et_index
 
-    if [info exists et_vect_uintfloat_cvt_saved] {
-        verbose "check_effective_target_vect_uintfloat_cvt: using cached result" 2
+    if [info exists et_vect_uintfloat_cvt_saved($et_index)] {
+        verbose "check_effective_target_vect_uintfloat_cvt:\
+		 using cached result" 2
     } else {
-        set et_vect_uintfloat_cvt_saved 0
+	set et_vect_uintfloat_cvt_saved($et_index) 0
         if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	      || ([istarget powerpc*-*-*]
 		  && ![istarget powerpc-*-linux*paired*])
 	      || [istarget aarch64*-*-*]
 	      || ([istarget arm*-*-*]
 		  && [check_effective_target_arm_neon_ok])} {
-           set et_vect_uintfloat_cvt_saved 1
+	   set et_vect_uintfloat_cvt_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_uintfloat_cvt: returning $et_vect_uintfloat_cvt_saved" 2
-    return $et_vect_uintfloat_cvt_saved
+    verbose "check_effective_target_vect_uintfloat_cvt:\
+	     returning $et_vect_uintfloat_cvt_saved($et_index)" 2
+    return $et_vect_uintfloat_cvt_saved($et_index)
 }
 
 
@@ -2320,22 +2390,25 @@ proc check_effective_target_vect_uintfloat_cvt { } {
 
 proc check_effective_target_vect_floatint_cvt { } {
     global et_vect_floatint_cvt_saved
+    global et_index
 
-    if [info exists et_vect_floatint_cvt_saved] {
-        verbose "check_effective_target_vect_floatint_cvt: using cached result" 2
+    if [info exists et_vect_floatint_cvt_saved($et_index)] {
+        verbose "check_effective_target_vect_floatint_cvt:\
+		 using cached result" 2
     } else {
-        set et_vect_floatint_cvt_saved 0
+	set et_vect_floatint_cvt_saved($et_index) 0
         if { [istarget i?86-*-*] || [istarget x86_64-*-*]
               || ([istarget powerpc*-*-*]
                    && ![istarget powerpc-*-linux*paired*])
               || ([istarget arm*-*-*]
                   && [check_effective_target_arm_neon_ok])} {
-           set et_vect_floatint_cvt_saved 1
+	   set et_vect_floatint_cvt_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_floatint_cvt: returning $et_vect_floatint_cvt_saved" 2
-    return $et_vect_floatint_cvt_saved
+    verbose "check_effective_target_vect_floatint_cvt:\
+	     returning $et_vect_floatint_cvt_saved($et_index)" 2
+    return $et_vect_floatint_cvt_saved($et_index)
 }
 
 # Return 1 if the target supports unsigned float->int conversion
@@ -2343,21 +2416,24 @@ proc check_effective_target_vect_floatint_cvt { } {
 
 proc check_effective_target_vect_floatuint_cvt { } {
     global et_vect_floatuint_cvt_saved
+    global et_index
 
-    if [info exists et_vect_floatuint_cvt_saved] {
-        verbose "check_effective_target_vect_floatuint_cvt: using cached result" 2
+    if [info exists et_vect_floatuint_cvt_saved($et_index)] {
+        verbose "check_effective_target_vect_floatuint_cvt:\
+		 using cached result" 2
     } else {
-        set et_vect_floatuint_cvt_saved 0
+	set et_vect_floatuint_cvt_saved($et_index) 0
         if { ([istarget powerpc*-*-*]
 	      && ![istarget powerpc-*-linux*paired*])
 	    || ([istarget arm*-*-*]
-	        && [check_effective_target_arm_neon_ok])} {
-           set et_vect_floatuint_cvt_saved 1
+		&& [check_effective_target_arm_neon_ok])} {
+	   set et_vect_floatuint_cvt_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_floatuint_cvt: returning $et_vect_floatuint_cvt_saved" 2
-    return $et_vect_floatuint_cvt_saved
+    verbose "check_effective_target_vect_floatuint_cvt:\
+	     returning $et_vect_floatuint_cvt_saved($et_index)" 2
+    return $et_vect_floatuint_cvt_saved($et_index)
 }
 
 # Return 1 if the target supports #pragma omp declare simd, 0 otherwise.
@@ -2366,24 +2442,26 @@ proc check_effective_target_vect_floatuint_cvt { } {
 
 proc check_effective_target_vect_simd_clones { } {
     global et_vect_simd_clones_saved
+    global et_index
 
-    if [info exists et_vect_simd_clones_saved] {
+    if [info exists et_vect_simd_clones_saved($et_index)] {
 	verbose "check_effective_target_vect_simd_clones: using cached result" 2
     } else {
-	set et_vect_simd_clones_saved 0
+	set et_vect_simd_clones_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*] } {
 	    # On i?86/x86_64 #pragma omp declare simd builds a sse2, avx and
 	    # avx2 clone.  Only the right clone for the specified arch will be
 	    # chosen, but still we need to at least be able to assemble
 	    # avx2.
 	    if { [check_effective_target_avx2] } {
-		set et_vect_simd_clones_saved 1
+		set et_vect_simd_clones_saved($et_index) 1
 	    }
 	}
     }
 
-    verbose "check_effective_target_vect_simd_clones: returning $et_vect_simd_clones_saved" 2
-    return $et_vect_simd_clones_saved
+    verbose "check_effective_target_vect_simd_clones:\
+	     returning $et_vect_simd_clones_saved($et_index)" 2
+    return $et_vect_simd_clones_saved($et_index)
 }
 
 # Return 1 if this is a AArch64 target supporting big endian
@@ -3090,6 +3168,15 @@ proc check_effective_target_arm_neonv2 { } {
     }
 }
 
+# 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"
+}
+
 # Return 1 if this a Loongson-2E or -2F target using an ABI that supports
 # the Loongson vector modes.
 
@@ -3509,11 +3596,12 @@ proc check_effective_target_sparc_vis { } {
 
 proc check_effective_target_vect_shift { } {
     global et_vect_shift_saved
+    global et_index
 
-    if [info exists et_vect_shift_saved] {
+    if [info exists et_vect_shift_saved($et_index)] {
 	verbose "check_effective_target_vect_shift: using cached result" 2
     } else {
-	set et_vect_shift_saved 0
+	set et_vect_shift_saved($et_index) 0
 	if { ([istarget powerpc*-*-*]
              && ![istarget powerpc-*-linux*paired*])
 	     || [istarget ia64-*-*]
@@ -3521,13 +3609,14 @@ proc check_effective_target_vect_shift { } {
 	     || [istarget aarch64*-*-*]
 	     || [check_effective_target_arm32]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mips_loongson]) } {
-	   set et_vect_shift_saved 1
+		&& [et-is-effective-target mips_loongson]) } {
+	   set et_vect_shift_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_shift: returning $et_vect_shift_saved" 2
-    return $et_vect_shift_saved
+    verbose "check_effective_target_vect_shift:\
+	     returning $et_vect_shift_saved($et_index)" 2
+    return $et_vect_shift_saved($et_index)
 }
 
 proc check_effective_target_whole_vector_shift { } {
@@ -3537,7 +3626,7 @@ proc check_effective_target_whole_vector_shift { } {
 	 || ([check_effective_target_arm32]
 	     && [check_effective_target_arm_little_endian])
 	 || ([istarget mips*-*-*]
-	     && [check_effective_target_mips_loongson]) } {
+	     && [et-is-effective-target mips_loongson]) } {
 	set answer 1
     } else {
 	set answer 0
@@ -3551,41 +3640,45 @@ proc check_effective_target_whole_vector_shift { } {
 
 proc check_effective_target_vect_bswap { } {
     global et_vect_bswap_saved
+    global et_index
 
-    if [info exists et_vect_bswap_saved] {
+    if [info exists et_vect_bswap_saved($et_index)] {
 	verbose "check_effective_target_vect_bswap: using cached result" 2
     } else {
-	set et_vect_bswap_saved 0
+	set et_vect_bswap_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
              || ([istarget arm*-*-*]
                 && [check_effective_target_arm_neon])
 	   } {
-	   set et_vect_bswap_saved 1
+	   set et_vect_bswap_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_bswap: returning $et_vect_bswap_saved" 2
-    return $et_vect_bswap_saved
+    verbose "check_effective_target_vect_bswap:\
+	     returning $et_vect_bswap_saved($et_index)" 2
+    return $et_vect_bswap_saved($et_index)
 }
 
 # Return 1 if the target supports hardware vector shift operation for char.
 
 proc check_effective_target_vect_shift_char { } {
     global et_vect_shift_char_saved
+    global et_index
 
-    if [info exists et_vect_shift_char_saved] {
+    if [info exists et_vect_shift_char_saved($et_index)] {
 	verbose "check_effective_target_vect_shift_char: using cached result" 2
     } else {
-	set et_vect_shift_char_saved 0
+	set et_vect_shift_char_saved($et_index) 0
 	if { ([istarget powerpc*-*-*]
              && ![istarget powerpc-*-linux*paired*])
 	     || [check_effective_target_arm32] } {
-	   set et_vect_shift_char_saved 1
+	   set et_vect_shift_char_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_shift_char: returning $et_vect_shift_char_saved" 2
-    return $et_vect_shift_char_saved
+    verbose "check_effective_target_vect_shift_char:\
+	     returning $et_vect_shift_char_saved($et_index)" 2
+    return $et_vect_shift_char_saved($et_index)
 }
 
 # Return 1 if the target supports hardware vectors of long, 0 otherwise.
@@ -3614,11 +3707,12 @@ proc check_effective_target_vect_long { } {
 
 proc check_effective_target_vect_float { } {
     global et_vect_float_saved
+    global et_index
 
-    if [info exists et_vect_float_saved] {
+    if [info exists et_vect_float_saved($et_index)] {
 	verbose "check_effective_target_vect_float: using cached result" 2
     } else {
-	set et_vect_float_saved 0
+	set et_vect_float_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	      || [istarget powerpc*-*-*]
 	      || [istarget spu-*-*]
@@ -3627,12 +3721,13 @@ proc check_effective_target_vect_float { } {
 	      || [istarget ia64-*-*]
 	      || [istarget aarch64*-*-*]
 	      || [check_effective_target_arm32] } {
-	   set et_vect_float_saved 1
+	   set et_vect_float_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_float: returning $et_vect_float_saved" 2
-    return $et_vect_float_saved
+    verbose "check_effective_target_vect_float:\
+	     returning $et_vect_float_saved($et_index)" 2
+    return $et_vect_float_saved($et_index)
 }
 
 # Return 1 if the target supports hardware vectors of double, 0 otherwise.
@@ -3641,11 +3736,12 @@ proc check_effective_target_vect_float { } {
 
 proc check_effective_target_vect_double { } {
     global et_vect_double_saved
+    global et_index
 
-    if [info exists et_vect_double_saved] {
+    if [info exists et_vect_double_saved($et_index)] {
 	verbose "check_effective_target_vect_double: using cached result" 2
     } else {
-	set et_vect_double_saved 0
+	set et_vect_double_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget aarch64*-*-*] } {
 	   if { [check_no_compiler_messages vect_double assembly {
@@ -3653,17 +3749,18 @@ proc check_effective_target_vect_double { } {
 		 # error No double vectorizer support.
 		 #endif
 		}] } {
-		set et_vect_double_saved 1
+		set et_vect_double_saved($et_index) 1
 	    } else {
-		set et_vect_double_saved 0
+		set et_vect_double_saved($et_index) 0
 	    }
 	} elseif { [istarget spu-*-*] } {
-	   set et_vect_double_saved 1
+	   set et_vect_double_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_double: returning $et_vect_double_saved" 2
-    return $et_vect_double_saved
+    verbose "check_effective_target_vect_double:\
+	     returning $et_vect_double_saved($et_index)" 2
+    return $et_vect_double_saved($et_index)
 }
 
 # Return 1 if the target supports hardware vectors of long long, 0 otherwise.
@@ -3672,18 +3769,20 @@ proc check_effective_target_vect_double { } {
 
 proc check_effective_target_vect_long_long { } {
     global et_vect_long_long_saved
+    global et_index
 
-    if [info exists et_vect_long_long_saved] {
+    if [info exists et_vect_long_long_saved($et_index)] {
         verbose "check_effective_target_vect_long_long: using cached result" 2
     } else {
-        set et_vect_long_long_saved 0
-        if { [istarget i?86-*-*] || [istarget x86_64-*-*] } {
-           set et_vect_long_long_saved 1
+	set et_vect_long_long_saved($et_index) 0
+	if { [istarget i?86-*-*] || [istarget x86_64-*-*] } {
+	   set et_vect_long_long_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_long_long: returning $et_vect_long_long_saved" 2
-    return $et_vect_long_long_saved
+    verbose "check_effective_target_vect_long_long:\
+	     returning $et_vect_long_long_saved($et_index)" 2
+    return $et_vect_long_long_saved($et_index)
 }
 
 
@@ -3694,21 +3793,23 @@ proc check_effective_target_vect_long_long { } {
 
 proc check_effective_target_vect_no_int_max { } {
     global et_vect_no_int_max_saved
+    global et_index
 
-    if [info exists et_vect_no_int_max_saved] {
+    if [info exists et_vect_no_int_max_saved($et_index)] {
 	verbose "check_effective_target_vect_no_int_max: using cached result" 2
     } else {
-	set et_vect_no_int_max_saved 0
+	set et_vect_no_int_max_saved($et_index) 0
 	if { [istarget sparc*-*-*]
 	     || [istarget spu-*-*]
 	     || [istarget alpha*-*-*]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mips_loongson]) } {
-	    set et_vect_no_int_max_saved 1
+		 && [et-is-effective-target mips_loongson]) } {
+	    set et_vect_no_int_max_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_no_int_max: returning $et_vect_no_int_max_saved" 2
-    return $et_vect_no_int_max_saved
+    verbose "check_effective_target_vect_no_int_max:\
+	     returning $et_vect_no_int_max_saved($et_index)" 2
+    return $et_vect_no_int_max_saved($et_index)
 }
 
 # Return 1 if the target plus current options does not support a vector
@@ -3718,18 +3819,20 @@ proc check_effective_target_vect_no_int_max { } {
 
 proc check_effective_target_vect_no_int_add { } {
     global et_vect_no_int_add_saved
+    global et_index
 
-    if [info exists et_vect_no_int_add_saved] {
+    if [info exists et_vect_no_int_add_saved($et_index)] {
 	verbose "check_effective_target_vect_no_int_add: using cached result" 2
     } else {
-	set et_vect_no_int_add_saved 0
+	set et_vect_no_int_add_saved($et_index) 0
 	# Alpha only supports vector add on V8QI and V4HI.
 	if { [istarget alpha*-*-*] } {
-	    set et_vect_no_int_add_saved 1
+	    set et_vect_no_int_add_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_no_int_add: returning $et_vect_no_int_add_saved" 2
-    return $et_vect_no_int_add_saved
+    verbose "check_effective_target_vect_no_int_add:\
+	     returning $et_vect_no_int_add_saved($et_index)" 2
+    return $et_vect_no_int_add_saved($et_index)
 }
 
 # Return 1 if the target plus current options does not support vector
@@ -3739,14 +3842,16 @@ proc check_effective_target_vect_no_int_add { } {
 
 proc check_effective_target_vect_no_bitwise { } {
     global et_vect_no_bitwise_saved
+    global et_index
 
-    if [info exists et_vect_no_bitwise_saved] {
+    if [info exists et_vect_no_bitwise_saved($et_index)] {
 	verbose "check_effective_target_vect_no_bitwise: using cached result" 2
     } else {
-	set et_vect_no_bitwise_saved 0
+	set et_vect_no_bitwise_saved($et_index) 0
     }
-    verbose "check_effective_target_vect_no_bitwise: returning $et_vect_no_bitwise_saved" 2
-    return $et_vect_no_bitwise_saved
+    verbose "check_effective_target_vect_no_bitwise:\
+	     returning $et_vect_no_bitwise_saved($et_index)" 2
+    return $et_vect_no_bitwise_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports vector permutation,
@@ -3755,24 +3860,26 @@ proc check_effective_target_vect_no_bitwise { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_perm { } {
-    global et_vect_perm
+    global et_vect_perm_saved
+    global et_index
 
-    if [info exists et_vect_perm_saved] {
+    if [info exists et_vect_perm_saved($et_index)] {
         verbose "check_effective_target_vect_perm: using cached result" 2
     } else {
-        set et_vect_perm_saved 0
+	set et_vect_perm_saved($et_index) 0
         if { [is-effective-target arm_neon_ok]
 	     || [istarget aarch64*-*-*]
 	     || [istarget powerpc*-*-*]
              || [istarget spu-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mpaired_single]) } {
-            set et_vect_perm_saved 1
+		 && [et-is-effective-target mpaired_single]) } {
+	    set et_vect_perm_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_perm: returning $et_vect_perm_saved" 2
-    return $et_vect_perm_saved
+    verbose "check_effective_target_vect_perm:\
+	     returning $et_vect_perm_saved($et_index)" 2
+    return $et_vect_perm_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports vector permutation
@@ -3781,23 +3888,25 @@ proc check_effective_target_vect_perm { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_perm_byte { } {
-    global et_vect_perm_byte
+    global et_vect_perm_byte_saved
+    global et_index
 
-    if [info exists et_vect_perm_byte_saved] {
+    if [info exists et_vect_perm_byte_saved($et_index)] {
         verbose "check_effective_target_vect_perm_byte: using cached result" 2
     } else {
-        set et_vect_perm_byte_saved 0
+	set et_vect_perm_byte_saved($et_index) 0
         if { ([is-effective-target arm_neon_ok]
 	      && [is-effective-target arm_little_endian])
 	     || ([istarget aarch64*-*-*]
 		 && [is-effective-target aarch64_little_endian])
 	     || [istarget powerpc*-*-*]
              || [istarget spu-*-*] } {
-            set et_vect_perm_byte_saved 1
+	    set et_vect_perm_byte_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_perm_byte: returning $et_vect_perm_byte_saved" 2
-    return $et_vect_perm_byte_saved
+    verbose "check_effective_target_vect_perm_byte:\
+	     returning $et_vect_perm_byte_saved($et_index)" 2
+    return $et_vect_perm_byte_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports vector permutation
@@ -3806,23 +3915,25 @@ proc check_effective_target_vect_perm_byte { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_perm_short { } {
-    global et_vect_perm_short
+    global et_vect_perm_short_saved
+    global et_index
 
-    if [info exists et_vect_perm_short_saved] {
+    if [info exists et_vect_perm_short_saved($et_index)] {
         verbose "check_effective_target_vect_perm_short: using cached result" 2
     } else {
-        set et_vect_perm_short_saved 0
+	set et_vect_perm_short_saved($et_index) 0
         if { ([is-effective-target arm_neon_ok]
 	      && [is-effective-target arm_little_endian])
 	     || ([istarget aarch64*-*-*]
 		 && [is-effective-target aarch64_little_endian])
 	     || [istarget powerpc*-*-*]
              || [istarget spu-*-*] } {
-            set et_vect_perm_short_saved 1
+	    set et_vect_perm_short_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_perm_short: returning $et_vect_perm_short_saved" 2
-    return $et_vect_perm_short_saved
+    verbose "check_effective_target_vect_perm_short:\
+	     returning $et_vect_perm_short_saved($et_index)" 2
+    return $et_vect_perm_short_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -3831,19 +3942,22 @@ proc check_effective_target_vect_perm_short { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_widen_sum_hi_to_si_pattern { } {
-    global et_vect_widen_sum_hi_to_si_pattern
+    global et_vect_widen_sum_hi_to_si_pattern_saved
+    global et_index
 
-    if [info exists et_vect_widen_sum_hi_to_si_pattern_saved] {
-        verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern: using cached result" 2
+    if [info exists et_vect_widen_sum_hi_to_si_pattern_saved($et_index)] {
+        verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_sum_hi_to_si_pattern_saved 0
+        set et_vect_widen_sum_hi_to_si_pattern_saved($et_index) 0
         if { [istarget powerpc*-*-*]
              || [istarget ia64-*-*] } {
-            set et_vect_widen_sum_hi_to_si_pattern_saved 1
+            set et_vect_widen_sum_hi_to_si_pattern_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern: returning $et_vect_widen_sum_hi_to_si_pattern_saved" 2
-    return $et_vect_widen_sum_hi_to_si_pattern_saved
+    verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern:\
+	     returning $et_vect_widen_sum_hi_to_si_pattern_saved($et_index)" 2
+    return $et_vect_widen_sum_hi_to_si_pattern_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -3854,19 +3968,23 @@ proc check_effective_target_vect_widen_sum_hi_to_si_pattern { } {
 # This won't change for different subtargets so cache the result.
                                                                                                 
 proc check_effective_target_vect_widen_sum_hi_to_si { } {
-    global et_vect_widen_sum_hi_to_si
+    global et_vect_widen_sum_hi_to_si_saved
+    global et_index
 
-    if [info exists et_vect_widen_sum_hi_to_si_saved] {
-        verbose "check_effective_target_vect_widen_sum_hi_to_si: using cached result" 2
+    if [info exists et_vect_widen_sum_hi_to_si_saved($et_index)] {
+        verbose "check_effective_target_vect_widen_sum_hi_to_si:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_sum_hi_to_si_saved [check_effective_target_vect_unpack]
+        set et_vect_widen_sum_hi_to_si_saved($et_index) \
+	    [check_effective_target_vect_unpack]
         if { [istarget powerpc*-*-*] 
 	     || [istarget ia64-*-*] } {
-            set et_vect_widen_sum_hi_to_si_saved 1
+            set et_vect_widen_sum_hi_to_si_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_sum_hi_to_si: returning $et_vect_widen_sum_hi_to_si_saved" 2
-    return $et_vect_widen_sum_hi_to_si_saved
+    verbose "check_effective_target_vect_widen_sum_hi_to_si:\
+	     returning $et_vect_widen_sum_hi_to_si_saved($et_index)" 2
+    return $et_vect_widen_sum_hi_to_si_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -3877,20 +3995,23 @@ proc check_effective_target_vect_widen_sum_hi_to_si { } {
 # This won't change for different subtargets so cache the result.
                                                                                                 
 proc check_effective_target_vect_widen_sum_qi_to_hi { } {
-    global et_vect_widen_sum_qi_to_hi
+    global et_vect_widen_sum_qi_to_hi_saved
+    global et_index
 
-    if [info exists et_vect_widen_sum_qi_to_hi_saved] {
-        verbose "check_effective_target_vect_widen_sum_qi_to_hi: using cached result" 2
+    if [info exists et_vect_widen_sum_qi_to_hi_saved($et_index)] {
+        verbose "check_effective_target_vect_widen_sum_qi_to_hi:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_sum_qi_to_hi_saved 0
+        set et_vect_widen_sum_qi_to_hi_saved($et_index) 0
 	if { [check_effective_target_vect_unpack] 
 	     || [check_effective_target_arm_neon_ok]
 	     || [istarget ia64-*-*] } {
-            set et_vect_widen_sum_qi_to_hi_saved 1
+            set et_vect_widen_sum_qi_to_hi_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_widen_sum_qi_to_hi: returning $et_vect_widen_sum_qi_to_hi_saved" 2
-    return $et_vect_widen_sum_qi_to_hi_saved
+    verbose "check_effective_target_vect_widen_sum_qi_to_hi:\
+	     returning $et_vect_widen_sum_qi_to_hi_saved($et_index)" 2
+    return $et_vect_widen_sum_qi_to_hi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -3899,18 +4020,21 @@ proc check_effective_target_vect_widen_sum_qi_to_hi { } {
 # This won't change for different subtargets so cache the result.
                                                                                                 
 proc check_effective_target_vect_widen_sum_qi_to_si { } {
-    global et_vect_widen_sum_qi_to_si
+    global et_vect_widen_sum_qi_to_si_saved
+    global et_index
 
-    if [info exists et_vect_widen_sum_qi_to_si_saved] {
-        verbose "check_effective_target_vect_widen_sum_qi_to_si: using cached result" 2
+    if [info exists et_vect_widen_sum_qi_to_si_saved($et_index)] {
+        verbose "check_effective_target_vect_widen_sum_qi_to_si:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_sum_qi_to_si_saved 0
+        set et_vect_widen_sum_qi_to_si_saved($et_index) 0
         if { [istarget powerpc*-*-*] } {
-            set et_vect_widen_sum_qi_to_si_saved 1
+            set et_vect_widen_sum_qi_to_si_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_sum_qi_to_si: returning $et_vect_widen_sum_qi_to_si_saved" 2
-    return $et_vect_widen_sum_qi_to_si_saved
+    verbose "check_effective_target_vect_widen_sum_qi_to_si:\
+	     returning $et_vect_widen_sum_qi_to_si_saved($et_index)" 2
+    return $et_vect_widen_sum_qi_to_si_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -3923,25 +4047,28 @@ proc check_effective_target_vect_widen_sum_qi_to_si { } {
 
 
 proc check_effective_target_vect_widen_mult_qi_to_hi { } {
-    global et_vect_widen_mult_qi_to_hi
+    global et_vect_widen_mult_qi_to_hi_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_qi_to_hi_saved] {
-        verbose "check_effective_target_vect_widen_mult_qi_to_hi: using cached result" 2
+    if [info exists et_vect_widen_mult_qi_to_hi_saved($et_index)] {
+        verbose "check_effective_target_vect_widen_mult_qi_to_hi:\
+		 using cached result" 2
     } else {
 	if { [check_effective_target_vect_unpack]
 	     && [check_effective_target_vect_short_mult] } {
-	    set et_vect_widen_mult_qi_to_hi_saved 1
+	    set et_vect_widen_mult_qi_to_hi_saved($et_index) 1
 	} else {
-	    set et_vect_widen_mult_qi_to_hi_saved 0
+	    set et_vect_widen_mult_qi_to_hi_saved($et_index) 0
 	}
         if { [istarget powerpc*-*-*]
               || [istarget aarch64*-*-*]
               || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } {
-            set et_vect_widen_mult_qi_to_hi_saved 1
+            set et_vect_widen_mult_qi_to_hi_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_qi_to_hi: returning $et_vect_widen_mult_qi_to_hi_saved" 2
-    return $et_vect_widen_mult_qi_to_hi_saved
+    verbose "check_effective_target_vect_widen_mult_qi_to_hi:\
+	     returning $et_vect_widen_mult_qi_to_hi_saved($et_index)" 2
+    return $et_vect_widen_mult_qi_to_hi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -3954,28 +4081,32 @@ proc check_effective_target_vect_widen_mult_qi_to_hi { } {
 
 
 proc check_effective_target_vect_widen_mult_hi_to_si { } {
-    global et_vect_widen_mult_hi_to_si
+    global et_vect_widen_mult_hi_to_si_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_hi_to_si_saved] {
-        verbose "check_effective_target_vect_widen_mult_hi_to_si: using cached result" 2
+    if [info exists et_vect_widen_mult_hi_to_si_saved($et_index)] {
+        verbose "check_effective_target_vect_widen_mult_hi_to_si:\
+		 using cached result" 2
     } else {
         if { [check_effective_target_vect_unpack]
              && [check_effective_target_vect_int_mult] } {
-          set et_vect_widen_mult_hi_to_si_saved 1
+          set et_vect_widen_mult_hi_to_si_saved($et_index) 1
         } else {
-          set et_vect_widen_mult_hi_to_si_saved 0
+          set et_vect_widen_mult_hi_to_si_saved($et_index) 0
         }
         if { [istarget powerpc*-*-*]
 	      || [istarget spu-*-*]
 	      || [istarget ia64-*-*]
 	      || [istarget aarch64*-*-*]
 	      || [istarget i?86-*-*] || [istarget x86_64-*-*]
-              || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } {
-            set et_vect_widen_mult_hi_to_si_saved 1
+              || ([istarget arm*-*-*]
+		  && [check_effective_target_arm_neon_ok]) } {
+            set et_vect_widen_mult_hi_to_si_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_hi_to_si: returning $et_vect_widen_mult_hi_to_si_saved" 2
-    return $et_vect_widen_mult_hi_to_si_saved
+    verbose "check_effective_target_vect_widen_mult_hi_to_si:\
+	     returning $et_vect_widen_mult_hi_to_si_saved($et_index)" 2
+    return $et_vect_widen_mult_hi_to_si_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -3984,21 +4115,24 @@ proc check_effective_target_vect_widen_mult_hi_to_si { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_widen_mult_qi_to_hi_pattern { } {
-    global et_vect_widen_mult_qi_to_hi_pattern
+    global et_vect_widen_mult_qi_to_hi_pattern_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_qi_to_hi_pattern_saved] {
-        verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern: using cached result" 2
+    if [info exists et_vect_widen_mult_qi_to_hi_pattern_saved($et_index)] {
+        verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_mult_qi_to_hi_pattern_saved 0
+        set et_vect_widen_mult_qi_to_hi_pattern_saved($et_index) 0
         if { [istarget powerpc*-*-*]
               || ([istarget arm*-*-*]
 		  && [check_effective_target_arm_neon_ok]
 		  && [check_effective_target_arm_little_endian]) } {
-            set et_vect_widen_mult_qi_to_hi_pattern_saved 1
+            set et_vect_widen_mult_qi_to_hi_pattern_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern: returning $et_vect_widen_mult_qi_to_hi_pattern_saved" 2
-    return $et_vect_widen_mult_qi_to_hi_pattern_saved
+    verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern:\
+	     returning $et_vect_widen_mult_qi_to_hi_pattern_saved($et_index)" 2
+    return $et_vect_widen_mult_qi_to_hi_pattern_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4007,12 +4141,14 @@ proc check_effective_target_vect_widen_mult_qi_to_hi_pattern { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } {
-    global et_vect_widen_mult_hi_to_si_pattern
+    global et_vect_widen_mult_hi_to_si_pattern_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_hi_to_si_pattern_saved] {
-        verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern: using cached result" 2
+    if [info exists et_vect_widen_mult_hi_to_si_pattern_saved($et_index)] {
+        verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_mult_hi_to_si_pattern_saved 0
+        set et_vect_widen_mult_hi_to_si_pattern_saved($et_index) 0
         if { [istarget powerpc*-*-*]
               || [istarget spu-*-*]
               || [istarget ia64-*-*]
@@ -4020,11 +4156,12 @@ proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } {
               || ([istarget arm*-*-*]
 		  && [check_effective_target_arm_neon_ok]
 		  && [check_effective_target_arm_little_endian]) } {
-            set et_vect_widen_mult_hi_to_si_pattern_saved 1
+            set et_vect_widen_mult_hi_to_si_pattern_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern: returning $et_vect_widen_mult_hi_to_si_pattern_saved" 2
-    return $et_vect_widen_mult_hi_to_si_pattern_saved
+    verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern:\
+	     returning $et_vect_widen_mult_hi_to_si_pattern_saved($et_index)" 2
+    return $et_vect_widen_mult_hi_to_si_pattern_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4033,19 +4170,22 @@ proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_widen_mult_si_to_di_pattern { } {
-    global et_vect_widen_mult_si_to_di_pattern
+    global et_vect_widen_mult_si_to_di_pattern_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_si_to_di_pattern_saved] {
-        verbose "check_effective_target_vect_widen_mult_si_to_di_pattern: using cached result" 2
+    if [info exists et_vect_widen_mult_si_to_di_pattern_saved($et_index)] {
+        verbose "check_effective_target_vect_widen_mult_si_to_di_pattern:\
+		 using cached result" 2
     } else {
-	set et_vect_widen_mult_si_to_di_pattern_saved 0
+	set et_vect_widen_mult_si_to_di_pattern_saved($et_index) 0
         if {[istarget ia64-*-*]
 	    || [istarget i?86-*-*] || [istarget x86_64-*-*] } {
-            set et_vect_widen_mult_si_to_di_pattern_saved 1
+            set et_vect_widen_mult_si_to_di_pattern_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_si_to_di_pattern: returning $et_vect_widen_mult_si_to_di_pattern_saved" 2
-    return $et_vect_widen_mult_si_to_di_pattern_saved
+    verbose "check_effective_target_vect_widen_mult_si_to_di_pattern:\
+	     returning $et_vect_widen_mult_si_to_di_pattern_saved($et_index)" 2
+    return $et_vect_widen_mult_si_to_di_pattern_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4055,17 +4195,19 @@ proc check_effective_target_vect_widen_mult_si_to_di_pattern { } {
 
 proc check_effective_target_vect_widen_shift { } {
     global et_vect_widen_shift_saved
+    global et_index
 
-    if [info exists et_vect_shift_saved] {
+    if [info exists et_vect_shift_saved($et_index)] {
         verbose "check_effective_target_vect_widen_shift: using cached result" 2
     } else {
-        set et_vect_widen_shift_saved 0
+        set et_vect_widen_shift_saved($et_index) 0
         if { ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } {
-            set et_vect_widen_shift_saved 1
+            set et_vect_widen_shift_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_shift: returning $et_vect_widen_shift_saved" 2
-    return $et_vect_widen_shift_saved
+    verbose "check_effective_target_vect_widen_shift:\
+	     returning $et_vect_widen_shift_saved($et_index)" 2
+    return $et_vect_widen_shift_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4074,18 +4216,20 @@ proc check_effective_target_vect_widen_shift { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_sdot_qi { } {
-    global et_vect_sdot_qi
+    global et_vect_sdot_qi_saved
+    global et_index
 
-    if [info exists et_vect_sdot_qi_saved] {
+    if [info exists et_vect_sdot_qi_saved($et_index)] {
         verbose "check_effective_target_vect_sdot_qi: using cached result" 2
     } else {
-        set et_vect_sdot_qi_saved 0
+        set et_vect_sdot_qi_saved($et_index) 0
         if { [istarget ia64-*-*] } {
             set et_vect_udot_qi_saved 1
         }
     }
-    verbose "check_effective_target_vect_sdot_qi: returning $et_vect_sdot_qi_saved" 2
-    return $et_vect_sdot_qi_saved
+    verbose "check_effective_target_vect_sdot_qi:\
+	     returning $et_vect_sdot_qi_saved($et_index)" 2
+    return $et_vect_sdot_qi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4094,19 +4238,21 @@ proc check_effective_target_vect_sdot_qi { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_udot_qi { } {
-    global et_vect_udot_qi
+    global et_vect_udot_qi_saved
+    global et_index
 
-    if [info exists et_vect_udot_qi_saved] {
+    if [info exists et_vect_udot_qi_saved($et_index)] {
         verbose "check_effective_target_vect_udot_qi: using cached result" 2
     } else {
-        set et_vect_udot_qi_saved 0
+        set et_vect_udot_qi_saved($et_index) 0
         if { [istarget powerpc*-*-*]
              || [istarget ia64-*-*] } {
-            set et_vect_udot_qi_saved 1
+            set et_vect_udot_qi_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_udot_qi: returning $et_vect_udot_qi_saved" 2
-    return $et_vect_udot_qi_saved
+    verbose "check_effective_target_vect_udot_qi:\
+	     returning $et_vect_udot_qi_saved($et_index)" 2
+    return $et_vect_udot_qi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4115,20 +4261,22 @@ proc check_effective_target_vect_udot_qi { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_sdot_hi { } {
-    global et_vect_sdot_hi
+    global et_vect_sdot_hi_saved
+    global et_index
 
-    if [info exists et_vect_sdot_hi_saved] {
+    if [info exists et_vect_sdot_hi_saved($et_index)] {
         verbose "check_effective_target_vect_sdot_hi: using cached result" 2
     } else {
-        set et_vect_sdot_hi_saved 0
+        set et_vect_sdot_hi_saved($et_index) 0
         if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
 	     || [istarget ia64-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*] } {
-            set et_vect_sdot_hi_saved 1
+            set et_vect_sdot_hi_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_sdot_hi: returning $et_vect_sdot_hi_saved" 2
-    return $et_vect_sdot_hi_saved
+    verbose "check_effective_target_vect_sdot_hi:\
+	     returning $et_vect_sdot_hi_saved($et_index)" 2
+    return $et_vect_sdot_hi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4137,18 +4285,20 @@ proc check_effective_target_vect_sdot_hi { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_udot_hi { } {
-    global et_vect_udot_hi
+    global et_vect_udot_hi_saved
+    global et_index
 
-    if [info exists et_vect_udot_hi_saved] {
+    if [info exists et_vect_udot_hi_saved($et_index)] {
         verbose "check_effective_target_vect_udot_hi: using cached result" 2
     } else {
-        set et_vect_udot_hi_saved 0
+        set et_vect_udot_hi_saved($et_index) 0
         if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) } {
-            set et_vect_udot_hi_saved 1
+            set et_vect_udot_hi_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_udot_hi: returning $et_vect_udot_hi_saved" 2
-    return $et_vect_udot_hi_saved
+    verbose "check_effective_target_vect_udot_hi:\
+	     returning $et_vect_udot_hi_saved($et_index)" 2
+    return $et_vect_udot_hi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4157,18 +4307,20 @@ proc check_effective_target_vect_udot_hi { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_usad_char { } {
-    global et_vect_usad_char
+    global et_vect_usad_char_saved
+    global et_index
 
-    if [info exists et_vect_usad_char_saved] {
+    if [info exists et_vect_usad_char_saved($et_index)] {
         verbose "check_effective_target_vect_usad_char: using cached result" 2
     } else {
-        set et_vect_usad_char_saved 0
+        set et_vect_usad_char_saved($et_index) 0
         if { ([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
-            set et_vect_usad_char_saved 1
+            set et_vect_usad_char_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_usad_char: returning $et_vect_usad_char_saved" 2
-    return $et_vect_usad_char_saved
+    verbose "check_effective_target_vect_usad_char:\
+	     returning $et_vect_usad_char_saved($et_index)" 2
+    return $et_vect_usad_char_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4178,23 +4330,25 @@ proc check_effective_target_vect_usad_char { } {
 # This won't change for different subtargets so cache the result.
                                                                                 
 proc check_effective_target_vect_pack_trunc { } {
-    global et_vect_pack_trunc
+    global et_vect_pack_trunc_saved
+    global et_index
                                                                                 
-    if [info exists et_vect_pack_trunc_saved] {
+    if [info exists et_vect_pack_trunc_saved($et_index)] {
         verbose "check_effective_target_vect_pack_trunc: using cached result" 2
     } else {
-        set et_vect_pack_trunc_saved 0
+	set et_vect_pack_trunc_saved($et_index) 0
         if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
              || [istarget i?86-*-*] || [istarget x86_64-*-*]
              || [istarget aarch64*-*-*]
              || [istarget spu-*-*]
              || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]
 		 && [check_effective_target_arm_little_endian]) } {
-            set et_vect_pack_trunc_saved 1
+	    set et_vect_pack_trunc_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_pack_trunc: returning $et_vect_pack_trunc_saved" 2
-    return $et_vect_pack_trunc_saved
+    verbose "check_effective_target_vect_pack_trunc:\
+	     returning $et_vect_pack_trunc_saved($et_index)" 2
+    return $et_vect_pack_trunc_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4203,12 +4357,13 @@ proc check_effective_target_vect_pack_trunc { } {
 # This won't change for different subtargets so cache the result.
                                    
 proc check_effective_target_vect_unpack { } {
-    global et_vect_unpack
+    global et_vect_unpack_saved
+    global et_index
                                         
-    if [info exists et_vect_unpack_saved] {
+    if [info exists et_vect_unpack_saved($et_index)] {
         verbose "check_effective_target_vect_unpack: using cached result" 2
     } else {
-        set et_vect_unpack_saved 0
+	set et_vect_unpack_saved($et_index) 0
         if { ([istarget powerpc*-*-*] && ![istarget powerpc-*paired*])
              || [istarget i?86-*-*] || [istarget x86_64-*-*] 
              || [istarget spu-*-*]
@@ -4216,11 +4371,12 @@ proc check_effective_target_vect_unpack { } {
              || [istarget aarch64*-*-*]
              || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]
 		 && [check_effective_target_arm_little_endian]) } {
-            set et_vect_unpack_saved 1
+	    set et_vect_unpack_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_unpack: returning $et_vect_unpack_saved" 2  
-    return $et_vect_unpack_saved
+    verbose "check_effective_target_vect_unpack:\
+	     returning $et_vect_unpack_saved($et_index)" 2
+    return $et_vect_unpack_saved($et_index)
 }
 
 # Return 1 if the target plus current options does not guarantee
@@ -4247,11 +4403,12 @@ proc check_effective_target_unaligned_stack { } {
 
 proc check_effective_target_vect_no_align { } {
     global et_vect_no_align_saved
+    global et_index
 
-    if [info exists et_vect_no_align_saved] {
+    if [info exists et_vect_no_align_saved($et_index)] {
 	verbose "check_effective_target_vect_no_align: using cached result" 2
     } else {
-	set et_vect_no_align_saved 0
+	set et_vect_no_align_saved($et_index) 0
 	if { [istarget mipsisa64*-*-*]
 	     || [istarget mips-sde-elf]
 	     || [istarget sparc*-*-*]
@@ -4259,12 +4416,13 @@ proc check_effective_target_vect_no_align { } {
 	     || [check_effective_target_arm_vect_no_misalign]
 	     || ([istarget powerpc*-*-*] && [check_p8vector_hw_available])
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mips_loongson]) } {
-	    set et_vect_no_align_saved 1
+		 && [et-is-effective-target mips_loongson]) } {
+	    set et_vect_no_align_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_no_align: returning $et_vect_no_align_saved" 2
-    return $et_vect_no_align_saved
+    verbose "check_effective_target_vect_no_align:\
+	     returning $et_vect_no_align_saved($et_index)" 2
+    return $et_vect_no_align_saved($et_index)
 }
 
 # Return 1 if the target supports a vector misalign access, 0 otherwise.
@@ -4273,19 +4431,21 @@ proc check_effective_target_vect_no_align { } {
 
 proc check_effective_target_vect_hw_misalign { } {
     global et_vect_hw_misalign_saved
+    global et_index
 
-    if [info exists et_vect_hw_misalign_saved] {
+    if [info exists et_vect_hw_misalign_saved($et_index)] {
         verbose "check_effective_target_vect_hw_misalign: using cached result" 2
     } else {
-        set et_vect_hw_misalign_saved 0
-       if { [istarget i?86-*-*] || [istarget x86_64-*-*]
-            || ([istarget powerpc*-*-*] && [check_p8vector_hw_available])
-	    || [istarget aarch64*-*-*] } {
-          set et_vect_hw_misalign_saved 1
-       }
+	set et_vect_hw_misalign_saved($et_index) 0
+	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
+	     || ([istarget powerpc*-*-*] && [check_p8vector_hw_available])
+	     || [istarget aarch64*-*-*] } {
+	  set et_vect_hw_misalign_saved($et_index) 1
+	}
     }
-    verbose "check_effective_target_vect_hw_misalign: returning $et_vect_hw_misalign_saved" 2
-    return $et_vect_hw_misalign_saved
+    verbose "check_effective_target_vect_hw_misalign:\
+	     returning $et_vect_hw_misalign_saved($et_index)" 2
+    return $et_vect_hw_misalign_saved($et_index)
 }
 
 
@@ -4295,25 +4455,28 @@ proc check_effective_target_vect_hw_misalign { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_aligned_arrays { } {
-    global et_vect_aligned_arrays
+    global et_vect_aligned_arrays_saved
+    global et_index
 
-    if [info exists et_vect_aligned_arrays_saved] {
-	verbose "check_effective_target_vect_aligned_arrays: using cached result" 2
+    if [info exists et_vect_aligned_arrays_saved($et_index)] {
+	verbose "check_effective_target_vect_aligned_arrays:\
+		 using cached result" 2
     } else {
-	set et_vect_aligned_arrays_saved 0
+	set et_vect_aligned_arrays_saved($et_index) 0
         if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
 	    if { ([is-effective-target lp64]
 	          && ( ![check_avx_available]
 		     || [check_prefer_avx128])) } {
-	         set et_vect_aligned_arrays_saved 1
+	         set et_vect_aligned_arrays_saved($et_index) 1
 	    }
 	}
         if [istarget spu-*-*] {
-	    set et_vect_aligned_arrays_saved 1
+	    set et_vect_aligned_arrays_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_aligned_arrays: returning $et_vect_aligned_arrays_saved" 2
-    return $et_vect_aligned_arrays_saved
+    verbose "check_effective_target_vect_aligned_arrays:\
+	     returning $et_vect_aligned_arrays_saved($et_index)" 2
+    return $et_vect_aligned_arrays_saved($et_index)
 }
 
 # Return 1 if types of size 32 bit or less are naturally aligned
@@ -4364,20 +4527,22 @@ proc check_effective_target_natural_alignment_64 { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_natural_alignment { } {
-    global et_vect_natural_alignment
+    global et_vect_natural_alignment_saved
+    global et_index
 
-    if [info exists et_vect_natural_alignment_saved] {
+    if [info exists et_vect_natural_alignment_saved($et_index)] {
         verbose "check_effective_target_vect_natural_alignment: using cached result" 2
     } else {
-        set et_vect_natural_alignment_saved 1
+        set et_vect_natural_alignment_saved($et_index) 1
         if { [check_effective_target_arm_eabi]
 	     || [istarget nvptx-*-*]
 	     || [istarget s390*-*-*] } {
-            set et_vect_natural_alignment_saved 0
+            set et_vect_natural_alignment_saved($et_index) 0
         }
     }
-    verbose "check_effective_target_vect_natural_alignment: returning $et_vect_natural_alignment_saved" 2
-    return $et_vect_natural_alignment_saved
+    verbose "check_effective_target_vect_natural_alignment:\
+	     returning $et_vect_natural_alignment_saved($et_index)" 2
+    return $et_vect_natural_alignment_saved($et_index)
 }
 
 # Return 1 if vector alignment (for types of size 32 bit or less) is reachable, 0 otherwise.
@@ -4385,20 +4550,23 @@ proc check_effective_target_vect_natural_alignment { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vector_alignment_reachable { } {
-    global et_vector_alignment_reachable
+    global et_vector_alignment_reachable_saved
+    global et_index
 
-    if [info exists et_vector_alignment_reachable_saved] {
-        verbose "check_effective_target_vector_alignment_reachable: using cached result" 2
+    if [info exists et_vector_alignment_reachable_saved($et_index)] {
+        verbose "check_effective_target_vector_alignment_reachable:\
+		 using cached result" 2
     } else {
         if { [check_effective_target_vect_aligned_arrays]
              || [check_effective_target_natural_alignment_32] } {
-            set et_vector_alignment_reachable_saved 1
+            set et_vector_alignment_reachable_saved($et_index) 1
         } else {
-            set et_vector_alignment_reachable_saved 0
+            set et_vector_alignment_reachable_saved($et_index) 0
         }
     }
-    verbose "check_effective_target_vector_alignment_reachable: returning $et_vector_alignment_reachable_saved" 2
-    return $et_vector_alignment_reachable_saved
+    verbose "check_effective_target_vector_alignment_reachable:\
+	     returning $et_vector_alignment_reachable_saved($et_index)" 2
+    return $et_vector_alignment_reachable_saved($et_index)
 }
 
 # Return 1 if vector alignment for 64 bit is reachable, 0 otherwise.
@@ -4406,63 +4574,72 @@ proc check_effective_target_vector_alignment_reachable { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vector_alignment_reachable_for_64bit { } {
-    global et_vector_alignment_reachable_for_64bit
+    global et_vector_alignment_reachable_for_64bit_saved
+    global et_index
 
-    if [info exists et_vector_alignment_reachable_for_64bit_saved] {
-        verbose "check_effective_target_vector_alignment_reachable_for_64bit: using cached result" 2
+    if [info exists et_vector_alignment_reachable_for_64bit_saved($et_index)] {
+        verbose "check_effective_target_vector_alignment_reachable_for_64bit:\
+		 using cached result" 2
     } else {
         if { [check_effective_target_vect_aligned_arrays] 
              || [check_effective_target_natural_alignment_64] } {
-            set et_vector_alignment_reachable_for_64bit_saved 1
+            set et_vector_alignment_reachable_for_64bit_saved($et_index) 1
         } else {
-            set et_vector_alignment_reachable_for_64bit_saved 0
+            set et_vector_alignment_reachable_for_64bit_saved($et_index) 0
         }
     }
-    verbose "check_effective_target_vector_alignment_reachable_for_64bit: returning $et_vector_alignment_reachable_for_64bit_saved" 2
-    return $et_vector_alignment_reachable_for_64bit_saved
+    verbose "check_effective_target_vector_alignment_reachable_for_64bit:\
+	 returning $et_vector_alignment_reachable_for_64bit_saved($et_index)" 2
+    return $et_vector_alignment_reachable_for_64bit_saved($et_index)
 }
 
 # Return 1 if the target only requires element alignment for vector accesses
 
 proc check_effective_target_vect_element_align { } {
     global et_vect_element_align
+    global et_index
 
-    if [info exists et_vect_element_align] {
-	verbose "check_effective_target_vect_element_align: using cached result" 2
+    if [info exists et_vect_element_align($et_index)] {
+	verbose "check_effective_target_vect_element_align:\
+		 using cached result" 2
     } else {
-	set et_vect_element_align 0
+	set et_vect_element_align($et_index) 0
 	if { ([istarget arm*-*-*]
 	      && ![check_effective_target_arm_vect_no_misalign])
 	     || [check_effective_target_vect_hw_misalign] } {
-	   set et_vect_element_align 1
+	   set et_vect_element_align($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_element_align: returning $et_vect_element_align" 2
-    return $et_vect_element_align
+    verbose "check_effective_target_vect_element_align:\
+	     returning $et_vect_element_align($et_index)" 2
+    return $et_vect_element_align($et_index)
 }
 
 # Return 1 if the target supports vector conditional operations, 0 otherwise.
 
 proc check_effective_target_vect_condition { } {
     global et_vect_cond_saved
+    global et_index
 
-    if [info exists et_vect_cond_saved] {
+    if [info exists et_vect_cond_saved($et_index)] {
 	verbose "check_effective_target_vect_cond: using cached result" 2
     } else {
-	set et_vect_cond_saved 0
+	set et_vect_cond_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget powerpc*-*-*]
 	     || [istarget ia64-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget spu-*-*]
-	     || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } {
-	   set et_vect_cond_saved 1
+	     || ([istarget arm*-*-*]
+		 && [check_effective_target_arm_neon_ok]) } {
+	   set et_vect_cond_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_cond: returning $et_vect_cond_saved" 2
-    return $et_vect_cond_saved
+    verbose "check_effective_target_vect_cond:\
+	     returning $et_vect_cond_saved($et_index)" 2
+    return $et_vect_cond_saved($et_index)
 }
 
 # Return 1 if the target supports vector conditional operations where
@@ -4470,51 +4647,56 @@ proc check_effective_target_vect_condition { } {
 
 proc check_effective_target_vect_cond_mixed { } {
     global et_vect_cond_mixed_saved
+    global et_index
 
-    if [info exists et_vect_cond_mixed_saved] {
+    if [info exists et_vect_cond_mixed_saved($et_index)] {
 	verbose "check_effective_target_vect_cond_mixed: using cached result" 2
     } else {
-	set et_vect_cond_mixed_saved 0
+	set et_vect_cond_mixed_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget powerpc*-*-*] } {
-	   set et_vect_cond_mixed_saved 1
+	   set et_vect_cond_mixed_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_cond_mixed: returning $et_vect_cond_mixed_saved" 2
-    return $et_vect_cond_mixed_saved
+    verbose "check_effective_target_vect_cond_mixed:\
+	     returning $et_vect_cond_mixed_saved($et_index)" 2
+    return $et_vect_cond_mixed_saved($et_index)
 }
 
 # Return 1 if the target supports vector char multiplication, 0 otherwise.
 
 proc check_effective_target_vect_char_mult { } {
     global et_vect_char_mult_saved
+    global et_index
 
-    if [info exists et_vect_char_mult_saved] {
+    if [info exists et_vect_char_mult_saved($et_index)] {
 	verbose "check_effective_target_vect_char_mult: using cached result" 2
     } else {
-	set et_vect_char_mult_saved 0
+	set et_vect_char_mult_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget ia64-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
             || [check_effective_target_arm32] } {
-	   set et_vect_char_mult_saved 1
+	   set et_vect_char_mult_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_char_mult: returning $et_vect_char_mult_saved" 2
-    return $et_vect_char_mult_saved
+    verbose "check_effective_target_vect_char_mult:\
+	     returning $et_vect_char_mult_saved($et_index)" 2
+    return $et_vect_char_mult_saved($et_index)
 }
 
 # Return 1 if the target supports vector short multiplication, 0 otherwise.
 
 proc check_effective_target_vect_short_mult { } {
     global et_vect_short_mult_saved
+    global et_index
 
-    if [info exists et_vect_short_mult_saved] {
+    if [info exists et_vect_short_mult_saved($et_index)] {
 	verbose "check_effective_target_vect_short_mult: using cached result" 2
     } else {
-	set et_vect_short_mult_saved 0
+	set et_vect_short_mult_saved($et_index) 0
 	if { [istarget ia64-*-*]
 	     || [istarget spu-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
@@ -4522,47 +4704,52 @@ proc check_effective_target_vect_short_mult { } {
 	     || [istarget aarch64*-*-*]
 	     || [check_effective_target_arm32]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mips_loongson]) } {
-	   set et_vect_short_mult_saved 1
+		 && [et-is-effective-target mips_loongson]) } {
+	   set et_vect_short_mult_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_short_mult: returning $et_vect_short_mult_saved" 2
-    return $et_vect_short_mult_saved
+    verbose "check_effective_target_vect_short_mult:\
+	     returning $et_vect_short_mult_saved($et_index)" 2
+    return $et_vect_short_mult_saved($et_index)
 }
 
 # Return 1 if the target supports vector int multiplication, 0 otherwise.
 
 proc check_effective_target_vect_int_mult { } {
     global et_vect_int_mult_saved
+    global et_index
 
-    if [info exists et_vect_int_mult_saved] {
+    if [info exists et_vect_int_mult_saved($et_index)] {
 	verbose "check_effective_target_vect_int_mult: using cached result" 2
     } else {
-	set et_vect_int_mult_saved 0
+	set et_vect_int_mult_saved($et_index) 0
 	if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
 	     || [istarget spu-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget ia64-*-*]
 	     || [istarget aarch64*-*-*]
 	     || [check_effective_target_arm32] } {
-	   set et_vect_int_mult_saved 1
+	   set et_vect_int_mult_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_int_mult: returning $et_vect_int_mult_saved" 2
-    return $et_vect_int_mult_saved
+    verbose "check_effective_target_vect_int_mult:\
+	     returning $et_vect_int_mult_saved($et_index)" 2
+    return $et_vect_int_mult_saved($et_index)
 }
 
 # Return 1 if the target supports vector even/odd elements extraction, 0 otherwise.
 
 proc check_effective_target_vect_extract_even_odd { } {
     global et_vect_extract_even_odd_saved
+    global et_index
     
-    if [info exists et_vect_extract_even_odd_saved] {
-        verbose "check_effective_target_vect_extract_even_odd: using cached result" 2
+    if [info exists et_vect_extract_even_odd_saved($et_index)] {
+        verbose "check_effective_target_vect_extract_even_odd:\
+	         using cached result" 2
     } else {
-        set et_vect_extract_even_odd_saved 0 
+	set et_vect_extract_even_odd_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget powerpc*-*-*]
 	     || [is-effective-target arm_neon_ok]
@@ -4570,24 +4757,26 @@ proc check_effective_target_vect_extract_even_odd { } {
              || [istarget ia64-*-*]
              || [istarget spu-*-*]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mpaired_single]) } {
-	    set et_vect_extract_even_odd_saved 1
+		 && [et-is-effective-target mpaired_single]) } {
+	    set et_vect_extract_even_odd_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_extract_even_odd: returning $et_vect_extract_even_odd_saved" 2
-    return $et_vect_extract_even_odd_saved
+    verbose "check_effective_target_vect_extract_even_odd:\
+	     returning $et_vect_extract_even_odd_saved($et_index)" 2
+    return $et_vect_extract_even_odd_saved($et_index)
 }
 
 # Return 1 if the target supports vector interleaving, 0 otherwise.
 
 proc check_effective_target_vect_interleave { } {
     global et_vect_interleave_saved
+    global et_index
     
-    if [info exists et_vect_interleave_saved] {
+    if [info exists et_vect_interleave_saved($et_index)] {
         verbose "check_effective_target_vect_interleave: using cached result" 2
     } else {
-        set et_vect_interleave_saved 0
+	set et_vect_interleave_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget powerpc*-*-*]
 	     || [is-effective-target arm_neon_ok]
@@ -4595,13 +4784,14 @@ proc check_effective_target_vect_interleave { } {
              || [istarget ia64-*-*]
              || [istarget spu-*-*]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mpaired_single]) } {
-           set et_vect_interleave_saved 1
+		 && [et-is-effective-target mpaired_single]) } {
+	   set et_vect_interleave_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_interleave: returning $et_vect_interleave_saved" 2
-    return $et_vect_interleave_saved
+    verbose "check_effective_target_vect_interleave:\
+	     returning $et_vect_interleave_saved($et_index)" 2
+    return $et_vect_interleave_saved($et_index)
 }
 
 foreach N {2 3 4 8} {
@@ -4609,24 +4799,27 @@ foreach N {2 3 4 8} {
 	# Return 1 if the target supports 2-vector interleaving
 	proc check_effective_target_vect_stridedN { } {
 	    global et_vect_stridedN_saved
+	    global et_index
 
-	    if [info exists et_vect_stridedN_saved] {
-		verbose "check_effective_target_vect_stridedN: using cached result" 2
+	    if [info exists et_vect_stridedN_saved($et_index)] {
+		verbose "check_effective_target_vect_stridedN:\
+			 using cached result" 2
 	    } else {
-		set et_vect_stridedN_saved 0
+		set et_vect_stridedN_saved($et_index) 0
 		if { (N & -N) == N
 		     && [check_effective_target_vect_interleave]
 		     && [check_effective_target_vect_extract_even_odd] } {
-		    set et_vect_stridedN_saved 1
+		    set et_vect_stridedN_saved($et_index) 1
 		}
 		if { ([istarget arm*-*-*]
 		      || [istarget aarch64*-*-*]) && N >= 2 && N <= 4 } {
-		    set et_vect_stridedN_saved 1
+		    set et_vect_stridedN_saved($et_index) 1
 		}
 	    }
 
-	    verbose "check_effective_target_vect_stridedN: returning $et_vect_stridedN_saved" 2
-	    return $et_vect_stridedN_saved
+	    verbose "check_effective_target_vect_stridedN:\
+		     returning $et_vect_stridedN_saved($et_index)" 2
+	    return $et_vect_stridedN_saved($et_index)
 	}
     }]
 }
@@ -4635,60 +4828,67 @@ foreach N {2 3 4 8} {
 
 proc check_effective_target_vect_multiple_sizes { } {
     global et_vect_multiple_sizes_saved
+    global et_index
 
-    set et_vect_multiple_sizes_saved 0
+    set et_vect_multiple_sizes_saved($et_index) 0
     if { ([istarget aarch64*-*-*]
 	  || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok])) } {
-       set et_vect_multiple_sizes_saved 1
+       set et_vect_multiple_sizes_saved($et_index) 1
     }
     if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
       if { ([check_avx_available] && ![check_prefer_avx128]) } {
-	set et_vect_multiple_sizes_saved 1
+	set et_vect_multiple_sizes_saved($et_index) 1
       }
     }
 
-    verbose "check_effective_target_vect_multiple_sizes: returning $et_vect_multiple_sizes_saved" 2
-    return $et_vect_multiple_sizes_saved
+    verbose "check_effective_target_vect_multiple_sizes:\
+	     returning $et_vect_multiple_sizes_saved($et_index)" 2
+    return $et_vect_multiple_sizes_saved($et_index)
 }
 
 # Return 1 if the target supports vectors of 64 bits.
 
 proc check_effective_target_vect64 { } {
     global et_vect64_saved
+    global et_index
 
-    if [info exists et_vect64_saved] {
+    if [info exists et_vect64_saved($et_index)] {
         verbose "check_effective_target_vect64: using cached result" 2
     } else {
-        set et_vect64_saved 0
+        set et_vect64_saved($et_index) 0
         if { ([istarget arm*-*-*]
 	      && [check_effective_target_arm_neon_ok]
 	      && [check_effective_target_arm_little_endian])
              || [istarget sparc*-*-*] } {
-           set et_vect64_saved 1
+           set et_vect64_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect64: returning $et_vect64_saved" 2
-    return $et_vect64_saved
+    verbose "check_effective_target_vect64:\
+	     returning $et_vect64_saved($et_index)" 2
+    return $et_vect64_saved($et_index)
 }
 
 # Return 1 if the target supports vector copysignf calls.
 
 proc check_effective_target_vect_call_copysignf { } {
     global et_vect_call_copysignf_saved
+    global et_index
 
-    if [info exists et_vect_call_copysignf_saved] {
-	verbose "check_effective_target_vect_call_copysignf: using cached result" 2
+    if [info exists et_vect_call_copysignf_saved($et_index)] {
+	verbose "check_effective_target_vect_call_copysignf:\
+		 using cached result" 2
     } else {
-	set et_vect_call_copysignf_saved 0
+	set et_vect_call_copysignf_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget powerpc*-*-*] } {
-	   set et_vect_call_copysignf_saved 1
+	   set et_vect_call_copysignf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_copysignf: returning $et_vect_call_copysignf_saved" 2
-    return $et_vect_call_copysignf_saved
+    verbose "check_effective_target_vect_call_copysignf:\
+	     returning $et_vect_call_copysignf_saved($et_index)" 2
+    return $et_vect_call_copysignf_saved($et_index)
 }
 
 # Return 1 if the target supports hardware square root instructions.
@@ -4716,249 +4916,280 @@ proc check_effective_target_sqrt_insn { } {
 
 proc check_effective_target_vect_call_sqrtf { } {
     global et_vect_call_sqrtf_saved
+    global et_index
 
-    if [info exists et_vect_call_sqrtf_saved] {
+    if [info exists et_vect_call_sqrtf_saved($et_index)] {
 	verbose "check_effective_target_vect_call_sqrtf: using cached result" 2
     } else {
-	set et_vect_call_sqrtf_saved 0
+	set et_vect_call_sqrtf_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || ([istarget powerpc*-*-*] && [check_vsx_hw_available]) } {
-	    set et_vect_call_sqrtf_saved 1
+	    set et_vect_call_sqrtf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_sqrtf: returning $et_vect_call_sqrtf_saved" 2
-    return $et_vect_call_sqrtf_saved
+    verbose "check_effective_target_vect_call_sqrtf:\
+	     returning $et_vect_call_sqrtf_saved($et_index)" 2
+    return $et_vect_call_sqrtf_saved($et_index)
 }
 
 # Return 1 if the target supports vector lrint calls.
 
 proc check_effective_target_vect_call_lrint { } {
-    set et_vect_call_lrint 0
+    global et_index
+    set et_vect_call_lrint($et_index) 0
     if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
 	 && [check_effective_target_ilp32] } {
-	set et_vect_call_lrint 1
+	set et_vect_call_lrint($et_index) 1
     }
 
-    verbose "check_effective_target_vect_call_lrint: returning $et_vect_call_lrint" 2
-    return $et_vect_call_lrint
+    verbose "check_effective_target_vect_call_lrint:\
+	     returning $et_vect_call_lrint($et_index)" 2
+    return $et_vect_call_lrint($et_index)
 }
 
 # Return 1 if the target supports vector btrunc calls.
 
 proc check_effective_target_vect_call_btrunc { } {
     global et_vect_call_btrunc_saved
+    global et_index
 
-    if [info exists et_vect_call_btrunc_saved] {
-	verbose "check_effective_target_vect_call_btrunc: using cached result" 2
+    if [info exists et_vect_call_btrunc_saved($et_index)] {
+	verbose "check_effective_target_vect_call_btrunc:\
+		 using cached result" 2
     } else {
-	set et_vect_call_btrunc_saved 0
+	set et_vect_call_btrunc_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_btrunc_saved 1
+	  set et_vect_call_btrunc_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_btrunc: returning $et_vect_call_btrunc_saved" 2
-    return $et_vect_call_btrunc_saved
+    verbose "check_effective_target_vect_call_btrunc:\
+	     returning $et_vect_call_btrunc_saved($et_index)" 2
+    return $et_vect_call_btrunc_saved($et_index)
 }
 
 # Return 1 if the target supports vector btruncf calls.
 
 proc check_effective_target_vect_call_btruncf { } {
     global et_vect_call_btruncf_saved
+    global et_index
 
-    if [info exists et_vect_call_btruncf_saved] {
-	verbose "check_effective_target_vect_call_btruncf: using cached result" 2
+    if [info exists et_vect_call_btruncf_saved($et_index)] {
+	verbose "check_effective_target_vect_call_btruncf:\
+		 using cached result" 2
     } else {
-	set et_vect_call_btruncf_saved 0
+	set et_vect_call_btruncf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_btruncf_saved 1
+	  set et_vect_call_btruncf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_btruncf: returning $et_vect_call_btruncf_saved" 2
-    return $et_vect_call_btruncf_saved
+    verbose "check_effective_target_vect_call_btruncf:\
+	     returning $et_vect_call_btruncf_saved($et_index)" 2
+    return $et_vect_call_btruncf_saved($et_index)
 }
 
 # Return 1 if the target supports vector ceil calls.
 
 proc check_effective_target_vect_call_ceil { } {
     global et_vect_call_ceil_saved
+    global et_index
 
-    if [info exists et_vect_call_ceil_saved] {
+    if [info exists et_vect_call_ceil_saved($et_index)] {
 	verbose "check_effective_target_vect_call_ceil: using cached result" 2
     } else {
-	set et_vect_call_ceil_saved 0
+	set et_vect_call_ceil_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_ceil_saved 1
+	  set et_vect_call_ceil_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_ceil: returning $et_vect_call_ceil_saved" 2
-    return $et_vect_call_ceil_saved
+    verbose "check_effective_target_vect_call_ceil:\
+	     returning $et_vect_call_ceil_saved($et_index)" 2
+    return $et_vect_call_ceil_saved($et_index)
 }
 
 # Return 1 if the target supports vector ceilf calls.
 
 proc check_effective_target_vect_call_ceilf { } {
     global et_vect_call_ceilf_saved
+    global et_index
 
-    if [info exists et_vect_call_ceilf_saved] {
+    if [info exists et_vect_call_ceilf_saved($et_index)] {
 	verbose "check_effective_target_vect_call_ceilf: using cached result" 2
     } else {
-	set et_vect_call_ceilf_saved 0
+	set et_vect_call_ceilf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_ceilf_saved 1
+	  set et_vect_call_ceilf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_ceilf: returning $et_vect_call_ceilf_saved" 2
-    return $et_vect_call_ceilf_saved
+    verbose "check_effective_target_vect_call_ceilf:\
+	     returning $et_vect_call_ceilf_saved($et_index)" 2
+    return $et_vect_call_ceilf_saved($et_index)
 }
 
 # Return 1 if the target supports vector floor calls.
 
 proc check_effective_target_vect_call_floor { } {
     global et_vect_call_floor_saved
+    global et_index
 
-    if [info exists et_vect_call_floor_saved] {
+    if [info exists et_vect_call_floor_saved($et_index)] {
 	verbose "check_effective_target_vect_call_floor: using cached result" 2
     } else {
-	set et_vect_call_floor_saved 0
+	set et_vect_call_floor_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_floor_saved 1
+	  set et_vect_call_floor_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_floor: returning $et_vect_call_floor_saved" 2
-    return $et_vect_call_floor_saved
+    verbose "check_effective_target_vect_call_floor:\
+	     returning $et_vect_call_floor_saved($et_index)" 2
+    return $et_vect_call_floor_saved($et_index)
 }
 
 # Return 1 if the target supports vector floorf calls.
 
 proc check_effective_target_vect_call_floorf { } {
     global et_vect_call_floorf_saved
+    global et_index
 
-    if [info exists et_vect_call_floorf_saved] {
+    if [info exists et_vect_call_floorf_saved($et_index)] {
 	verbose "check_effective_target_vect_call_floorf: using cached result" 2
     } else {
-	set et_vect_call_floorf_saved 0
+	set et_vect_call_floorf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_floorf_saved 1
+	  set et_vect_call_floorf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_floorf: returning $et_vect_call_floorf_saved" 2
-    return $et_vect_call_floorf_saved
+    verbose "check_effective_target_vect_call_floorf:\
+	     returning $et_vect_call_floorf_saved($et_index)" 2
+    return $et_vect_call_floorf_saved($et_index)
 }
 
 # Return 1 if the target supports vector lceil calls.
 
 proc check_effective_target_vect_call_lceil { } {
     global et_vect_call_lceil_saved
+    global et_index
 
-    if [info exists et_vect_call_lceil_saved] {
+    if [info exists et_vect_call_lceil_saved($et_index)] {
 	verbose "check_effective_target_vect_call_lceil: using cached result" 2
     } else {
-	set et_vect_call_lceil_saved 0
+	set et_vect_call_lceil_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_lceil_saved 1
+	  set et_vect_call_lceil_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_lceil: returning $et_vect_call_lceil_saved" 2
-    return $et_vect_call_lceil_saved
+    verbose "check_effective_target_vect_call_lceil:\
+	     returning $et_vect_call_lceil_saved($et_index)" 2
+    return $et_vect_call_lceil_saved($et_index)
 }
 
 # Return 1 if the target supports vector lfloor calls.
 
 proc check_effective_target_vect_call_lfloor { } {
     global et_vect_call_lfloor_saved
+    global et_index
 
-    if [info exists et_vect_call_lfloor_saved] {
+    if [info exists et_vect_call_lfloor_saved($et_index)] {
 	verbose "check_effective_target_vect_call_lfloor: using cached result" 2
     } else {
-	set et_vect_call_lfloor_saved 0
+	set et_vect_call_lfloor_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_lfloor_saved 1
+	  set et_vect_call_lfloor_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_lfloor: returning $et_vect_call_lfloor_saved" 2
-    return $et_vect_call_lfloor_saved
+    verbose "check_effective_target_vect_call_lfloor:\
+	     returning $et_vect_call_lfloor_saved($et_index)" 2
+    return $et_vect_call_lfloor_saved($et_index)
 }
 
 # Return 1 if the target supports vector nearbyint calls.
 
 proc check_effective_target_vect_call_nearbyint { } {
     global et_vect_call_nearbyint_saved
+    global et_index
 
-    if [info exists et_vect_call_nearbyint_saved] {
+    if [info exists et_vect_call_nearbyint_saved($et_index)] {
 	verbose "check_effective_target_vect_call_nearbyint: using cached result" 2
     } else {
-	set et_vect_call_nearbyint_saved 0
+	set et_vect_call_nearbyint_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_nearbyint_saved 1
+	  set et_vect_call_nearbyint_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_nearbyint: returning $et_vect_call_nearbyint_saved" 2
-    return $et_vect_call_nearbyint_saved
+    verbose "check_effective_target_vect_call_nearbyint:\
+	     returning $et_vect_call_nearbyint_saved($et_index)" 2
+    return $et_vect_call_nearbyint_saved($et_index)
 }
 
 # Return 1 if the target supports vector nearbyintf calls.
 
 proc check_effective_target_vect_call_nearbyintf { } {
     global et_vect_call_nearbyintf_saved
+    global et_index
 
-    if [info exists et_vect_call_nearbyintf_saved] {
-	verbose "check_effective_target_vect_call_nearbyintf: using cached result" 2
+    if [info exists et_vect_call_nearbyintf_saved($et_index)] {
+	verbose "check_effective_target_vect_call_nearbyintf:\
+		 using cached result" 2
     } else {
-	set et_vect_call_nearbyintf_saved 0
+	set et_vect_call_nearbyintf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_nearbyintf_saved 1
+	  set et_vect_call_nearbyintf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_nearbyintf: returning $et_vect_call_nearbyintf_saved" 2
-    return $et_vect_call_nearbyintf_saved
+    verbose "check_effective_target_vect_call_nearbyintf:\
+	     returning $et_vect_call_nearbyintf_saved($et_index)" 2
+    return $et_vect_call_nearbyintf_saved($et_index)
 }
 
 # Return 1 if the target supports vector round calls.
 
 proc check_effective_target_vect_call_round { } {
     global et_vect_call_round_saved
+    global et_index
 
-    if [info exists et_vect_call_round_saved] {
+    if [info exists et_vect_call_round_saved($et_index)] {
 	verbose "check_effective_target_vect_call_round: using cached result" 2
     } else {
-	set et_vect_call_round_saved 0
+	set et_vect_call_round_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_round_saved 1
+	  set et_vect_call_round_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_round: returning $et_vect_call_round_saved" 2
-    return $et_vect_call_round_saved
+    verbose "check_effective_target_vect_call_round:\
+	     returning $et_vect_call_round_saved($et_index)" 2
+    return $et_vect_call_round_saved($et_index)
 }
 
 # Return 1 if the target supports vector roundf calls.
 
 proc check_effective_target_vect_call_roundf { } {
     global et_vect_call_roundf_saved
+    global et_index
 
-    if [info exists et_vect_call_roundf_saved] {
+    if [info exists et_vect_call_roundf_saved($et_index)] {
 	verbose "check_effective_target_vect_call_roundf: using cached result" 2
     } else {
-	set et_vect_call_roundf_saved 0
+	set et_vect_call_roundf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_roundf_saved 1
+	  set et_vect_call_roundf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_roundf: returning $et_vect_call_roundf_saved" 2
-    return $et_vect_call_roundf_saved
+    verbose "check_effective_target_vect_call_roundf:\
+	     returning $et_vect_call_roundf_saved($et_index)" 2
+    return $et_vect_call_roundf_saved($et_index)
 }
 
 # Return 1 if the target supports section-anchors
@@ -5335,7 +5566,13 @@ proc check_effective_target_init_priority {} {
 # arguments with keywords that pass particular arguments.
 
 proc is-effective-target { arg } {
+    global et_index
     set selected 0
+    if { ![info exists et_index] } {
+        # Initialize the effective target index that is used in some
+	# check_effective_target_* procs.
+	set et_index 0
+    }
     if { [info procs check_effective_target_${arg}] != [list] } {
 	set selected [check_effective_target_${arg}]
     } else {
@@ -5378,6 +5615,50 @@ proc is-effective-target-keyword { arg } {
     }
 }
 
+# Execute tests for all targets in EFFECTIVE_TARGETS list.  Set et_index to
+# indicate what target is currently being processed.  This is for
+# the vectorizer tests, e.g. vect_int, to keep track what target supports
+# a given feature.
+
+proc et-dg-runtest { runtest testcases flags default-extra-flags } {
+    global dg-do-what-default
+    global EFFECTIVE_TARGETS
+    global et_index
+
+    if { [llength $EFFECTIVE_TARGETS] > 0 } {
+	foreach target $EFFECTIVE_TARGETS {
+	    set target_flags $flags
+	    set dg-do-what-default compile
+	    set et_index [lsearch -exact $EFFECTIVE_TARGETS $target]
+	    if { [info procs add_options_for_${target}] != [list] } {
+		set target_flags [add_options_for_${target} "$flags"]
+	    }
+	    if { [info procs check_effective_target_${target}_runtime]
+		 != [list] && [check_effective_target_${target}_runtime] } {
+		set dg-do-what-default run
+	    }
+	    $runtest $testcases $target_flags ${default-extra-flags}
+	}
+    } else {
+	set et_index 0
+	$runtest $testcases $flags ${default-extra-flags}
+    }
+}
+
+# Return 1 if a target matches the target in EFFECTIVE_TARGETS at index
+# et_index, 0 otherwise.
+
+proc et-is-effective-target { target } {
+    global EFFECTIVE_TARGETS
+    global et_index
+
+    if { [llength $EFFECTIVE_TARGETS] > $et_index
+	 && [lindex $EFFECTIVE_TARGETS $et_index] == $target } {
+	    return 1
+    }
+    return 0
+}
+
 # Return 1 if target default to short enums
 
 proc check_effective_target_short_enums { } {
@@ -6048,13 +6329,19 @@ proc check_effective_target_stpcpy {} {
 
 # Check whether the vectorizer tests are supported by the target and
 # append additional target-dependent compile flags to DEFAULT_VECTCFLAGS.
+# If a port wants to execute the tests more than once it should append
+# the supported target to EFFECTIVE_TARGETS instead, and the compile flags
+# will be added by a call to add_options_for_<target>.
 # Set dg-do-what-default to either compile or run, depending on target
-# capabilities.  Return 1 if vectorizer tests are supported by
-# target, 0 otherwise.
+# capabilities.  Do not set this if the supported target is appended to
+# EFFECTIVE_TARGETS.  Flags and this variable will be set by et-dg-runtest
+# automatically.  Return the number of effective targets if vectorizer tests
+# are supported, 0 otherwise.
 
 proc check_vect_support_and_set_flags { } {
     global DEFAULT_VECTCFLAGS
     global dg-do-what-default
+    global EFFECTIVE_TARGETS
 
     if  [istarget powerpc-*paired*]  {
         lappend DEFAULT_VECTCFLAGS "-mpaired"
@@ -6095,13 +6382,14 @@ 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"
+	       && [check_effective_target_nomips16] } {
+	if { [check_effective_target_mpaired_single] } {
+	    lappend EFFECTIVE_TARGETS mpaired_single
+	}
+	if { [check_effective_target_mips_loongson] } {
+	    lappend EFFECTIVE_TARGETS mips_loongson
         }
-        set dg-do-what-default run
+	return [llength $EFFECTIVE_TARGETS]
     } elseif [istarget sparc*-*-*] {
         lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis"
         if [check_effective_target_ultrasparc_hw] {
-- 
2.4.5


^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2015-08-10 12:15 [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets Robert Suchanek
@ 2016-01-05 16:16 ` Robert Suchanek
  2016-01-11 13:35   ` Matthew Fortune
  2016-05-05 15:14 ` Robert Suchanek
  1 sibling, 1 reply; 17+ messages in thread
From: Robert Suchanek @ 2016-01-05 16:16 UTC (permalink / raw)
  To: Catherine_Moore, Matthew Fortune; +Cc: gcc-patches

Ping.

> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-owner@gcc.gnu.org] On
> Behalf Of Robert Suchanek
> Sent: 10 August 2015 13:15
> To: Catherine_Moore@mentor.com; Matthew Fortune
> Cc: gcc-patches@gcc.gnu.org
> Subject: [PATCH 3/4] Add support to run auto-vectorization tests for multiple
> effective targets
> 
> Hi,
> 
> This patch allows to run auto-vectorization tests for more than one effective
> target.  The initial proposal
> 
> https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02289.html
> 
> had some issues that have been addressed and should work as expected now.
> 
> The idea was to add a wrapper procedure that would:
> 1. Iterative over a list of EFFECTIVE_TARGETS e.g. mips_msa, mpaired_single.
> 2. Add necessary compile time options for each effective target.
> 3. Check if it's possible to compile and/or run on a target, and set
>    dg-do-what-default accordingly.
> 4. Set the target index to tell check_effective_target_vect_* which target is
>    currently being processed.
> 5. Invoke {gfortran-,g++-,}dg-runtest with the list of vector tests as normal.
> 
> The above required that every vector feature e.g. vect_int that caches the
> result is
> capable of tracking what target supports a feature.  The result is saved to a
> list
> at an index controlled by the wrapper (et-dg-runtest).  Ports not using this
> feature,
> set DEFAULT_VECTFLAGS and the tests should run as they used to.
> 
> The patch was additionally tested on x86_64-unknown-linux-gnu and aarch64-
> linux-gnu.
> 
> Regards,
> Robert
> 
> gcc/testsuite/ChangeLog:
> 
> 	* g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS. Call
> 	g++-dg-runtest via et-dg-runtest.
> 	* gcc.dg/graphite/graphite.exp: Likewise, but for 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_effective_target_mpaired_single_runtime): Likewise.
> 	(check_effective_target_mips_loongson_runtime): Likewise.
> 	(add_options_for_mpaired_single): Likewise.
> 	(check_effective_target_vect_int): Add global et_index.
> 	Check and save the supported feature for a target selected by
> 	the et_index target.  Break long lines where appropriate.  Call
> 	et-is-effective-target for MIPS with an argument instead of
> 	check_effective_target_* where appropriate.
> 	(check_effective_target_vect_intfloat_cvt): Likewise.
> 	(check_effective_target_vect_uintfloat_cvt): Likewise.
> 	(check_effective_target_vect_floatint_cvt): Likewise.
> 	(check_effective_target_vect_floatuint_cvt): Likewise.
> 	(check_effective_target_vect_simd_clones): Likewise.
> 	(check_effective_target_vect_shift): ewise.
> 	(check_effective_target_whole_vector_shift): Likewise.
> 	(check_effective_target_vect_bswap): Likewise.
> 	(check_effective_target_vect_shift_char): Likewise.
> 	(check_effective_target_vect_long): Likewise.
> 	(check_effective_target_vect_float): Likewise.
> 	(check_effective_target_vect_double): Likewise.
> 	(check_effective_target_vect_long_long): Likewise.
> 	(check_effective_target_vect_no_int_max): Likewise.
> 	(check_effective_target_vect_no_int_add): Likewise.
> 	(check_effective_target_vect_no_bitwise): Likewise.
> 	(check_effective_target_vect_widen_shift): Likewise.
> 	(check_effective_target_vect_no_align): Likewise.
> 	(check_effective_target_vect_hw_misalign): Likewise.
> 	(check_effective_target_vect_element_align): Likewise.
> 	(check_effective_target_vect_condition): Likewise.
> 	(check_effective_target_vect_cond_mixed): Likewise.
> 	(check_effective_target_vect_char_mult): Likewise.
> 	(check_effective_target_vect_short_mult): Likewise.
> 	(check_effective_target_vect_int_mult): Likewise.
> 	(check_effective_target_vect_extract_even_odd): Likewise.
> 	(check_effective_target_vect_interleave): Likewise.
> 	(check_effective_target_vect_stridedN): Likewise.
> 	(check_effective_target_vect_multiple_sizes): Likewise.
> 	(check_effective_target_vect64): Likewise.
> 	(check_effective_target_vect_call_copysignf): Likewise.
> 	(check_effective_target_vect_call_sqrtf): Likewise.
> 	(check_effective_target_vect_call_lrint): Likewise.
> 	(check_effective_target_vect_call_btrunc): Likewise.
> 	(check_effective_target_vect_call_btruncf): Likewise.
> 	(check_effective_target_vect_call_ceil): Likewise.
> 	(check_effective_target_vect_call_ceilf): Likewise.
> 	(check_effective_target_vect_call_floor): Likewise.
> 	(check_effective_target_vect_call_floorf): Likewise.
> 	(check_effective_target_vect_call_lceil): Likewise.
> 	(check_effective_target_vect_call_lfloor): Likewise.
> 	(check_effective_target_vect_call_nearbyint): Likewise.
> 	(check_effective_target_vect_call_nearbyintf): Likewise.
> 	(check_effective_target_vect_call_round): Likewise.
> 	(check_effective_target_vect_call_roundf): Likewise.
> 	(check_effective_target_vect_perm): Likewise, but also append *_saved
> 	to the existing global name to properly cache the result.
> 	(check_effective_target_vect_perm_byte): Likewise.
> 	(check_effective_target_vect_perm_short): Likewise.
> 	(check_effective_target_vect_widen_sum_hi_to_si_pattern): Likewise.
> 	(check_effective_target_vect_widen_sum_hi_to_si): Likewise.
> 	(check_effective_target_vect_widen_sum_qi_to_hi): Likewise.
> 	(check_effective_target_vect_widen_sum_qi_to_si): Likewise.
> 	(check_effective_target_vect_widen_mult_qi_to_hi_pattern): Likewise.
> 	(check_effective_target_vect_widen_mult_qi_to_hi): Likewise.
> 	(check_effective_target_vect_widen_mult_hi_to_si_pattern): Likewise.
> 	(check_effective_target_vect_widen_mult_si_to_di_pattern): Likewise.
> 	(check_effective_target_vect_sdot_qi): Likewise.
> 	(check_effective_target_vect_udot_qi): Likewise.
> 	(check_effective_target_vect_sdot_hi): Likewise.
> 	(check_effective_target_vect_udot_hi): Likewise.
> 	(check_effective_target_vect_usad_char): Likewise.
> 	(check_effective_target_vect_pack_trunc): Likewise.
> 	(check_effective_target_vect_unpack): Likewise.
> 	(check_effective_target_vect_aligned_arrays): Likewise.
> 	(check_effective_target_vect_natural_alignment): Likewise.
> 	(check_effective_target_vector_alignment_reachable): Likewise.
> 	(check_effective_target_vector_alignment_reachable_for_64bit): Likewise.
> 	(is-effective-target): Initialize et_index if undefined.
> 	(et-dg-runtest): New.
> 	(et-is-effective-target): Likewise.
> 	(check_vect_support_and_set_flags): Add supported MIPS targets to
> 	EFFECTIVE_TARGETS list.  Return the number of supported targets.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2016-01-05 16:16 ` Robert Suchanek
@ 2016-01-11 13:35   ` Matthew Fortune
  2016-01-11 13:37     ` Robert Suchanek
  0 siblings, 1 reply; 17+ messages in thread
From: Matthew Fortune @ 2016-01-11 13:35 UTC (permalink / raw)
  To: Robert Suchanek, Catherine_Moore; +Cc: gcc-patches

Hi Robert,

Do you have an updated version of this patch? It no longer applies cleanly.

Thanks,
Matthew

> -----Original Message-----
> From: Robert Suchanek
> Sent: 05 January 2016 16:17
> To: Catherine_Moore@mentor.com; Matthew Fortune
> Cc: gcc-patches@gcc.gnu.org
> Subject: RE: [PATCH 3/4] Add support to run auto-vectorization tests for
> multiple effective targets
> 
> Ping.
> 
> > -----Original Message-----
> > From: gcc-patches-owner@gcc.gnu.org
> > [mailto:gcc-patches-owner@gcc.gnu.org] On Behalf Of Robert Suchanek
> > Sent: 10 August 2015 13:15
> > To: Catherine_Moore@mentor.com; Matthew Fortune
> > Cc: gcc-patches@gcc.gnu.org
> > Subject: [PATCH 3/4] Add support to run auto-vectorization tests for
> > multiple effective targets
> >
> > Hi,
> >
> > This patch allows to run auto-vectorization tests for more than one
> > effective target.  The initial proposal
> >
> > https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02289.html
> >
> > had some issues that have been addressed and should work as expected
> now.
> >
> > The idea was to add a wrapper procedure that would:
> > 1. Iterative over a list of EFFECTIVE_TARGETS e.g. mips_msa,
> mpaired_single.
> > 2. Add necessary compile time options for each effective target.
> > 3. Check if it's possible to compile and/or run on a target, and set
> >    dg-do-what-default accordingly.
> > 4. Set the target index to tell check_effective_target_vect_* which
> target is
> >    currently being processed.
> > 5. Invoke {gfortran-,g++-,}dg-runtest with the list of vector tests as
> normal.
> >
> > The above required that every vector feature e.g. vect_int that caches
> > the result is capable of tracking what target supports a feature.  The
> > result is saved to a list at an index controlled by the wrapper
> > (et-dg-runtest).  Ports not using this feature, set DEFAULT_VECTFLAGS
> > and the tests should run as they used to.
> >
> > The patch was additionally tested on x86_64-unknown-linux-gnu and
> > aarch64- linux-gnu.
> >
> > Regards,
> > Robert
> >
> > gcc/testsuite/ChangeLog:
> >
> > 	* g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS.
> Call
> > 	g++-dg-runtest via et-dg-runtest.
> > 	* gcc.dg/graphite/graphite.exp: Likewise, but for 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_effective_target_mpaired_single_runtime): Likewise.
> > 	(check_effective_target_mips_loongson_runtime): Likewise.
> > 	(add_options_for_mpaired_single): Likewise.
> > 	(check_effective_target_vect_int): Add global et_index.
> > 	Check and save the supported feature for a target selected by
> > 	the et_index target.  Break long lines where appropriate.  Call
> > 	et-is-effective-target for MIPS with an argument instead of
> > 	check_effective_target_* where appropriate.
> > 	(check_effective_target_vect_intfloat_cvt): Likewise.
> > 	(check_effective_target_vect_uintfloat_cvt): Likewise.
> > 	(check_effective_target_vect_floatint_cvt): Likewise.
> > 	(check_effective_target_vect_floatuint_cvt): Likewise.
> > 	(check_effective_target_vect_simd_clones): Likewise.
> > 	(check_effective_target_vect_shift): ewise.
> > 	(check_effective_target_whole_vector_shift): Likewise.
> > 	(check_effective_target_vect_bswap): Likewise.
> > 	(check_effective_target_vect_shift_char): Likewise.
> > 	(check_effective_target_vect_long): Likewise.
> > 	(check_effective_target_vect_float): Likewise.
> > 	(check_effective_target_vect_double): Likewise.
> > 	(check_effective_target_vect_long_long): Likewise.
> > 	(check_effective_target_vect_no_int_max): Likewise.
> > 	(check_effective_target_vect_no_int_add): Likewise.
> > 	(check_effective_target_vect_no_bitwise): Likewise.
> > 	(check_effective_target_vect_widen_shift): Likewise.
> > 	(check_effective_target_vect_no_align): Likewise.
> > 	(check_effective_target_vect_hw_misalign): Likewise.
> > 	(check_effective_target_vect_element_align): Likewise.
> > 	(check_effective_target_vect_condition): Likewise.
> > 	(check_effective_target_vect_cond_mixed): Likewise.
> > 	(check_effective_target_vect_char_mult): Likewise.
> > 	(check_effective_target_vect_short_mult): Likewise.
> > 	(check_effective_target_vect_int_mult): Likewise.
> > 	(check_effective_target_vect_extract_even_odd): Likewise.
> > 	(check_effective_target_vect_interleave): Likewise.
> > 	(check_effective_target_vect_stridedN): Likewise.
> > 	(check_effective_target_vect_multiple_sizes): Likewise.
> > 	(check_effective_target_vect64): Likewise.
> > 	(check_effective_target_vect_call_copysignf): Likewise.
> > 	(check_effective_target_vect_call_sqrtf): Likewise.
> > 	(check_effective_target_vect_call_lrint): Likewise.
> > 	(check_effective_target_vect_call_btrunc): Likewise.
> > 	(check_effective_target_vect_call_btruncf): Likewise.
> > 	(check_effective_target_vect_call_ceil): Likewise.
> > 	(check_effective_target_vect_call_ceilf): Likewise.
> > 	(check_effective_target_vect_call_floor): Likewise.
> > 	(check_effective_target_vect_call_floorf): Likewise.
> > 	(check_effective_target_vect_call_lceil): Likewise.
> > 	(check_effective_target_vect_call_lfloor): Likewise.
> > 	(check_effective_target_vect_call_nearbyint): Likewise.
> > 	(check_effective_target_vect_call_nearbyintf): Likewise.
> > 	(check_effective_target_vect_call_round): Likewise.
> > 	(check_effective_target_vect_call_roundf): Likewise.
> > 	(check_effective_target_vect_perm): Likewise, but also append
> *_saved
> > 	to the existing global name to properly cache the result.
> > 	(check_effective_target_vect_perm_byte): Likewise.
> > 	(check_effective_target_vect_perm_short): Likewise.
> > 	(check_effective_target_vect_widen_sum_hi_to_si_pattern): Likewise.
> > 	(check_effective_target_vect_widen_sum_hi_to_si): Likewise.
> > 	(check_effective_target_vect_widen_sum_qi_to_hi): Likewise.
> > 	(check_effective_target_vect_widen_sum_qi_to_si): Likewise.
> > 	(check_effective_target_vect_widen_mult_qi_to_hi_pattern):
> Likewise.
> > 	(check_effective_target_vect_widen_mult_qi_to_hi): Likewise.
> > 	(check_effective_target_vect_widen_mult_hi_to_si_pattern):
> Likewise.
> > 	(check_effective_target_vect_widen_mult_si_to_di_pattern):
> Likewise.
> > 	(check_effective_target_vect_sdot_qi): Likewise.
> > 	(check_effective_target_vect_udot_qi): Likewise.
> > 	(check_effective_target_vect_sdot_hi): Likewise.
> > 	(check_effective_target_vect_udot_hi): Likewise.
> > 	(check_effective_target_vect_usad_char): Likewise.
> > 	(check_effective_target_vect_pack_trunc): Likewise.
> > 	(check_effective_target_vect_unpack): Likewise.
> > 	(check_effective_target_vect_aligned_arrays): Likewise.
> > 	(check_effective_target_vect_natural_alignment): Likewise.
> > 	(check_effective_target_vector_alignment_reachable): Likewise.
> > 	(check_effective_target_vector_alignment_reachable_for_64bit):
> Likewise.
> > 	(is-effective-target): Initialize et_index if undefined.
> > 	(et-dg-runtest): New.
> > 	(et-is-effective-target): Likewise.
> > 	(check_vect_support_and_set_flags): Add supported MIPS targets to
> > 	EFFECTIVE_TARGETS list.  Return the number of supported targets.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2016-01-11 13:35   ` Matthew Fortune
@ 2016-01-11 13:37     ` Robert Suchanek
  0 siblings, 0 replies; 17+ messages in thread
From: Robert Suchanek @ 2016-01-11 13:37 UTC (permalink / raw)
  To: Matthew Fortune, Catherine_Moore; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 8154 bytes --]

Hi Matthew,

The attached is the updated one.

Regards,
Robert

> -----Original Message-----
> From: Matthew Fortune
> Sent: 11 January 2016 13:35
> To: Robert Suchanek; Catherine_Moore@mentor.com
> Cc: gcc-patches@gcc.gnu.org
> Subject: RE: [PATCH 3/4] Add support to run auto-vectorization tests for
> multiple effective targets
> 
> Hi Robert,
> 
> Do you have an updated version of this patch? It no longer applies cleanly.
> 
> Thanks,
> Matthew
> 
> > -----Original Message-----
> > From: Robert Suchanek
> > Sent: 05 January 2016 16:17
> > To: Catherine_Moore@mentor.com; Matthew Fortune
> > Cc: gcc-patches@gcc.gnu.org
> > Subject: RE: [PATCH 3/4] Add support to run auto-vectorization tests for
> > multiple effective targets
> >
> > Ping.
> >
> > > -----Original Message-----
> > > From: gcc-patches-owner@gcc.gnu.org
> > > [mailto:gcc-patches-owner@gcc.gnu.org] On Behalf Of Robert Suchanek
> > > Sent: 10 August 2015 13:15
> > > To: Catherine_Moore@mentor.com; Matthew Fortune
> > > Cc: gcc-patches@gcc.gnu.org
> > > Subject: [PATCH 3/4] Add support to run auto-vectorization tests for
> > > multiple effective targets
> > >
> > > Hi,
> > >
> > > This patch allows to run auto-vectorization tests for more than one
> > > effective target.  The initial proposal
> > >
> > > https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02289.html
> > >
> > > had some issues that have been addressed and should work as expected
> > now.
> > >
> > > The idea was to add a wrapper procedure that would:
> > > 1. Iterative over a list of EFFECTIVE_TARGETS e.g. mips_msa,
> > mpaired_single.
> > > 2. Add necessary compile time options for each effective target.
> > > 3. Check if it's possible to compile and/or run on a target, and set
> > >    dg-do-what-default accordingly.
> > > 4. Set the target index to tell check_effective_target_vect_* which
> > target is
> > >    currently being processed.
> > > 5. Invoke {gfortran-,g++-,}dg-runtest with the list of vector tests as
> > normal.
> > >
> > > The above required that every vector feature e.g. vect_int that caches
> > > the result is capable of tracking what target supports a feature.  The
> > > result is saved to a list at an index controlled by the wrapper
> > > (et-dg-runtest).  Ports not using this feature, set DEFAULT_VECTFLAGS
> > > and the tests should run as they used to.
> > >
> > > The patch was additionally tested on x86_64-unknown-linux-gnu and
> > > aarch64- linux-gnu.
> > >
> > > Regards,
> > > Robert
> > >
> > > gcc/testsuite/ChangeLog:
> > >
> > > 	* g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS.
> > Call
> > > 	g++-dg-runtest via et-dg-runtest.
> > > 	* gcc.dg/graphite/graphite.exp: Likewise, but for 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_effective_target_mpaired_single_runtime): Likewise.
> > > 	(check_effective_target_mips_loongson_runtime): Likewise.
> > > 	(add_options_for_mpaired_single): Likewise.
> > > 	(check_effective_target_vect_int): Add global et_index.
> > > 	Check and save the supported feature for a target selected by
> > > 	the et_index target.  Break long lines where appropriate.  Call
> > > 	et-is-effective-target for MIPS with an argument instead of
> > > 	check_effective_target_* where appropriate.
> > > 	(check_effective_target_vect_intfloat_cvt): Likewise.
> > > 	(check_effective_target_vect_uintfloat_cvt): Likewise.
> > > 	(check_effective_target_vect_floatint_cvt): Likewise.
> > > 	(check_effective_target_vect_floatuint_cvt): Likewise.
> > > 	(check_effective_target_vect_simd_clones): Likewise.
> > > 	(check_effective_target_vect_shift): ewise.
> > > 	(check_effective_target_whole_vector_shift): Likewise.
> > > 	(check_effective_target_vect_bswap): Likewise.
> > > 	(check_effective_target_vect_shift_char): Likewise.
> > > 	(check_effective_target_vect_long): Likewise.
> > > 	(check_effective_target_vect_float): Likewise.
> > > 	(check_effective_target_vect_double): Likewise.
> > > 	(check_effective_target_vect_long_long): Likewise.
> > > 	(check_effective_target_vect_no_int_max): Likewise.
> > > 	(check_effective_target_vect_no_int_add): Likewise.
> > > 	(check_effective_target_vect_no_bitwise): Likewise.
> > > 	(check_effective_target_vect_widen_shift): Likewise.
> > > 	(check_effective_target_vect_no_align): Likewise.
> > > 	(check_effective_target_vect_hw_misalign): Likewise.
> > > 	(check_effective_target_vect_element_align): Likewise.
> > > 	(check_effective_target_vect_condition): Likewise.
> > > 	(check_effective_target_vect_cond_mixed): Likewise.
> > > 	(check_effective_target_vect_char_mult): Likewise.
> > > 	(check_effective_target_vect_short_mult): Likewise.
> > > 	(check_effective_target_vect_int_mult): Likewise.
> > > 	(check_effective_target_vect_extract_even_odd): Likewise.
> > > 	(check_effective_target_vect_interleave): Likewise.
> > > 	(check_effective_target_vect_stridedN): Likewise.
> > > 	(check_effective_target_vect_multiple_sizes): Likewise.
> > > 	(check_effective_target_vect64): Likewise.
> > > 	(check_effective_target_vect_call_copysignf): Likewise.
> > > 	(check_effective_target_vect_call_sqrtf): Likewise.
> > > 	(check_effective_target_vect_call_lrint): Likewise.
> > > 	(check_effective_target_vect_call_btrunc): Likewise.
> > > 	(check_effective_target_vect_call_btruncf): Likewise.
> > > 	(check_effective_target_vect_call_ceil): Likewise.
> > > 	(check_effective_target_vect_call_ceilf): Likewise.
> > > 	(check_effective_target_vect_call_floor): Likewise.
> > > 	(check_effective_target_vect_call_floorf): Likewise.
> > > 	(check_effective_target_vect_call_lceil): Likewise.
> > > 	(check_effective_target_vect_call_lfloor): Likewise.
> > > 	(check_effective_target_vect_call_nearbyint): Likewise.
> > > 	(check_effective_target_vect_call_nearbyintf): Likewise.
> > > 	(check_effective_target_vect_call_round): Likewise.
> > > 	(check_effective_target_vect_call_roundf): Likewise.
> > > 	(check_effective_target_vect_perm): Likewise, but also append
> > *_saved
> > > 	to the existing global name to properly cache the result.
> > > 	(check_effective_target_vect_perm_byte): Likewise.
> > > 	(check_effective_target_vect_perm_short): Likewise.
> > > 	(check_effective_target_vect_widen_sum_hi_to_si_pattern): Likewise.
> > > 	(check_effective_target_vect_widen_sum_hi_to_si): Likewise.
> > > 	(check_effective_target_vect_widen_sum_qi_to_hi): Likewise.
> > > 	(check_effective_target_vect_widen_sum_qi_to_si): Likewise.
> > > 	(check_effective_target_vect_widen_mult_qi_to_hi_pattern):
> > Likewise.
> > > 	(check_effective_target_vect_widen_mult_qi_to_hi): Likewise.
> > > 	(check_effective_target_vect_widen_mult_hi_to_si_pattern):
> > Likewise.
> > > 	(check_effective_target_vect_widen_mult_si_to_di_pattern):
> > Likewise.
> > > 	(check_effective_target_vect_sdot_qi): Likewise.
> > > 	(check_effective_target_vect_udot_qi): Likewise.
> > > 	(check_effective_target_vect_sdot_hi): Likewise.
> > > 	(check_effective_target_vect_udot_hi): Likewise.
> > > 	(check_effective_target_vect_usad_char): Likewise.
> > > 	(check_effective_target_vect_pack_trunc): Likewise.
> > > 	(check_effective_target_vect_unpack): Likewise.
> > > 	(check_effective_target_vect_aligned_arrays): Likewise.
> > > 	(check_effective_target_vect_natural_alignment): Likewise.
> > > 	(check_effective_target_vector_alignment_reachable): Likewise.
> > > 	(check_effective_target_vector_alignment_reachable_for_64bit):
> > Likewise.
> > > 	(is-effective-target): Initialize et_index if undefined.
> > > 	(et-dg-runtest): New.
> > > 	(et-is-effective-target): Likewise.
> > > 	(check_vect_support_and_set_flags): Add supported MIPS targets to
> > > 	EFFECTIVE_TARGETS list.  Return the number of supported targets.

[-- Attachment #2: 0004-Add-support-to-run-auto-vectorization-tests-for-mult.patch --]
[-- Type: application/octet-stream, Size: 113872 bytes --]

From 1439e6da4edd97c817083ce12a828e3539a70890 Mon Sep 17 00:00:00 2001
From: Robert Suchanek <robert.suchanek@imgtec.com>
Date: Wed, 5 Aug 2015 16:47:06 +0100
Subject: [PATCH 4/5] Add support to run auto-vectorization tests for multiple
 effective targets.

gcc/testsuite/ChangeLog:

	* g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS. Call
	g++-dg-runtest via et-dg-runtest.
	* gcc.dg/graphite/graphite.exp: Likewise, but for 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_effective_target_mpaired_single_runtime): Likewise.
	(check_effective_target_mips_loongson_runtime): Likewise.
	(add_options_for_mpaired_single): Likewise.
	(check_effective_target_vect_int): Add global et_index.
	Check and save the supported feature for a target selected by
	the et_index target.  Break long lines where appropriate.  Call
	et-is-effective-target for MIPS with an argument instead of
	check_effective_target_* where appropriate.
	(check_effective_target_vect_intfloat_cvt): Likewise.
	(check_effective_target_vect_uintfloat_cvt): Likewise.
	(check_effective_target_vect_floatint_cvt): Likewise.
	(check_effective_target_vect_floatuint_cvt): Likewise.
	(check_effective_target_vect_simd_clones): Likewise.
	(check_effective_target_vect_shift): ewise.
	(check_effective_target_whole_vector_shift): Likewise.
	(check_effective_target_vect_bswap): Likewise.
	(check_effective_target_vect_shift_char): Likewise.
	(check_effective_target_vect_long): Likewise.
	(check_effective_target_vect_float): Likewise.
	(check_effective_target_vect_double): Likewise.
	(check_effective_target_vect_long_long): Likewise.
	(check_effective_target_vect_no_int_max): Likewise.
	(check_effective_target_vect_no_int_add): Likewise.
	(check_effective_target_vect_no_bitwise): Likewise.
	(check_effective_target_vect_widen_shift): Likewise.
	(check_effective_target_vect_no_align): Likewise.
	(check_effective_target_vect_hw_misalign): Likewise.
	(check_effective_target_vect_element_align): Likewise.
	(check_effective_target_vect_condition): Likewise.
	(check_effective_target_vect_cond_mixed): Likewise.
	(check_effective_target_vect_char_mult): Likewise.
	(check_effective_target_vect_short_mult): Likewise.
	(check_effective_target_vect_int_mult): Likewise.
	(check_effective_target_vect_extract_even_odd): Likewise.
	(check_effective_target_vect_interleave): Likewise.
	(check_effective_target_vect_stridedN): Likewise.
	(check_effective_target_vect_multiple_sizes): Likewise.
	(check_effective_target_vect64): Likewise.
	(check_effective_target_vect_call_copysignf): Likewise.
	(check_effective_target_vect_call_sqrtf): Likewise.
	(check_effective_target_vect_call_lrint): Likewise.
	(check_effective_target_vect_call_btrunc): Likewise.
	(check_effective_target_vect_call_btruncf): Likewise.
	(check_effective_target_vect_call_ceil): Likewise.
	(check_effective_target_vect_call_ceilf): Likewise.
	(check_effective_target_vect_call_floor): Likewise.
	(check_effective_target_vect_call_floorf): Likewise.
	(check_effective_target_vect_call_lceil): Likewise.
	(check_effective_target_vect_call_lfloor): Likewise.
	(check_effective_target_vect_call_nearbyint): Likewise.
	(check_effective_target_vect_call_nearbyintf): Likewise.
	(check_effective_target_vect_call_round): Likewise.
	(check_effective_target_vect_call_roundf): Likewise.
	(check_effective_target_vect_perm): Likewise, but also append *_saved
	to the existing global name to properly cache the result.
	(check_effective_target_vect_perm_byte): Likewise.
	(check_effective_target_vect_perm_short): Likewise.
	(check_effective_target_vect_widen_sum_hi_to_si_pattern): Likewise.
	(check_effective_target_vect_widen_sum_hi_to_si): Likewise.
	(check_effective_target_vect_widen_sum_qi_to_hi): Likewise.
	(check_effective_target_vect_widen_sum_qi_to_si): Likewise.
	(check_effective_target_vect_widen_mult_qi_to_hi_pattern): Likewise.
	(check_effective_target_vect_widen_mult_qi_to_hi): Likewise.
	(check_effective_target_vect_widen_mult_hi_to_si_pattern): Likewise.
	(check_effective_target_vect_widen_mult_si_to_di_pattern): Likewise.
	(check_effective_target_vect_sdot_qi): Likewise.
	(check_effective_target_vect_udot_qi): Likewise.
	(check_effective_target_vect_sdot_hi): Likewise.
	(check_effective_target_vect_udot_hi): Likewise.
	(check_effective_target_vect_usad_char): Likewise.
	(check_effective_target_vect_pack_trunc): Likewise.
	(check_effective_target_vect_unpack): Likewise.
	(check_effective_target_vect_aligned_arrays): Likewise.
	(check_effective_target_vect_natural_alignment): Likewise.
	(check_effective_target_vector_alignment_reachable): Likewise.
	(check_effective_target_vector_alignment_reachable_for_64bit): Likewise.
	(is-effective-target): Initialize et_index if undefined.
	(et-dg-runtest): New.
	(et-is-effective-target): Likewise.
	(check_vect_support_and_set_flags): Add supported MIPS targets to
	EFFECTIVE_TARGETS list.  Return the number of supported targets.
---
 gcc/testsuite/g++.dg/vect/vect.exp              |   17 +-
 gcc/testsuite/gcc.dg/graphite/graphite.exp      |    7 +-
 gcc/testsuite/gcc.dg/vect/vect.exp              |  158 ++--
 gcc/testsuite/gfortran.dg/graphite/graphite.exp |    8 +-
 gcc/testsuite/gfortran.dg/vect/vect.exp         |   46 +-
 gcc/testsuite/lib/target-supports.exp           | 1111 ++++++++++++++---------
 6 files changed, 854 insertions(+), 493 deletions(-)

diff --git a/gcc/testsuite/g++.dg/vect/vect.exp b/gcc/testsuite/g++.dg/vect/vect.exp
index 0492cc3..18ccc17 100644
--- a/gcc/testsuite/g++.dg/vect/vect.exp
+++ b/gcc/testsuite/g++.dg/vect/vect.exp
@@ -39,6 +39,11 @@ set save-dg-do-what-default ${dg-do-what-default}
 global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS ""
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_TARGETS ""
+
 # These flags are used for all targets.
 lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fno-vect-cost-model"
 
@@ -58,10 +63,10 @@ lappend VECT_SLP_CFLAGS "-fdump-tree-slp-details"
 dg-init
 
 # Main loop.
-g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/{pr,simd}*.{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,simd}*.{c,cc,S} ]] "" $DEFAULT_VECTCFLAGS
+et-dg-runtest g++-dg-runtest [lsort [glob -nocomplain \
+	$srcdir/$subdir/slp-pr*.{c,cc,S} ]] "" $VECT_SLP_CFLAGS
 
 #### Tests with special options
 global SAVED_DEFAULT_VECTCFLAGS
@@ -70,8 +75,8 @@ set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
 # --param max-aliased-vops=0
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "--param max-aliased-vops=0"
-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
 
 # Clean up.
 set dg-do-what-default ${save-dg-do-what-default} 
diff --git a/gcc/testsuite/gcc.dg/graphite/graphite.exp b/gcc/testsuite/gcc.dg/graphite/graphite.exp
index 8e1a229..65a0451 100644
--- a/gcc/testsuite/gcc.dg/graphite/graphite.exp
+++ b/gcc/testsuite/gcc.dg/graphite/graphite.exp
@@ -37,6 +37,11 @@ set save-dg-do-what-default ${dg-do-what-default}
 # Initialize `dg'.
 dg-init
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_TARGETS ""
+
 set wait_to_run_files [lsort [glob -nocomplain $srcdir/$subdir/*.c ] ]
 set scop_files        [lsort [glob -nocomplain $srcdir/$subdir/scop-*.c ] ]
 set id_files          [lsort [glob -nocomplain $srcdir/$subdir/id-*.c ] ]
@@ -64,7 +69,7 @@ global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details -ffast-math"
 
 if [check_vect_support_and_set_flags] {
-    dg-runtest $vect_files        "" $DEFAULT_VECTCFLAGS
+    et-dg-runtest dg-runtest $vect_files        "" $DEFAULT_VECTCFLAGS
 }
 
 # 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..bd30d8a 100644
--- a/gcc/testsuite/gcc.dg/vect/vect.exp
+++ b/gcc/testsuite/gcc.dg/vect/vect.exp
@@ -24,6 +24,11 @@ load_lib clearcap.exp
 global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS ""
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_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 +67,15 @@ lappend O_VECTCFLAGS "-fdump-tree-vect-details"
 lappend DEFAULT_VECTCFLAGS "-O2"
 
 # 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
 
 # "-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
 
 set VECT_SLP_CFLAGS $DEFAULT_VECTCFLAGS
 
@@ -81,14 +88,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
 }
 
 #### Tests with special options
@@ -99,141 +110,164 @@ set SAVED_VECT_SLP_CFLAGS $VECT_SLP_CFLAGS
 # --param vect-max-version-for-alias-checks=0 tests
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=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
 
 # -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
 
 # -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-*.\[cS\]]]  \
-        "" $VECT_SLP_CFLAGS
+et-dg-runtest dg-runtest [lsort \
+	[glob -nocomplain $srcdir/$subdir/fast-math-bb-slp-*.\[cS\]]] \
+	"" $VECT_SLP_CFLAGS
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 # 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-anchors-*.\[cS\]]]  \
+et-dg-runtest dg-runtest [lsort \
+	[glob -nocomplain $srcdir/$subdir/aligned-section-anchors-*.\[cS\]]] \
 	"" $DEFAULT_VECTCFLAGS
 
 # -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
 
 # -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
 
 # -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-*.\[cS\]]]  \
+et-dg-runtest dg-runtest [lsort \
+	[glob -nocomplain $srcdir/$subdir/no-trapping-math-*.\[cS\]]] \
 	"" $DEFAULT_VECTCFLAGS
 
 # -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
 
 # -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
 
 # -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-*.\[cS\]]]  \
-        "" $DEFAULT_VECTCFLAGS
+et-dg-runtest dg-runtest [lsort \
+	[glob -nocomplain $srcdir/$subdir/no-scevccp-outer-*.\[cS\]]] \
+	"" $DEFAULT_VECTCFLAGS
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 # 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
 
 # With --param ggc-min-expand=0 --param ggc-min-heapsize=0 
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "--param" "ggc-min-expand=0" "--param" "ggc-min-heapsize=0"
-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
 
 # -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
 
 # With -O3.
 # Don't allow IPA cloning, because it throws our counts out of whack.
@@ -242,40 +276,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
 
 # 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
 
 # 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
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 
 # Clean up.
diff --git a/gcc/testsuite/gfortran.dg/graphite/graphite.exp b/gcc/testsuite/gfortran.dg/graphite/graphite.exp
index 93863c3..4aa7397 100644
--- a/gcc/testsuite/gfortran.dg/graphite/graphite.exp
+++ b/gcc/testsuite/gfortran.dg/graphite/graphite.exp
@@ -51,9 +51,15 @@ gfortran-dg-runtest $scop_files        "" "-O2 -fgraphite -fdump-tree-graphite-a
 gfortran-dg-runtest $id_files          "" "-O2 -fgraphite-identity -ffast-math"
 gfortran-dg-runtest $opt_files         "" "-O2 -floop-nest-optimize -ffast-math -fdump-tree-graphite-all"
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_TARGETS ""
+
 # Vectorizer tests, to be run or compiled, depending on target capabilities.
 if [check_vect_support_and_set_flags] {
-    gfortran-dg-runtest $vect_files "" "-O2 -fgraphite-identity -ftree-vectorize -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 -fdump-tree-vect-details -ffast-math"
 }
 
 # Tests to be run.
diff --git a/gcc/testsuite/gfortran.dg/vect/vect.exp b/gcc/testsuite/gfortran.dg/vect/vect.exp
index e8f2b1c..466178d 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect.exp
+++ b/gcc/testsuite/gfortran.dg/vect/vect.exp
@@ -24,6 +24,11 @@ load_lib target-supports.exp
 global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS ""
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_TARGETS ""
+
 # These flags are used for all targets.
 lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model=unlimited" \
   "-fdump-tree-vect-details"
@@ -47,8 +52,10 @@ if ![check_vect_support_and_set_flags] {
 dg-init
 
 # 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\]{,90,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
 
 #### Tests with special options
 global SAVED_DEFAULT_VECTCFLAGS
@@ -57,44 +64,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
 
 # -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-real8*.\[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
 
 # -fvect-cost-model tests
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "-fvect-cost-model=dynamic"
-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
 
 # --param vect-max-version-for-alias-checks=0 tests
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=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
 
 # 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
 
 # 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
 
 # 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-copy-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
 
 # 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/target-supports.exp
index 10d6444..e950ec1 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1550,6 +1550,47 @@ proc check_sse_hw_available { } {
     }]
 }
 
+# Return 1 if the target supports executing MIPS Paired-Single instructions,
+# 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.ps $f2,$f4,$f6");
+		return 0;
+	      }
+	    } ""
+	}
+    }]
+}
+
+# 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 <loongson.h>
+	      int main()
+	      {
+		asm volatile ("paddw $f2,$f4,$f6");
+		return 0;
+	      }
+	    } ""
+	}
+    }]
+}
+
 # Return 1 if the target supports executing SSE2 instructions, 0
 # otherwise.  Cache the result.
 
@@ -1619,6 +1660,27 @@ proc check_effective_target_sse2_runtime { } {
     return 0
 }
 
+# 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 otherwise.
+
+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 AVX executables, 0 otherwise.
 
 proc check_effective_target_avx_runtime { } {
@@ -2444,11 +2506,12 @@ proc check_effective_target_vect_cmdline_needed { } {
 
 proc check_effective_target_vect_int { } {
     global et_vect_int_saved
+    global et_index
 
-    if [info exists et_vect_int_saved] {
+    if [info exists et_vect_int_saved($et_index)] {
 	verbose "check_effective_target_vect_int: using cached result" 2
     } else {
-	set et_vect_int_saved 0
+	set et_vect_int_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
              || ([istarget powerpc*-*-*]
                   && ![istarget powerpc-*-linux*paired*])
@@ -2459,13 +2522,14 @@ proc check_effective_target_vect_int { } {
 	      || [istarget aarch64*-*-*]
 	      || [check_effective_target_arm32]
 	      || ([istarget mips*-*-*]
-		  && [check_effective_target_mips_loongson]) } {
-	   set et_vect_int_saved 1
+		  && [et-is-effective-target mips_loongson]) } {
+	    set et_vect_int_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_int: returning $et_vect_int_saved" 2
-    return $et_vect_int_saved
+    verbose "check_effective_target_vect_int:\
+	     returning $et_vect_int_saved($et_index)" 2
+    return $et_vect_int_saved($et_index)
 }
 
 # Return 1 if the target supports signed int->float conversion 
@@ -2473,22 +2537,25 @@ proc check_effective_target_vect_int { } {
 
 proc check_effective_target_vect_intfloat_cvt { } {
     global et_vect_intfloat_cvt_saved
+    global et_index
 
-    if [info exists et_vect_intfloat_cvt_saved] {
-        verbose "check_effective_target_vect_intfloat_cvt: using cached result" 2
+    if [info exists et_vect_intfloat_cvt_saved($et_index)] {
+	verbose "check_effective_target_vect_intfloat_cvt:\
+		 using cached result" 2
     } else {
-        set et_vect_intfloat_cvt_saved 0
+	set et_vect_intfloat_cvt_saved($et_index) 0
         if { [istarget i?86-*-*] || [istarget x86_64-*-*]
               || ([istarget powerpc*-*-*]
                    && ![istarget powerpc-*-linux*paired*])
               || ([istarget arm*-*-*]
                   && [check_effective_target_arm_neon_ok])} {
-           set et_vect_intfloat_cvt_saved 1
+	   set et_vect_intfloat_cvt_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_intfloat_cvt: returning $et_vect_intfloat_cvt_saved" 2
-    return $et_vect_intfloat_cvt_saved
+    verbose "check_effective_target_vect_intfloat_cvt:\
+	     returning $et_vect_intfloat_cvt_saved($et_index)" 2
+    return $et_vect_intfloat_cvt_saved($et_index)
 }
 
 #Return 1 if we're supporting __int128 for target, 0 otherwise.
@@ -2510,23 +2577,26 @@ proc check_effective_target_int128 { } {
 
 proc check_effective_target_vect_uintfloat_cvt { } {
     global et_vect_uintfloat_cvt_saved
+    global et_index
 
-    if [info exists et_vect_uintfloat_cvt_saved] {
-        verbose "check_effective_target_vect_uintfloat_cvt: using cached result" 2
+    if [info exists et_vect_uintfloat_cvt_saved($et_index)] {
+	verbose "check_effective_target_vect_uintfloat_cvt:\
+		 using cached result" 2
     } else {
-        set et_vect_uintfloat_cvt_saved 0
+	set et_vect_uintfloat_cvt_saved($et_index) 0
         if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	      || ([istarget powerpc*-*-*]
 		  && ![istarget powerpc-*-linux*paired*])
 	      || [istarget aarch64*-*-*]
 	      || ([istarget arm*-*-*]
 		  && [check_effective_target_arm_neon_ok])} {
-           set et_vect_uintfloat_cvt_saved 1
+	   set et_vect_uintfloat_cvt_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_uintfloat_cvt: returning $et_vect_uintfloat_cvt_saved" 2
-    return $et_vect_uintfloat_cvt_saved
+    verbose "check_effective_target_vect_uintfloat_cvt:\
+	     returning $et_vect_uintfloat_cvt_saved($et_index)" 2
+    return $et_vect_uintfloat_cvt_saved($et_index)
 }
 
 
@@ -2535,22 +2605,25 @@ proc check_effective_target_vect_uintfloat_cvt { } {
 
 proc check_effective_target_vect_floatint_cvt { } {
     global et_vect_floatint_cvt_saved
+    global et_index
 
-    if [info exists et_vect_floatint_cvt_saved] {
-        verbose "check_effective_target_vect_floatint_cvt: using cached result" 2
+    if [info exists et_vect_floatint_cvt_saved($et_index)] {
+	verbose "check_effective_target_vect_floatint_cvt:\
+		 using cached result" 2
     } else {
-        set et_vect_floatint_cvt_saved 0
+	set et_vect_floatint_cvt_saved($et_index) 0
         if { [istarget i?86-*-*] || [istarget x86_64-*-*]
               || ([istarget powerpc*-*-*]
                    && ![istarget powerpc-*-linux*paired*])
               || ([istarget arm*-*-*]
                   && [check_effective_target_arm_neon_ok])} {
-           set et_vect_floatint_cvt_saved 1
+	   set et_vect_floatint_cvt_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_floatint_cvt: returning $et_vect_floatint_cvt_saved" 2
-    return $et_vect_floatint_cvt_saved
+    verbose "check_effective_target_vect_floatint_cvt:\
+	     returning $et_vect_floatint_cvt_saved($et_index)" 2
+    return $et_vect_floatint_cvt_saved($et_index)
 }
 
 # Return 1 if the target supports unsigned float->int conversion
@@ -2558,21 +2631,24 @@ proc check_effective_target_vect_floatint_cvt { } {
 
 proc check_effective_target_vect_floatuint_cvt { } {
     global et_vect_floatuint_cvt_saved
+    global et_index
 
-    if [info exists et_vect_floatuint_cvt_saved] {
-        verbose "check_effective_target_vect_floatuint_cvt: using cached result" 2
+    if [info exists et_vect_floatuint_cvt_saved($et_index)] {
+	verbose "check_effective_target_vect_floatuint_cvt:\
+		 using cached result" 2
     } else {
-        set et_vect_floatuint_cvt_saved 0
+	set et_vect_floatuint_cvt_saved($et_index) 0
         if { ([istarget powerpc*-*-*]
 	      && ![istarget powerpc-*-linux*paired*])
 	    || ([istarget arm*-*-*]
-	        && [check_effective_target_arm_neon_ok])} {
-           set et_vect_floatuint_cvt_saved 1
+		&& [check_effective_target_arm_neon_ok])} {
+	   set et_vect_floatuint_cvt_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_floatuint_cvt: returning $et_vect_floatuint_cvt_saved" 2
-    return $et_vect_floatuint_cvt_saved
+    verbose "check_effective_target_vect_floatuint_cvt:\
+	     returning $et_vect_floatuint_cvt_saved($et_index)" 2
+    return $et_vect_floatuint_cvt_saved($et_index)
 }
 
 # Return 1 if the target supports #pragma omp declare simd, 0 otherwise.
@@ -2581,24 +2657,26 @@ proc check_effective_target_vect_floatuint_cvt { } {
 
 proc check_effective_target_vect_simd_clones { } {
     global et_vect_simd_clones_saved
+    global et_index
 
-    if [info exists et_vect_simd_clones_saved] {
+    if [info exists et_vect_simd_clones_saved($et_index)] {
 	verbose "check_effective_target_vect_simd_clones: using cached result" 2
     } else {
-	set et_vect_simd_clones_saved 0
+	set et_vect_simd_clones_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*] } {
 	    # On i?86/x86_64 #pragma omp declare simd builds a sse2, avx and
 	    # avx2 clone.  Only the right clone for the specified arch will be
 	    # chosen, but still we need to at least be able to assemble
 	    # avx2.
 	    if { [check_effective_target_avx2] } {
-		set et_vect_simd_clones_saved 1
+		set et_vect_simd_clones_saved($et_index) 1
 	    }
 	}
     }
 
-    verbose "check_effective_target_vect_simd_clones: returning $et_vect_simd_clones_saved" 2
-    return $et_vect_simd_clones_saved
+    verbose "check_effective_target_vect_simd_clones:\
+	     returning $et_vect_simd_clones_saved($et_index)" 2
+    return $et_vect_simd_clones_saved($et_index)
 }
 
 # Return 1 if this is a AArch64 target supporting big endian
@@ -3420,6 +3498,15 @@ proc check_effective_target_arm_neonv2 { } {
     }
 }
 
+# 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"
+}
+
 # Return 1 if this a Loongson-2E or -2F target using an ABI that supports
 # the Loongson vector modes.
 
@@ -3941,11 +4028,12 @@ proc check_effective_target_sparc_vis { } {
 
 proc check_effective_target_vect_shift { } {
     global et_vect_shift_saved
+    global et_index
 
-    if [info exists et_vect_shift_saved] {
+    if [info exists et_vect_shift_saved($et_index)] {
 	verbose "check_effective_target_vect_shift: using cached result" 2
     } else {
-	set et_vect_shift_saved 0
+	set et_vect_shift_saved($et_index) 0
 	if { ([istarget powerpc*-*-*]
              && ![istarget powerpc-*-linux*paired*])
 	     || [istarget ia64-*-*]
@@ -3953,13 +4041,14 @@ proc check_effective_target_vect_shift { } {
 	     || [istarget aarch64*-*-*]
 	     || [check_effective_target_arm32]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mips_loongson]) } {
-	   set et_vect_shift_saved 1
+		&& [et-is-effective-target mips_loongson]) } {
+	   set et_vect_shift_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_shift: returning $et_vect_shift_saved" 2
-    return $et_vect_shift_saved
+    verbose "check_effective_target_vect_shift:\
+	     returning $et_vect_shift_saved($et_index)" 2
+    return $et_vect_shift_saved($et_index)
 }
 
 proc check_effective_target_whole_vector_shift { } {
@@ -3969,7 +4058,7 @@ proc check_effective_target_whole_vector_shift { } {
 	 || ([check_effective_target_arm32]
 	     && [check_effective_target_arm_little_endian])
 	 || ([istarget mips*-*-*]
-	     && [check_effective_target_mips_loongson]) } {
+	     && [et-is-effective-target mips_loongson]) } {
 	set answer 1
     } else {
 	set answer 0
@@ -3983,41 +4072,45 @@ proc check_effective_target_whole_vector_shift { } {
 
 proc check_effective_target_vect_bswap { } {
     global et_vect_bswap_saved
+    global et_index
 
-    if [info exists et_vect_bswap_saved] {
+    if [info exists et_vect_bswap_saved($et_index)] {
 	verbose "check_effective_target_vect_bswap: using cached result" 2
     } else {
-	set et_vect_bswap_saved 0
+	set et_vect_bswap_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
              || ([istarget arm*-*-*]
                 && [check_effective_target_arm_neon])
 	   } {
-	   set et_vect_bswap_saved 1
+	   set et_vect_bswap_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_bswap: returning $et_vect_bswap_saved" 2
-    return $et_vect_bswap_saved
+    verbose "check_effective_target_vect_bswap:\
+	     returning $et_vect_bswap_saved($et_index)" 2
+    return $et_vect_bswap_saved($et_index)
 }
 
 # Return 1 if the target supports hardware vector shift operation for char.
 
 proc check_effective_target_vect_shift_char { } {
     global et_vect_shift_char_saved
+    global et_index
 
-    if [info exists et_vect_shift_char_saved] {
+    if [info exists et_vect_shift_char_saved($et_index)] {
 	verbose "check_effective_target_vect_shift_char: using cached result" 2
     } else {
-	set et_vect_shift_char_saved 0
+	set et_vect_shift_char_saved($et_index) 0
 	if { ([istarget powerpc*-*-*]
              && ![istarget powerpc-*-linux*paired*])
 	     || [check_effective_target_arm32] } {
-	   set et_vect_shift_char_saved 1
+	   set et_vect_shift_char_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_shift_char: returning $et_vect_shift_char_saved" 2
-    return $et_vect_shift_char_saved
+    verbose "check_effective_target_vect_shift_char:\
+	     returning $et_vect_shift_char_saved($et_index)" 2
+    return $et_vect_shift_char_saved($et_index)
 }
 
 # Return 1 if the target supports hardware vectors of long, 0 otherwise.
@@ -4046,11 +4139,12 @@ proc check_effective_target_vect_long { } {
 
 proc check_effective_target_vect_float { } {
     global et_vect_float_saved
+    global et_index
 
-    if [info exists et_vect_float_saved] {
+    if [info exists et_vect_float_saved($et_index)] {
 	verbose "check_effective_target_vect_float: using cached result" 2
     } else {
-	set et_vect_float_saved 0
+	set et_vect_float_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	      || [istarget powerpc*-*-*]
 	      || [istarget spu-*-*]
@@ -4059,12 +4153,13 @@ proc check_effective_target_vect_float { } {
 	      || [istarget ia64-*-*]
 	      || [istarget aarch64*-*-*]
 	      || [check_effective_target_arm32] } {
-	   set et_vect_float_saved 1
+	   set et_vect_float_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_float: returning $et_vect_float_saved" 2
-    return $et_vect_float_saved
+    verbose "check_effective_target_vect_float:\
+	     returning $et_vect_float_saved($et_index)" 2
+    return $et_vect_float_saved($et_index)
 }
 
 # Return 1 if the target supports hardware vectors of double, 0 otherwise.
@@ -4073,11 +4168,12 @@ proc check_effective_target_vect_float { } {
 
 proc check_effective_target_vect_double { } {
     global et_vect_double_saved
+    global et_index
 
-    if [info exists et_vect_double_saved] {
+    if [info exists et_vect_double_saved($et_index)] {
 	verbose "check_effective_target_vect_double: using cached result" 2
     } else {
-	set et_vect_double_saved 0
+	set et_vect_double_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget aarch64*-*-*] } {
 	   if { [check_no_compiler_messages vect_double assembly {
@@ -4085,19 +4181,20 @@ proc check_effective_target_vect_double { } {
 		 # error No double vectorizer support.
 		 #endif
 		}] } {
-		set et_vect_double_saved 1
+		set et_vect_double_saved($et_index) 1
 	    } else {
-		set et_vect_double_saved 0
+		set et_vect_double_saved($et_index) 0
 	    }
 	} elseif { [istarget spu-*-*] } {
-	   set et_vect_double_saved 1
+	   set et_vect_double_saved($et_index) 1
 	} elseif { [istarget powerpc*-*-*] && [check_vsx_hw_available] } {
-	   set et_vect_double_saved 1
+	   set et_vect_double_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_double: returning $et_vect_double_saved" 2
-    return $et_vect_double_saved
+    verbose "check_effective_target_vect_double:\
+	     returning $et_vect_double_saved($et_index)" 2
+    return $et_vect_double_saved($et_index)
 }
 
 # Return 1 if the target supports hardware vectors of long long, 0 otherwise.
@@ -4106,18 +4203,20 @@ proc check_effective_target_vect_double { } {
 
 proc check_effective_target_vect_long_long { } {
     global et_vect_long_long_saved
+    global et_index
 
-    if [info exists et_vect_long_long_saved] {
+    if [info exists et_vect_long_long_saved($et_index)] {
         verbose "check_effective_target_vect_long_long: using cached result" 2
     } else {
-        set et_vect_long_long_saved 0
-        if { [istarget i?86-*-*] || [istarget x86_64-*-*] } {
-           set et_vect_long_long_saved 1
+	set et_vect_long_long_saved($et_index) 0
+	if { [istarget i?86-*-*] || [istarget x86_64-*-*] } {
+	   set et_vect_long_long_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_long_long: returning $et_vect_long_long_saved" 2
-    return $et_vect_long_long_saved
+    verbose "check_effective_target_vect_long_long:\
+	     returning $et_vect_long_long_saved($et_index)" 2
+    return $et_vect_long_long_saved($et_index)
 }
 
 
@@ -4128,21 +4227,24 @@ proc check_effective_target_vect_long_long { } {
 
 proc check_effective_target_vect_no_int_min_max { } {
     global et_vect_no_int_min_max_saved
+    global et_index
 
-    if [info exists et_vect_no_int_min_max_saved] {
-	verbose "check_effective_target_vect_no_int_min_max: using cached result" 2
+    if [info exists et_vect_no_int_min_max_saved($et_index)] {
+	verbose "check_effective_target_vect_no_int_min_max:\
+		 using cached result" 2
     } else {
-	set et_vect_no_int_min_max_saved 0
+	set et_vect_no_int_min_max_saved($et_index) 0
 	if { [istarget sparc*-*-*]
 	     || [istarget spu-*-*]
 	     || [istarget alpha*-*-*]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mips_loongson]) } {
-	    set et_vect_no_int_min_max_saved 1
+		 && [et-is-effective-target mips_loongson]) } {
+	    set et_vect_no_int_min_max_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_no_int_min_max: returning $et_vect_no_int_min_max_saved" 2
-    return $et_vect_no_int_min_max_saved
+    verbose "check_effective_target_vect_no_int_min_max:\
+	     returning $et_vect_no_int_min_max_saved($et_index)" 2
+    return $et_vect_no_int_min_max_saved($et_index)
 }
 
 # Return 1 if the target plus current options does not support a vector
@@ -4152,18 +4254,20 @@ proc check_effective_target_vect_no_int_min_max { } {
 
 proc check_effective_target_vect_no_int_add { } {
     global et_vect_no_int_add_saved
+    global et_index
 
-    if [info exists et_vect_no_int_add_saved] {
+    if [info exists et_vect_no_int_add_saved($et_index)] {
 	verbose "check_effective_target_vect_no_int_add: using cached result" 2
     } else {
-	set et_vect_no_int_add_saved 0
+	set et_vect_no_int_add_saved($et_index) 0
 	# Alpha only supports vector add on V8QI and V4HI.
 	if { [istarget alpha*-*-*] } {
-	    set et_vect_no_int_add_saved 1
+	    set et_vect_no_int_add_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_no_int_add: returning $et_vect_no_int_add_saved" 2
-    return $et_vect_no_int_add_saved
+    verbose "check_effective_target_vect_no_int_add:\
+	     returning $et_vect_no_int_add_saved($et_index)" 2
+    return $et_vect_no_int_add_saved($et_index)
 }
 
 # Return 1 if the target plus current options does not support vector
@@ -4173,14 +4277,16 @@ proc check_effective_target_vect_no_int_add { } {
 
 proc check_effective_target_vect_no_bitwise { } {
     global et_vect_no_bitwise_saved
+    global et_index
 
-    if [info exists et_vect_no_bitwise_saved] {
+    if [info exists et_vect_no_bitwise_saved($et_index)] {
 	verbose "check_effective_target_vect_no_bitwise: using cached result" 2
     } else {
-	set et_vect_no_bitwise_saved 0
+	set et_vect_no_bitwise_saved($et_index) 0
     }
-    verbose "check_effective_target_vect_no_bitwise: returning $et_vect_no_bitwise_saved" 2
-    return $et_vect_no_bitwise_saved
+    verbose "check_effective_target_vect_no_bitwise:\
+	     returning $et_vect_no_bitwise_saved($et_index)" 2
+    return $et_vect_no_bitwise_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports vector permutation,
@@ -4189,24 +4295,26 @@ proc check_effective_target_vect_no_bitwise { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_perm { } {
-    global et_vect_perm
+    global et_vect_perm_saved
+    global et_index
 
-    if [info exists et_vect_perm_saved] {
+    if [info exists et_vect_perm_saved($et_index)] {
         verbose "check_effective_target_vect_perm: using cached result" 2
     } else {
-        set et_vect_perm_saved 0
+	set et_vect_perm_saved($et_index) 0
         if { [is-effective-target arm_neon_ok]
 	     || [istarget aarch64*-*-*]
 	     || [istarget powerpc*-*-*]
              || [istarget spu-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mpaired_single]) } {
-            set et_vect_perm_saved 1
+		 && [et-is-effective-target mpaired_single]) } {
+	    set et_vect_perm_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_perm: returning $et_vect_perm_saved" 2
-    return $et_vect_perm_saved
+    verbose "check_effective_target_vect_perm:\
+	     returning $et_vect_perm_saved($et_index)" 2
+    return $et_vect_perm_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports vector permutation
@@ -4215,23 +4323,25 @@ proc check_effective_target_vect_perm { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_perm_byte { } {
-    global et_vect_perm_byte
+    global et_vect_perm_byte_saved
+    global et_index
 
-    if [info exists et_vect_perm_byte_saved] {
+    if [info exists et_vect_perm_byte_saved($et_index)] {
         verbose "check_effective_target_vect_perm_byte: using cached result" 2
     } else {
-        set et_vect_perm_byte_saved 0
+	set et_vect_perm_byte_saved($et_index) 0
         if { ([is-effective-target arm_neon_ok]
 	      && [is-effective-target arm_little_endian])
 	     || ([istarget aarch64*-*-*]
 		 && [is-effective-target aarch64_little_endian])
 	     || [istarget powerpc*-*-*]
              || [istarget spu-*-*] } {
-            set et_vect_perm_byte_saved 1
+	    set et_vect_perm_byte_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_perm_byte: returning $et_vect_perm_byte_saved" 2
-    return $et_vect_perm_byte_saved
+    verbose "check_effective_target_vect_perm_byte:\
+	     returning $et_vect_perm_byte_saved($et_index)" 2
+    return $et_vect_perm_byte_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports vector permutation
@@ -4240,23 +4350,25 @@ proc check_effective_target_vect_perm_byte { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_perm_short { } {
-    global et_vect_perm_short
+    global et_vect_perm_short_saved
+    global et_index
 
-    if [info exists et_vect_perm_short_saved] {
+    if [info exists et_vect_perm_short_saved($et_index)] {
         verbose "check_effective_target_vect_perm_short: using cached result" 2
     } else {
-        set et_vect_perm_short_saved 0
+	set et_vect_perm_short_saved($et_index) 0
         if { ([is-effective-target arm_neon_ok]
 	      && [is-effective-target arm_little_endian])
 	     || ([istarget aarch64*-*-*]
 		 && [is-effective-target aarch64_little_endian])
 	     || [istarget powerpc*-*-*]
              || [istarget spu-*-*] } {
-            set et_vect_perm_short_saved 1
+	    set et_vect_perm_short_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_perm_short: returning $et_vect_perm_short_saved" 2
-    return $et_vect_perm_short_saved
+    verbose "check_effective_target_vect_perm_short:\
+	     returning $et_vect_perm_short_saved($et_index)" 2
+    return $et_vect_perm_short_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4265,20 +4377,23 @@ proc check_effective_target_vect_perm_short { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_widen_sum_hi_to_si_pattern { } {
-    global et_vect_widen_sum_hi_to_si_pattern
+    global et_vect_widen_sum_hi_to_si_pattern_saved
+    global et_index
 
-    if [info exists et_vect_widen_sum_hi_to_si_pattern_saved] {
-        verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern: using cached result" 2
+    if [info exists et_vect_widen_sum_hi_to_si_pattern_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_sum_hi_to_si_pattern_saved 0
+	set et_vect_widen_sum_hi_to_si_pattern_saved($et_index) 0
         if { [istarget powerpc*-*-*]
              || [istarget aarch64*-*-*]
              || [istarget ia64-*-*] } {
-            set et_vect_widen_sum_hi_to_si_pattern_saved 1
+	    set et_vect_widen_sum_hi_to_si_pattern_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern: returning $et_vect_widen_sum_hi_to_si_pattern_saved" 2
-    return $et_vect_widen_sum_hi_to_si_pattern_saved
+    verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern:\
+	     returning $et_vect_widen_sum_hi_to_si_pattern_saved($et_index)" 2
+    return $et_vect_widen_sum_hi_to_si_pattern_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4289,19 +4404,23 @@ proc check_effective_target_vect_widen_sum_hi_to_si_pattern { } {
 # This won't change for different subtargets so cache the result.
                                                                                                 
 proc check_effective_target_vect_widen_sum_hi_to_si { } {
-    global et_vect_widen_sum_hi_to_si
+    global et_vect_widen_sum_hi_to_si_saved
+    global et_index
 
-    if [info exists et_vect_widen_sum_hi_to_si_saved] {
-        verbose "check_effective_target_vect_widen_sum_hi_to_si: using cached result" 2
+    if [info exists et_vect_widen_sum_hi_to_si_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_sum_hi_to_si:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_sum_hi_to_si_saved [check_effective_target_vect_unpack]
+	set et_vect_widen_sum_hi_to_si_saved($et_index) \
+	    [check_effective_target_vect_unpack]
         if { [istarget powerpc*-*-*] 
 	     || [istarget ia64-*-*] } {
-            set et_vect_widen_sum_hi_to_si_saved 1
+	    set et_vect_widen_sum_hi_to_si_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_sum_hi_to_si: returning $et_vect_widen_sum_hi_to_si_saved" 2
-    return $et_vect_widen_sum_hi_to_si_saved
+    verbose "check_effective_target_vect_widen_sum_hi_to_si:\
+	     returning $et_vect_widen_sum_hi_to_si_saved($et_index)" 2
+    return $et_vect_widen_sum_hi_to_si_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4312,20 +4431,23 @@ proc check_effective_target_vect_widen_sum_hi_to_si { } {
 # This won't change for different subtargets so cache the result.
                                                                                                 
 proc check_effective_target_vect_widen_sum_qi_to_hi { } {
-    global et_vect_widen_sum_qi_to_hi
+    global et_vect_widen_sum_qi_to_hi_saved
+    global et_index
 
-    if [info exists et_vect_widen_sum_qi_to_hi_saved] {
-        verbose "check_effective_target_vect_widen_sum_qi_to_hi: using cached result" 2
+    if [info exists et_vect_widen_sum_qi_to_hi_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_sum_qi_to_hi:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_sum_qi_to_hi_saved 0
+	set et_vect_widen_sum_qi_to_hi_saved($et_index) 0
 	if { [check_effective_target_vect_unpack] 
 	     || [check_effective_target_arm_neon_ok]
 	     || [istarget ia64-*-*] } {
-            set et_vect_widen_sum_qi_to_hi_saved 1
+	    set et_vect_widen_sum_qi_to_hi_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_widen_sum_qi_to_hi: returning $et_vect_widen_sum_qi_to_hi_saved" 2
-    return $et_vect_widen_sum_qi_to_hi_saved
+    verbose "check_effective_target_vect_widen_sum_qi_to_hi:\
+	     returning $et_vect_widen_sum_qi_to_hi_saved($et_index)" 2
+    return $et_vect_widen_sum_qi_to_hi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4334,18 +4456,21 @@ proc check_effective_target_vect_widen_sum_qi_to_hi { } {
 # This won't change for different subtargets so cache the result.
                                                                                                 
 proc check_effective_target_vect_widen_sum_qi_to_si { } {
-    global et_vect_widen_sum_qi_to_si
+    global et_vect_widen_sum_qi_to_si_saved
+    global et_index
 
-    if [info exists et_vect_widen_sum_qi_to_si_saved] {
-        verbose "check_effective_target_vect_widen_sum_qi_to_si: using cached result" 2
+    if [info exists et_vect_widen_sum_qi_to_si_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_sum_qi_to_si:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_sum_qi_to_si_saved 0
+	set et_vect_widen_sum_qi_to_si_saved($et_index) 0
         if { [istarget powerpc*-*-*] } {
-            set et_vect_widen_sum_qi_to_si_saved 1
+	    set et_vect_widen_sum_qi_to_si_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_sum_qi_to_si: returning $et_vect_widen_sum_qi_to_si_saved" 2
-    return $et_vect_widen_sum_qi_to_si_saved
+    verbose "check_effective_target_vect_widen_sum_qi_to_si:\
+	     returning $et_vect_widen_sum_qi_to_si_saved($et_index)" 2
+    return $et_vect_widen_sum_qi_to_si_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4358,25 +4483,28 @@ proc check_effective_target_vect_widen_sum_qi_to_si { } {
 
 
 proc check_effective_target_vect_widen_mult_qi_to_hi { } {
-    global et_vect_widen_mult_qi_to_hi
+    global et_vect_widen_mult_qi_to_hi_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_qi_to_hi_saved] {
-        verbose "check_effective_target_vect_widen_mult_qi_to_hi: using cached result" 2
+    if [info exists et_vect_widen_mult_qi_to_hi_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_mult_qi_to_hi:\
+		 using cached result" 2
     } else {
 	if { [check_effective_target_vect_unpack]
 	     && [check_effective_target_vect_short_mult] } {
-	    set et_vect_widen_mult_qi_to_hi_saved 1
+	    set et_vect_widen_mult_qi_to_hi_saved($et_index) 1
 	} else {
-	    set et_vect_widen_mult_qi_to_hi_saved 0
+	    set et_vect_widen_mult_qi_to_hi_saved($et_index) 0
 	}
         if { [istarget powerpc*-*-*]
               || [istarget aarch64*-*-*]
               || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } {
-            set et_vect_widen_mult_qi_to_hi_saved 1
+	    set et_vect_widen_mult_qi_to_hi_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_qi_to_hi: returning $et_vect_widen_mult_qi_to_hi_saved" 2
-    return $et_vect_widen_mult_qi_to_hi_saved
+    verbose "check_effective_target_vect_widen_mult_qi_to_hi:\
+	     returning $et_vect_widen_mult_qi_to_hi_saved($et_index)" 2
+    return $et_vect_widen_mult_qi_to_hi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4389,28 +4517,32 @@ proc check_effective_target_vect_widen_mult_qi_to_hi { } {
 
 
 proc check_effective_target_vect_widen_mult_hi_to_si { } {
-    global et_vect_widen_mult_hi_to_si
+    global et_vect_widen_mult_hi_to_si_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_hi_to_si_saved] {
-        verbose "check_effective_target_vect_widen_mult_hi_to_si: using cached result" 2
+    if [info exists et_vect_widen_mult_hi_to_si_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_mult_hi_to_si:\
+		 using cached result" 2
     } else {
         if { [check_effective_target_vect_unpack]
              && [check_effective_target_vect_int_mult] } {
-          set et_vect_widen_mult_hi_to_si_saved 1
+	  set et_vect_widen_mult_hi_to_si_saved($et_index) 1
         } else {
-          set et_vect_widen_mult_hi_to_si_saved 0
+	  set et_vect_widen_mult_hi_to_si_saved($et_index) 0
         }
         if { [istarget powerpc*-*-*]
 	      || [istarget spu-*-*]
 	      || [istarget ia64-*-*]
 	      || [istarget aarch64*-*-*]
 	      || [istarget i?86-*-*] || [istarget x86_64-*-*]
-              || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } {
-            set et_vect_widen_mult_hi_to_si_saved 1
+	      || ([istarget arm*-*-*]
+		  && [check_effective_target_arm_neon_ok]) } {
+	    set et_vect_widen_mult_hi_to_si_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_hi_to_si: returning $et_vect_widen_mult_hi_to_si_saved" 2
-    return $et_vect_widen_mult_hi_to_si_saved
+    verbose "check_effective_target_vect_widen_mult_hi_to_si:\
+	     returning $et_vect_widen_mult_hi_to_si_saved($et_index)" 2
+    return $et_vect_widen_mult_hi_to_si_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4419,21 +4551,24 @@ proc check_effective_target_vect_widen_mult_hi_to_si { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_widen_mult_qi_to_hi_pattern { } {
-    global et_vect_widen_mult_qi_to_hi_pattern
+    global et_vect_widen_mult_qi_to_hi_pattern_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_qi_to_hi_pattern_saved] {
-        verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern: using cached result" 2
+    if [info exists et_vect_widen_mult_qi_to_hi_pattern_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_mult_qi_to_hi_pattern_saved 0
+	set et_vect_widen_mult_qi_to_hi_pattern_saved($et_index) 0
         if { [istarget powerpc*-*-*]
               || ([istarget arm*-*-*]
 		  && [check_effective_target_arm_neon_ok]
 		  && [check_effective_target_arm_little_endian]) } {
-            set et_vect_widen_mult_qi_to_hi_pattern_saved 1
+	    set et_vect_widen_mult_qi_to_hi_pattern_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern: returning $et_vect_widen_mult_qi_to_hi_pattern_saved" 2
-    return $et_vect_widen_mult_qi_to_hi_pattern_saved
+    verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern:\
+	     returning $et_vect_widen_mult_qi_to_hi_pattern_saved($et_index)" 2
+    return $et_vect_widen_mult_qi_to_hi_pattern_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4442,12 +4577,14 @@ proc check_effective_target_vect_widen_mult_qi_to_hi_pattern { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } {
-    global et_vect_widen_mult_hi_to_si_pattern
+    global et_vect_widen_mult_hi_to_si_pattern_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_hi_to_si_pattern_saved] {
-        verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern: using cached result" 2
+    if [info exists et_vect_widen_mult_hi_to_si_pattern_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_mult_hi_to_si_pattern_saved 0
+	set et_vect_widen_mult_hi_to_si_pattern_saved($et_index) 0
         if { [istarget powerpc*-*-*]
               || [istarget spu-*-*]
               || [istarget ia64-*-*]
@@ -4455,11 +4592,12 @@ proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } {
               || ([istarget arm*-*-*]
 		  && [check_effective_target_arm_neon_ok]
 		  && [check_effective_target_arm_little_endian]) } {
-            set et_vect_widen_mult_hi_to_si_pattern_saved 1
+	    set et_vect_widen_mult_hi_to_si_pattern_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern: returning $et_vect_widen_mult_hi_to_si_pattern_saved" 2
-    return $et_vect_widen_mult_hi_to_si_pattern_saved
+    verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern:\
+	     returning $et_vect_widen_mult_hi_to_si_pattern_saved($et_index)" 2
+    return $et_vect_widen_mult_hi_to_si_pattern_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4468,19 +4606,22 @@ proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_widen_mult_si_to_di_pattern { } {
-    global et_vect_widen_mult_si_to_di_pattern
+    global et_vect_widen_mult_si_to_di_pattern_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_si_to_di_pattern_saved] {
-        verbose "check_effective_target_vect_widen_mult_si_to_di_pattern: using cached result" 2
+    if [info exists et_vect_widen_mult_si_to_di_pattern_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_mult_si_to_di_pattern:\
+		 using cached result" 2
     } else {
-	set et_vect_widen_mult_si_to_di_pattern_saved 0
+	set et_vect_widen_mult_si_to_di_pattern_saved($et_index) 0
         if {[istarget ia64-*-*]
 	    || [istarget i?86-*-*] || [istarget x86_64-*-*] } {
-            set et_vect_widen_mult_si_to_di_pattern_saved 1
+	    set et_vect_widen_mult_si_to_di_pattern_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_si_to_di_pattern: returning $et_vect_widen_mult_si_to_di_pattern_saved" 2
-    return $et_vect_widen_mult_si_to_di_pattern_saved
+    verbose "check_effective_target_vect_widen_mult_si_to_di_pattern:\
+	     returning $et_vect_widen_mult_si_to_di_pattern_saved($et_index)" 2
+    return $et_vect_widen_mult_si_to_di_pattern_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4490,17 +4631,19 @@ proc check_effective_target_vect_widen_mult_si_to_di_pattern { } {
 
 proc check_effective_target_vect_widen_shift { } {
     global et_vect_widen_shift_saved
+    global et_index
 
-    if [info exists et_vect_shift_saved] {
+    if [info exists et_vect_shift_saved($et_index)] {
         verbose "check_effective_target_vect_widen_shift: using cached result" 2
     } else {
-        set et_vect_widen_shift_saved 0
+	set et_vect_widen_shift_saved($et_index) 0
         if { ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } {
-            set et_vect_widen_shift_saved 1
+	    set et_vect_widen_shift_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_shift: returning $et_vect_widen_shift_saved" 2
-    return $et_vect_widen_shift_saved
+    verbose "check_effective_target_vect_widen_shift:\
+	     returning $et_vect_widen_shift_saved($et_index)" 2
+    return $et_vect_widen_shift_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4509,18 +4652,20 @@ proc check_effective_target_vect_widen_shift { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_sdot_qi { } {
-    global et_vect_sdot_qi
+    global et_vect_sdot_qi_saved
+    global et_index
 
-    if [info exists et_vect_sdot_qi_saved] {
+    if [info exists et_vect_sdot_qi_saved($et_index)] {
         verbose "check_effective_target_vect_sdot_qi: using cached result" 2
     } else {
-        set et_vect_sdot_qi_saved 0
+	set et_vect_sdot_qi_saved($et_index) 0
         if { [istarget ia64-*-*] } {
             set et_vect_udot_qi_saved 1
         }
     }
-    verbose "check_effective_target_vect_sdot_qi: returning $et_vect_sdot_qi_saved" 2
-    return $et_vect_sdot_qi_saved
+    verbose "check_effective_target_vect_sdot_qi:\
+	     returning $et_vect_sdot_qi_saved($et_index)" 2
+    return $et_vect_sdot_qi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4529,19 +4674,21 @@ proc check_effective_target_vect_sdot_qi { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_udot_qi { } {
-    global et_vect_udot_qi
+    global et_vect_udot_qi_saved
+    global et_index
 
-    if [info exists et_vect_udot_qi_saved] {
+    if [info exists et_vect_udot_qi_saved($et_index)] {
         verbose "check_effective_target_vect_udot_qi: using cached result" 2
     } else {
-        set et_vect_udot_qi_saved 0
+	set et_vect_udot_qi_saved($et_index) 0
         if { [istarget powerpc*-*-*]
              || [istarget ia64-*-*] } {
-            set et_vect_udot_qi_saved 1
+	    set et_vect_udot_qi_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_udot_qi: returning $et_vect_udot_qi_saved" 2
-    return $et_vect_udot_qi_saved
+    verbose "check_effective_target_vect_udot_qi:\
+	     returning $et_vect_udot_qi_saved($et_index)" 2
+    return $et_vect_udot_qi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4550,20 +4697,22 @@ proc check_effective_target_vect_udot_qi { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_sdot_hi { } {
-    global et_vect_sdot_hi
+    global et_vect_sdot_hi_saved
+    global et_index
 
-    if [info exists et_vect_sdot_hi_saved] {
+    if [info exists et_vect_sdot_hi_saved($et_index)] {
         verbose "check_effective_target_vect_sdot_hi: using cached result" 2
     } else {
-        set et_vect_sdot_hi_saved 0
+	set et_vect_sdot_hi_saved($et_index) 0
         if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
 	     || [istarget ia64-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*] } {
-            set et_vect_sdot_hi_saved 1
+	    set et_vect_sdot_hi_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_sdot_hi: returning $et_vect_sdot_hi_saved" 2
-    return $et_vect_sdot_hi_saved
+    verbose "check_effective_target_vect_sdot_hi:\
+	     returning $et_vect_sdot_hi_saved($et_index)" 2
+    return $et_vect_sdot_hi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4572,18 +4721,20 @@ proc check_effective_target_vect_sdot_hi { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_udot_hi { } {
-    global et_vect_udot_hi
+    global et_vect_udot_hi_saved
+    global et_index
 
-    if [info exists et_vect_udot_hi_saved] {
+    if [info exists et_vect_udot_hi_saved($et_index)] {
         verbose "check_effective_target_vect_udot_hi: using cached result" 2
     } else {
-        set et_vect_udot_hi_saved 0
+	set et_vect_udot_hi_saved($et_index) 0
         if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) } {
-            set et_vect_udot_hi_saved 1
+	    set et_vect_udot_hi_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_udot_hi: returning $et_vect_udot_hi_saved" 2
-    return $et_vect_udot_hi_saved
+    verbose "check_effective_target_vect_udot_hi:\
+	     returning $et_vect_udot_hi_saved($et_index)" 2
+    return $et_vect_udot_hi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4592,18 +4743,20 @@ proc check_effective_target_vect_udot_hi { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_usad_char { } {
-    global et_vect_usad_char
+    global et_vect_usad_char_saved
+    global et_index
 
-    if [info exists et_vect_usad_char_saved] {
+    if [info exists et_vect_usad_char_saved($et_index)] {
         verbose "check_effective_target_vect_usad_char: using cached result" 2
     } else {
-        set et_vect_usad_char_saved 0
+	set et_vect_usad_char_saved($et_index) 0
         if { ([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
-            set et_vect_usad_char_saved 1
+	    set et_vect_usad_char_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_usad_char: returning $et_vect_usad_char_saved" 2
-    return $et_vect_usad_char_saved
+    verbose "check_effective_target_vect_usad_char:\
+	     returning $et_vect_usad_char_saved($et_index)" 2
+    return $et_vect_usad_char_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4613,23 +4766,25 @@ proc check_effective_target_vect_usad_char { } {
 # This won't change for different subtargets so cache the result.
                                                                                 
 proc check_effective_target_vect_pack_trunc { } {
-    global et_vect_pack_trunc
+    global et_vect_pack_trunc_saved
+    global et_index
                                                                                 
-    if [info exists et_vect_pack_trunc_saved] {
+    if [info exists et_vect_pack_trunc_saved($et_index)] {
         verbose "check_effective_target_vect_pack_trunc: using cached result" 2
     } else {
-        set et_vect_pack_trunc_saved 0
+	set et_vect_pack_trunc_saved($et_index) 0
         if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
              || [istarget i?86-*-*] || [istarget x86_64-*-*]
              || [istarget aarch64*-*-*]
              || [istarget spu-*-*]
              || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]
 		 && [check_effective_target_arm_little_endian]) } {
-            set et_vect_pack_trunc_saved 1
+	    set et_vect_pack_trunc_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_pack_trunc: returning $et_vect_pack_trunc_saved" 2
-    return $et_vect_pack_trunc_saved
+    verbose "check_effective_target_vect_pack_trunc:\
+	     returning $et_vect_pack_trunc_saved($et_index)" 2
+    return $et_vect_pack_trunc_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4638,12 +4793,13 @@ proc check_effective_target_vect_pack_trunc { } {
 # This won't change for different subtargets so cache the result.
                                    
 proc check_effective_target_vect_unpack { } {
-    global et_vect_unpack
+    global et_vect_unpack_saved
+    global et_index
                                         
-    if [info exists et_vect_unpack_saved] {
+    if [info exists et_vect_unpack_saved($et_index)] {
         verbose "check_effective_target_vect_unpack: using cached result" 2
     } else {
-        set et_vect_unpack_saved 0
+	set et_vect_unpack_saved($et_index) 0
         if { ([istarget powerpc*-*-*] && ![istarget powerpc-*paired*])
              || [istarget i?86-*-*] || [istarget x86_64-*-*] 
              || [istarget spu-*-*]
@@ -4651,11 +4807,12 @@ proc check_effective_target_vect_unpack { } {
              || [istarget aarch64*-*-*]
              || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]
 		 && [check_effective_target_arm_little_endian]) } {
-            set et_vect_unpack_saved 1
+	    set et_vect_unpack_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_unpack: returning $et_vect_unpack_saved" 2  
-    return $et_vect_unpack_saved
+    verbose "check_effective_target_vect_unpack:\
+	     returning $et_vect_unpack_saved($et_index)" 2
+    return $et_vect_unpack_saved($et_index)
 }
 
 # Return 1 if the target plus current options does not guarantee
@@ -4682,11 +4839,12 @@ proc check_effective_target_unaligned_stack { } {
 
 proc check_effective_target_vect_no_align { } {
     global et_vect_no_align_saved
+    global et_index
 
-    if [info exists et_vect_no_align_saved] {
+    if [info exists et_vect_no_align_saved($et_index)] {
 	verbose "check_effective_target_vect_no_align: using cached result" 2
     } else {
-	set et_vect_no_align_saved 0
+	set et_vect_no_align_saved($et_index) 0
 	if { [istarget mipsisa64*-*-*]
 	     || [istarget mips-sde-elf]
 	     || [istarget sparc*-*-*]
@@ -4694,12 +4852,13 @@ proc check_effective_target_vect_no_align { } {
 	     || [check_effective_target_arm_vect_no_misalign]
 	     || ([istarget powerpc*-*-*] && [check_p8vector_hw_available])
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mips_loongson]) } {
-	    set et_vect_no_align_saved 1
+		 && [et-is-effective-target mips_loongson]) } {
+	    set et_vect_no_align_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_no_align: returning $et_vect_no_align_saved" 2
-    return $et_vect_no_align_saved
+    verbose "check_effective_target_vect_no_align:\
+	     returning $et_vect_no_align_saved($et_index)" 2
+    return $et_vect_no_align_saved($et_index)
 }
 
 # Return 1 if the target supports a vector misalign access, 0 otherwise.
@@ -4708,19 +4867,21 @@ proc check_effective_target_vect_no_align { } {
 
 proc check_effective_target_vect_hw_misalign { } {
     global et_vect_hw_misalign_saved
+    global et_index
 
-    if [info exists et_vect_hw_misalign_saved] {
+    if [info exists et_vect_hw_misalign_saved($et_index)] {
         verbose "check_effective_target_vect_hw_misalign: using cached result" 2
     } else {
-        set et_vect_hw_misalign_saved 0
-       if { [istarget i?86-*-*] || [istarget x86_64-*-*]
-            || ([istarget powerpc*-*-*] && [check_p8vector_hw_available])
-	    || [istarget aarch64*-*-*] } {
-          set et_vect_hw_misalign_saved 1
-       }
+	set et_vect_hw_misalign_saved($et_index) 0
+	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
+	     || ([istarget powerpc*-*-*] && [check_p8vector_hw_available])
+	     || [istarget aarch64*-*-*] } {
+	  set et_vect_hw_misalign_saved($et_index) 1
+	}
     }
-    verbose "check_effective_target_vect_hw_misalign: returning $et_vect_hw_misalign_saved" 2
-    return $et_vect_hw_misalign_saved
+    verbose "check_effective_target_vect_hw_misalign:\
+	     returning $et_vect_hw_misalign_saved($et_index)" 2
+    return $et_vect_hw_misalign_saved($et_index)
 }
 
 
@@ -4730,25 +4891,28 @@ proc check_effective_target_vect_hw_misalign { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_aligned_arrays { } {
-    global et_vect_aligned_arrays
+    global et_vect_aligned_arrays_saved
+    global et_index
 
-    if [info exists et_vect_aligned_arrays_saved] {
-	verbose "check_effective_target_vect_aligned_arrays: using cached result" 2
+    if [info exists et_vect_aligned_arrays_saved($et_index)] {
+	verbose "check_effective_target_vect_aligned_arrays:\
+		 using cached result" 2
     } else {
-	set et_vect_aligned_arrays_saved 0
+	set et_vect_aligned_arrays_saved($et_index) 0
         if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
 	    if { ([is-effective-target lp64]
 	          && ( ![check_avx_available]
 		     || [check_prefer_avx128])) } {
-	         set et_vect_aligned_arrays_saved 1
+		 set et_vect_aligned_arrays_saved($et_index) 1
 	    }
 	}
         if [istarget spu-*-*] {
-	    set et_vect_aligned_arrays_saved 1
+	    set et_vect_aligned_arrays_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_aligned_arrays: returning $et_vect_aligned_arrays_saved" 2
-    return $et_vect_aligned_arrays_saved
+    verbose "check_effective_target_vect_aligned_arrays:\
+	     returning $et_vect_aligned_arrays_saved($et_index)" 2
+    return $et_vect_aligned_arrays_saved($et_index)
 }
 
 # Return 1 if types of size 32 bit or less are naturally aligned
@@ -4799,20 +4963,22 @@ proc check_effective_target_natural_alignment_64 { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_natural_alignment { } {
-    global et_vect_natural_alignment
+    global et_vect_natural_alignment_saved
+    global et_index
 
-    if [info exists et_vect_natural_alignment_saved] {
+    if [info exists et_vect_natural_alignment_saved($et_index)] {
         verbose "check_effective_target_vect_natural_alignment: using cached result" 2
     } else {
-        set et_vect_natural_alignment_saved 1
+	set et_vect_natural_alignment_saved($et_index) 1
         if { [check_effective_target_arm_eabi]
 	     || [istarget nvptx-*-*]
 	     || [istarget s390*-*-*] } {
-            set et_vect_natural_alignment_saved 0
+	    set et_vect_natural_alignment_saved($et_index) 0
         }
     }
-    verbose "check_effective_target_vect_natural_alignment: returning $et_vect_natural_alignment_saved" 2
-    return $et_vect_natural_alignment_saved
+    verbose "check_effective_target_vect_natural_alignment:\
+	     returning $et_vect_natural_alignment_saved($et_index)" 2
+    return $et_vect_natural_alignment_saved($et_index)
 }
 
 # Return 1 if vector alignment (for types of size 32 bit or less) is reachable, 0 otherwise.
@@ -4820,20 +4986,23 @@ proc check_effective_target_vect_natural_alignment { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vector_alignment_reachable { } {
-    global et_vector_alignment_reachable
+    global et_vector_alignment_reachable_saved
+    global et_index
 
-    if [info exists et_vector_alignment_reachable_saved] {
-        verbose "check_effective_target_vector_alignment_reachable: using cached result" 2
+    if [info exists et_vector_alignment_reachable_saved($et_index)] {
+	verbose "check_effective_target_vector_alignment_reachable:\
+		 using cached result" 2
     } else {
         if { [check_effective_target_vect_aligned_arrays]
              || [check_effective_target_natural_alignment_32] } {
-            set et_vector_alignment_reachable_saved 1
+	    set et_vector_alignment_reachable_saved($et_index) 1
         } else {
-            set et_vector_alignment_reachable_saved 0
+	    set et_vector_alignment_reachable_saved($et_index) 0
         }
     }
-    verbose "check_effective_target_vector_alignment_reachable: returning $et_vector_alignment_reachable_saved" 2
-    return $et_vector_alignment_reachable_saved
+    verbose "check_effective_target_vector_alignment_reachable:\
+	     returning $et_vector_alignment_reachable_saved($et_index)" 2
+    return $et_vector_alignment_reachable_saved($et_index)
 }
 
 # Return 1 if vector alignment for 64 bit is reachable, 0 otherwise.
@@ -4841,63 +5010,72 @@ proc check_effective_target_vector_alignment_reachable { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vector_alignment_reachable_for_64bit { } {
-    global et_vector_alignment_reachable_for_64bit
+    global et_vector_alignment_reachable_for_64bit_saved
+    global et_index
 
-    if [info exists et_vector_alignment_reachable_for_64bit_saved] {
-        verbose "check_effective_target_vector_alignment_reachable_for_64bit: using cached result" 2
+    if [info exists et_vector_alignment_reachable_for_64bit_saved($et_index)] {
+	verbose "check_effective_target_vector_alignment_reachable_for_64bit:\
+		 using cached result" 2
     } else {
         if { [check_effective_target_vect_aligned_arrays] 
              || [check_effective_target_natural_alignment_64] } {
-            set et_vector_alignment_reachable_for_64bit_saved 1
+	    set et_vector_alignment_reachable_for_64bit_saved($et_index) 1
         } else {
-            set et_vector_alignment_reachable_for_64bit_saved 0
+	    set et_vector_alignment_reachable_for_64bit_saved($et_index) 0
         }
     }
-    verbose "check_effective_target_vector_alignment_reachable_for_64bit: returning $et_vector_alignment_reachable_for_64bit_saved" 2
-    return $et_vector_alignment_reachable_for_64bit_saved
+    verbose "check_effective_target_vector_alignment_reachable_for_64bit:\
+	 returning $et_vector_alignment_reachable_for_64bit_saved($et_index)" 2
+    return $et_vector_alignment_reachable_for_64bit_saved($et_index)
 }
 
 # Return 1 if the target only requires element alignment for vector accesses
 
 proc check_effective_target_vect_element_align { } {
     global et_vect_element_align
+    global et_index
 
-    if [info exists et_vect_element_align] {
-	verbose "check_effective_target_vect_element_align: using cached result" 2
+    if [info exists et_vect_element_align($et_index)] {
+	verbose "check_effective_target_vect_element_align:\
+		 using cached result" 2
     } else {
-	set et_vect_element_align 0
+	set et_vect_element_align($et_index) 0
 	if { ([istarget arm*-*-*]
 	      && ![check_effective_target_arm_vect_no_misalign])
 	     || [check_effective_target_vect_hw_misalign] } {
-	   set et_vect_element_align 1
+	   set et_vect_element_align($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_element_align: returning $et_vect_element_align" 2
-    return $et_vect_element_align
+    verbose "check_effective_target_vect_element_align:\
+	     returning $et_vect_element_align($et_index)" 2
+    return $et_vect_element_align($et_index)
 }
 
 # Return 1 if the target supports vector conditional operations, 0 otherwise.
 
 proc check_effective_target_vect_condition { } {
     global et_vect_cond_saved
+    global et_index
 
-    if [info exists et_vect_cond_saved] {
+    if [info exists et_vect_cond_saved($et_index)] {
 	verbose "check_effective_target_vect_cond: using cached result" 2
     } else {
-	set et_vect_cond_saved 0
+	set et_vect_cond_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget powerpc*-*-*]
 	     || [istarget ia64-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget spu-*-*]
-	     || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } {
-	   set et_vect_cond_saved 1
+	     || ([istarget arm*-*-*]
+		 && [check_effective_target_arm_neon_ok]) } {
+	   set et_vect_cond_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_cond: returning $et_vect_cond_saved" 2
-    return $et_vect_cond_saved
+    verbose "check_effective_target_vect_cond:\
+	     returning $et_vect_cond_saved($et_index)" 2
+    return $et_vect_cond_saved($et_index)
 }
 
 # Return 1 if the target supports vector conditional operations where
@@ -4905,52 +5083,57 @@ proc check_effective_target_vect_condition { } {
 
 proc check_effective_target_vect_cond_mixed { } {
     global et_vect_cond_mixed_saved
+    global et_index
 
-    if [info exists et_vect_cond_mixed_saved] {
+    if [info exists et_vect_cond_mixed_saved($et_index)] {
 	verbose "check_effective_target_vect_cond_mixed: using cached result" 2
     } else {
-	set et_vect_cond_mixed_saved 0
+	set et_vect_cond_mixed_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget powerpc*-*-*] } {
-	   set et_vect_cond_mixed_saved 1
+	   set et_vect_cond_mixed_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_cond_mixed: returning $et_vect_cond_mixed_saved" 2
-    return $et_vect_cond_mixed_saved
+    verbose "check_effective_target_vect_cond_mixed:\
+	     returning $et_vect_cond_mixed_saved($et_index)" 2
+    return $et_vect_cond_mixed_saved($et_index)
 }
 
 # Return 1 if the target supports vector char multiplication, 0 otherwise.
 
 proc check_effective_target_vect_char_mult { } {
     global et_vect_char_mult_saved
+    global et_index
 
-    if [info exists et_vect_char_mult_saved] {
+    if [info exists et_vect_char_mult_saved($et_index)] {
 	verbose "check_effective_target_vect_char_mult: using cached result" 2
     } else {
-	set et_vect_char_mult_saved 0
+	set et_vect_char_mult_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget ia64-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
              || [check_effective_target_arm32]
 	     || [check_effective_target_powerpc_altivec] } {
-	   set et_vect_char_mult_saved 1
+	   set et_vect_char_mult_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_char_mult: returning $et_vect_char_mult_saved" 2
-    return $et_vect_char_mult_saved
+    verbose "check_effective_target_vect_char_mult:\
+	     returning $et_vect_char_mult_saved($et_index)" 2
+    return $et_vect_char_mult_saved($et_index)
 }
 
 # Return 1 if the target supports vector short multiplication, 0 otherwise.
 
 proc check_effective_target_vect_short_mult { } {
     global et_vect_short_mult_saved
+    global et_index
 
-    if [info exists et_vect_short_mult_saved] {
+    if [info exists et_vect_short_mult_saved($et_index)] {
 	verbose "check_effective_target_vect_short_mult: using cached result" 2
     } else {
-	set et_vect_short_mult_saved 0
+	set et_vect_short_mult_saved($et_index) 0
 	if { [istarget ia64-*-*]
 	     || [istarget spu-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
@@ -4958,47 +5141,52 @@ proc check_effective_target_vect_short_mult { } {
 	     || [istarget aarch64*-*-*]
 	     || [check_effective_target_arm32]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mips_loongson]) } {
-	   set et_vect_short_mult_saved 1
+		 && [et-is-effective-target mips_loongson]) } {
+	   set et_vect_short_mult_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_short_mult: returning $et_vect_short_mult_saved" 2
-    return $et_vect_short_mult_saved
+    verbose "check_effective_target_vect_short_mult:\
+	     returning $et_vect_short_mult_saved($et_index)" 2
+    return $et_vect_short_mult_saved($et_index)
 }
 
 # Return 1 if the target supports vector int multiplication, 0 otherwise.
 
 proc check_effective_target_vect_int_mult { } {
     global et_vect_int_mult_saved
+    global et_index
 
-    if [info exists et_vect_int_mult_saved] {
+    if [info exists et_vect_int_mult_saved($et_index)] {
 	verbose "check_effective_target_vect_int_mult: using cached result" 2
     } else {
-	set et_vect_int_mult_saved 0
+	set et_vect_int_mult_saved($et_index) 0
 	if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
 	     || [istarget spu-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget ia64-*-*]
 	     || [istarget aarch64*-*-*]
 	     || [check_effective_target_arm32] } {
-	   set et_vect_int_mult_saved 1
+	   set et_vect_int_mult_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_int_mult: returning $et_vect_int_mult_saved" 2
-    return $et_vect_int_mult_saved
+    verbose "check_effective_target_vect_int_mult:\
+	     returning $et_vect_int_mult_saved($et_index)" 2
+    return $et_vect_int_mult_saved($et_index)
 }
 
 # Return 1 if the target supports vector even/odd elements extraction, 0 otherwise.
 
 proc check_effective_target_vect_extract_even_odd { } {
     global et_vect_extract_even_odd_saved
+    global et_index
     
-    if [info exists et_vect_extract_even_odd_saved] {
-        verbose "check_effective_target_vect_extract_even_odd: using cached result" 2
+    if [info exists et_vect_extract_even_odd_saved($et_index)] {
+	verbose "check_effective_target_vect_extract_even_odd:\
+		 using cached result" 2
     } else {
-        set et_vect_extract_even_odd_saved 0 
+	set et_vect_extract_even_odd_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget powerpc*-*-*]
 	     || [is-effective-target arm_neon_ok]
@@ -5006,24 +5194,26 @@ proc check_effective_target_vect_extract_even_odd { } {
              || [istarget ia64-*-*]
              || [istarget spu-*-*]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mpaired_single]) } {
-	    set et_vect_extract_even_odd_saved 1
+		 && [et-is-effective-target mpaired_single]) } {
+	    set et_vect_extract_even_odd_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_extract_even_odd: returning $et_vect_extract_even_odd_saved" 2
-    return $et_vect_extract_even_odd_saved
+    verbose "check_effective_target_vect_extract_even_odd:\
+	     returning $et_vect_extract_even_odd_saved($et_index)" 2
+    return $et_vect_extract_even_odd_saved($et_index)
 }
 
 # Return 1 if the target supports vector interleaving, 0 otherwise.
 
 proc check_effective_target_vect_interleave { } {
     global et_vect_interleave_saved
+    global et_index
     
-    if [info exists et_vect_interleave_saved] {
+    if [info exists et_vect_interleave_saved($et_index)] {
         verbose "check_effective_target_vect_interleave: using cached result" 2
     } else {
-        set et_vect_interleave_saved 0
+	set et_vect_interleave_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget powerpc*-*-*]
 	     || [is-effective-target arm_neon_ok]
@@ -5031,13 +5221,14 @@ proc check_effective_target_vect_interleave { } {
              || [istarget ia64-*-*]
              || [istarget spu-*-*]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mpaired_single]) } {
-           set et_vect_interleave_saved 1
+		 && [et-is-effective-target mpaired_single]) } {
+	   set et_vect_interleave_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_interleave: returning $et_vect_interleave_saved" 2
-    return $et_vect_interleave_saved
+    verbose "check_effective_target_vect_interleave:\
+	     returning $et_vect_interleave_saved($et_index)" 2
+    return $et_vect_interleave_saved($et_index)
 }
 
 foreach N {2 3 4 8} {
@@ -5045,24 +5236,27 @@ foreach N {2 3 4 8} {
 	# Return 1 if the target supports 2-vector interleaving
 	proc check_effective_target_vect_stridedN { } {
 	    global et_vect_stridedN_saved
+	    global et_index
 
-	    if [info exists et_vect_stridedN_saved] {
-		verbose "check_effective_target_vect_stridedN: using cached result" 2
+	    if [info exists et_vect_stridedN_saved($et_index)] {
+		verbose "check_effective_target_vect_stridedN:\
+			 using cached result" 2
 	    } else {
-		set et_vect_stridedN_saved 0
+		set et_vect_stridedN_saved($et_index) 0
 		if { (N & -N) == N
 		     && [check_effective_target_vect_interleave]
 		     && [check_effective_target_vect_extract_even_odd] } {
-		    set et_vect_stridedN_saved 1
+		    set et_vect_stridedN_saved($et_index) 1
 		}
 		if { ([istarget arm*-*-*]
 		      || [istarget aarch64*-*-*]) && N >= 2 && N <= 4 } {
-		    set et_vect_stridedN_saved 1
+		    set et_vect_stridedN_saved($et_index) 1
 		}
 	    }
 
-	    verbose "check_effective_target_vect_stridedN: returning $et_vect_stridedN_saved" 2
-	    return $et_vect_stridedN_saved
+	    verbose "check_effective_target_vect_stridedN:\
+		     returning $et_vect_stridedN_saved($et_index)" 2
+	    return $et_vect_stridedN_saved($et_index)
 	}
     }]
 }
@@ -5071,61 +5265,68 @@ foreach N {2 3 4 8} {
 
 proc check_effective_target_vect_multiple_sizes { } {
     global et_vect_multiple_sizes_saved
+    global et_index
 
-    set et_vect_multiple_sizes_saved 0
+    set et_vect_multiple_sizes_saved($et_index) 0
     if { ([istarget aarch64*-*-*]
 	  || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok])) } {
-       set et_vect_multiple_sizes_saved 1
+       set et_vect_multiple_sizes_saved($et_index) 1
     }
     if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
       if { ([check_avx_available] && ![check_prefer_avx128]) } {
-	set et_vect_multiple_sizes_saved 1
+	set et_vect_multiple_sizes_saved($et_index) 1
       }
     }
 
-    verbose "check_effective_target_vect_multiple_sizes: returning $et_vect_multiple_sizes_saved" 2
-    return $et_vect_multiple_sizes_saved
+    verbose "check_effective_target_vect_multiple_sizes:\
+	     returning $et_vect_multiple_sizes_saved($et_index)" 2
+    return $et_vect_multiple_sizes_saved($et_index)
 }
 
 # Return 1 if the target supports vectors of 64 bits.
 
 proc check_effective_target_vect64 { } {
     global et_vect64_saved
+    global et_index
 
-    if [info exists et_vect64_saved] {
+    if [info exists et_vect64_saved($et_index)] {
         verbose "check_effective_target_vect64: using cached result" 2
     } else {
-        set et_vect64_saved 0
+	set et_vect64_saved($et_index) 0
         if { ([istarget arm*-*-*]
 	      && [check_effective_target_arm_neon_ok]
 	      && [check_effective_target_arm_little_endian])
 	     || [istarget aarch64*-*-*]
              || [istarget sparc*-*-*] } {
-           set et_vect64_saved 1
+	   set et_vect64_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect64: returning $et_vect64_saved" 2
-    return $et_vect64_saved
+    verbose "check_effective_target_vect64:\
+	     returning $et_vect64_saved($et_index)" 2
+    return $et_vect64_saved($et_index)
 }
 
 # Return 1 if the target supports vector copysignf calls.
 
 proc check_effective_target_vect_call_copysignf { } {
     global et_vect_call_copysignf_saved
+    global et_index
 
-    if [info exists et_vect_call_copysignf_saved] {
-	verbose "check_effective_target_vect_call_copysignf: using cached result" 2
+    if [info exists et_vect_call_copysignf_saved($et_index)] {
+	verbose "check_effective_target_vect_call_copysignf:\
+		 using cached result" 2
     } else {
-	set et_vect_call_copysignf_saved 0
+	set et_vect_call_copysignf_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget powerpc*-*-*] } {
-	   set et_vect_call_copysignf_saved 1
+	   set et_vect_call_copysignf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_copysignf: returning $et_vect_call_copysignf_saved" 2
-    return $et_vect_call_copysignf_saved
+    verbose "check_effective_target_vect_call_copysignf:\
+	     returning $et_vect_call_copysignf_saved($et_index)" 2
+    return $et_vect_call_copysignf_saved($et_index)
 }
 
 # Return 1 if the target supports hardware square root instructions.
@@ -5153,249 +5354,280 @@ proc check_effective_target_sqrt_insn { } {
 
 proc check_effective_target_vect_call_sqrtf { } {
     global et_vect_call_sqrtf_saved
+    global et_index
 
-    if [info exists et_vect_call_sqrtf_saved] {
+    if [info exists et_vect_call_sqrtf_saved($et_index)] {
 	verbose "check_effective_target_vect_call_sqrtf: using cached result" 2
     } else {
-	set et_vect_call_sqrtf_saved 0
+	set et_vect_call_sqrtf_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || ([istarget powerpc*-*-*] && [check_vsx_hw_available]) } {
-	    set et_vect_call_sqrtf_saved 1
+	    set et_vect_call_sqrtf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_sqrtf: returning $et_vect_call_sqrtf_saved" 2
-    return $et_vect_call_sqrtf_saved
+    verbose "check_effective_target_vect_call_sqrtf:\
+	     returning $et_vect_call_sqrtf_saved($et_index)" 2
+    return $et_vect_call_sqrtf_saved($et_index)
 }
 
 # Return 1 if the target supports vector lrint calls.
 
 proc check_effective_target_vect_call_lrint { } {
-    set et_vect_call_lrint 0
+    global et_index
+    set et_vect_call_lrint($et_index) 0
     if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
 	 && [check_effective_target_ilp32] } {
-	set et_vect_call_lrint 1
+	set et_vect_call_lrint($et_index) 1
     }
 
-    verbose "check_effective_target_vect_call_lrint: returning $et_vect_call_lrint" 2
-    return $et_vect_call_lrint
+    verbose "check_effective_target_vect_call_lrint:\
+	     returning $et_vect_call_lrint($et_index)" 2
+    return $et_vect_call_lrint($et_index)
 }
 
 # Return 1 if the target supports vector btrunc calls.
 
 proc check_effective_target_vect_call_btrunc { } {
     global et_vect_call_btrunc_saved
+    global et_index
 
-    if [info exists et_vect_call_btrunc_saved] {
-	verbose "check_effective_target_vect_call_btrunc: using cached result" 2
+    if [info exists et_vect_call_btrunc_saved($et_index)] {
+	verbose "check_effective_target_vect_call_btrunc:\
+		 using cached result" 2
     } else {
-	set et_vect_call_btrunc_saved 0
+	set et_vect_call_btrunc_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_btrunc_saved 1
+	  set et_vect_call_btrunc_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_btrunc: returning $et_vect_call_btrunc_saved" 2
-    return $et_vect_call_btrunc_saved
+    verbose "check_effective_target_vect_call_btrunc:\
+	     returning $et_vect_call_btrunc_saved($et_index)" 2
+    return $et_vect_call_btrunc_saved($et_index)
 }
 
 # Return 1 if the target supports vector btruncf calls.
 
 proc check_effective_target_vect_call_btruncf { } {
     global et_vect_call_btruncf_saved
+    global et_index
 
-    if [info exists et_vect_call_btruncf_saved] {
-	verbose "check_effective_target_vect_call_btruncf: using cached result" 2
+    if [info exists et_vect_call_btruncf_saved($et_index)] {
+	verbose "check_effective_target_vect_call_btruncf:\
+		 using cached result" 2
     } else {
-	set et_vect_call_btruncf_saved 0
+	set et_vect_call_btruncf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_btruncf_saved 1
+	  set et_vect_call_btruncf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_btruncf: returning $et_vect_call_btruncf_saved" 2
-    return $et_vect_call_btruncf_saved
+    verbose "check_effective_target_vect_call_btruncf:\
+	     returning $et_vect_call_btruncf_saved($et_index)" 2
+    return $et_vect_call_btruncf_saved($et_index)
 }
 
 # Return 1 if the target supports vector ceil calls.
 
 proc check_effective_target_vect_call_ceil { } {
     global et_vect_call_ceil_saved
+    global et_index
 
-    if [info exists et_vect_call_ceil_saved] {
+    if [info exists et_vect_call_ceil_saved($et_index)] {
 	verbose "check_effective_target_vect_call_ceil: using cached result" 2
     } else {
-	set et_vect_call_ceil_saved 0
+	set et_vect_call_ceil_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_ceil_saved 1
+	  set et_vect_call_ceil_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_ceil: returning $et_vect_call_ceil_saved" 2
-    return $et_vect_call_ceil_saved
+    verbose "check_effective_target_vect_call_ceil:\
+	     returning $et_vect_call_ceil_saved($et_index)" 2
+    return $et_vect_call_ceil_saved($et_index)
 }
 
 # Return 1 if the target supports vector ceilf calls.
 
 proc check_effective_target_vect_call_ceilf { } {
     global et_vect_call_ceilf_saved
+    global et_index
 
-    if [info exists et_vect_call_ceilf_saved] {
+    if [info exists et_vect_call_ceilf_saved($et_index)] {
 	verbose "check_effective_target_vect_call_ceilf: using cached result" 2
     } else {
-	set et_vect_call_ceilf_saved 0
+	set et_vect_call_ceilf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_ceilf_saved 1
+	  set et_vect_call_ceilf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_ceilf: returning $et_vect_call_ceilf_saved" 2
-    return $et_vect_call_ceilf_saved
+    verbose "check_effective_target_vect_call_ceilf:\
+	     returning $et_vect_call_ceilf_saved($et_index)" 2
+    return $et_vect_call_ceilf_saved($et_index)
 }
 
 # Return 1 if the target supports vector floor calls.
 
 proc check_effective_target_vect_call_floor { } {
     global et_vect_call_floor_saved
+    global et_index
 
-    if [info exists et_vect_call_floor_saved] {
+    if [info exists et_vect_call_floor_saved($et_index)] {
 	verbose "check_effective_target_vect_call_floor: using cached result" 2
     } else {
-	set et_vect_call_floor_saved 0
+	set et_vect_call_floor_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_floor_saved 1
+	  set et_vect_call_floor_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_floor: returning $et_vect_call_floor_saved" 2
-    return $et_vect_call_floor_saved
+    verbose "check_effective_target_vect_call_floor:\
+	     returning $et_vect_call_floor_saved($et_index)" 2
+    return $et_vect_call_floor_saved($et_index)
 }
 
 # Return 1 if the target supports vector floorf calls.
 
 proc check_effective_target_vect_call_floorf { } {
     global et_vect_call_floorf_saved
+    global et_index
 
-    if [info exists et_vect_call_floorf_saved] {
+    if [info exists et_vect_call_floorf_saved($et_index)] {
 	verbose "check_effective_target_vect_call_floorf: using cached result" 2
     } else {
-	set et_vect_call_floorf_saved 0
+	set et_vect_call_floorf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_floorf_saved 1
+	  set et_vect_call_floorf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_floorf: returning $et_vect_call_floorf_saved" 2
-    return $et_vect_call_floorf_saved
+    verbose "check_effective_target_vect_call_floorf:\
+	     returning $et_vect_call_floorf_saved($et_index)" 2
+    return $et_vect_call_floorf_saved($et_index)
 }
 
 # Return 1 if the target supports vector lceil calls.
 
 proc check_effective_target_vect_call_lceil { } {
     global et_vect_call_lceil_saved
+    global et_index
 
-    if [info exists et_vect_call_lceil_saved] {
+    if [info exists et_vect_call_lceil_saved($et_index)] {
 	verbose "check_effective_target_vect_call_lceil: using cached result" 2
     } else {
-	set et_vect_call_lceil_saved 0
+	set et_vect_call_lceil_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_lceil_saved 1
+	  set et_vect_call_lceil_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_lceil: returning $et_vect_call_lceil_saved" 2
-    return $et_vect_call_lceil_saved
+    verbose "check_effective_target_vect_call_lceil:\
+	     returning $et_vect_call_lceil_saved($et_index)" 2
+    return $et_vect_call_lceil_saved($et_index)
 }
 
 # Return 1 if the target supports vector lfloor calls.
 
 proc check_effective_target_vect_call_lfloor { } {
     global et_vect_call_lfloor_saved
+    global et_index
 
-    if [info exists et_vect_call_lfloor_saved] {
+    if [info exists et_vect_call_lfloor_saved($et_index)] {
 	verbose "check_effective_target_vect_call_lfloor: using cached result" 2
     } else {
-	set et_vect_call_lfloor_saved 0
+	set et_vect_call_lfloor_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_lfloor_saved 1
+	  set et_vect_call_lfloor_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_lfloor: returning $et_vect_call_lfloor_saved" 2
-    return $et_vect_call_lfloor_saved
+    verbose "check_effective_target_vect_call_lfloor:\
+	     returning $et_vect_call_lfloor_saved($et_index)" 2
+    return $et_vect_call_lfloor_saved($et_index)
 }
 
 # Return 1 if the target supports vector nearbyint calls.
 
 proc check_effective_target_vect_call_nearbyint { } {
     global et_vect_call_nearbyint_saved
+    global et_index
 
-    if [info exists et_vect_call_nearbyint_saved] {
+    if [info exists et_vect_call_nearbyint_saved($et_index)] {
 	verbose "check_effective_target_vect_call_nearbyint: using cached result" 2
     } else {
-	set et_vect_call_nearbyint_saved 0
+	set et_vect_call_nearbyint_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_nearbyint_saved 1
+	  set et_vect_call_nearbyint_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_nearbyint: returning $et_vect_call_nearbyint_saved" 2
-    return $et_vect_call_nearbyint_saved
+    verbose "check_effective_target_vect_call_nearbyint:\
+	     returning $et_vect_call_nearbyint_saved($et_index)" 2
+    return $et_vect_call_nearbyint_saved($et_index)
 }
 
 # Return 1 if the target supports vector nearbyintf calls.
 
 proc check_effective_target_vect_call_nearbyintf { } {
     global et_vect_call_nearbyintf_saved
+    global et_index
 
-    if [info exists et_vect_call_nearbyintf_saved] {
-	verbose "check_effective_target_vect_call_nearbyintf: using cached result" 2
+    if [info exists et_vect_call_nearbyintf_saved($et_index)] {
+	verbose "check_effective_target_vect_call_nearbyintf:\
+		 using cached result" 2
     } else {
-	set et_vect_call_nearbyintf_saved 0
+	set et_vect_call_nearbyintf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_nearbyintf_saved 1
+	  set et_vect_call_nearbyintf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_nearbyintf: returning $et_vect_call_nearbyintf_saved" 2
-    return $et_vect_call_nearbyintf_saved
+    verbose "check_effective_target_vect_call_nearbyintf:\
+	     returning $et_vect_call_nearbyintf_saved($et_index)" 2
+    return $et_vect_call_nearbyintf_saved($et_index)
 }
 
 # Return 1 if the target supports vector round calls.
 
 proc check_effective_target_vect_call_round { } {
     global et_vect_call_round_saved
+    global et_index
 
-    if [info exists et_vect_call_round_saved] {
+    if [info exists et_vect_call_round_saved($et_index)] {
 	verbose "check_effective_target_vect_call_round: using cached result" 2
     } else {
-	set et_vect_call_round_saved 0
+	set et_vect_call_round_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_round_saved 1
+	  set et_vect_call_round_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_round: returning $et_vect_call_round_saved" 2
-    return $et_vect_call_round_saved
+    verbose "check_effective_target_vect_call_round:\
+	     returning $et_vect_call_round_saved($et_index)" 2
+    return $et_vect_call_round_saved($et_index)
 }
 
 # Return 1 if the target supports vector roundf calls.
 
 proc check_effective_target_vect_call_roundf { } {
     global et_vect_call_roundf_saved
+    global et_index
 
-    if [info exists et_vect_call_roundf_saved] {
+    if [info exists et_vect_call_roundf_saved($et_index)] {
 	verbose "check_effective_target_vect_call_roundf: using cached result" 2
     } else {
-	set et_vect_call_roundf_saved 0
+	set et_vect_call_roundf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_roundf_saved 1
+	  set et_vect_call_roundf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_roundf: returning $et_vect_call_roundf_saved" 2
-    return $et_vect_call_roundf_saved
+    verbose "check_effective_target_vect_call_roundf:\
+	     returning $et_vect_call_roundf_saved($et_index)" 2
+    return $et_vect_call_roundf_saved($et_index)
 }
 
 # Return 1 if the target supports section-anchors
@@ -5787,7 +6019,13 @@ proc check_effective_target_init_priority {} {
 # arguments with keywords that pass particular arguments.
 
 proc is-effective-target { arg } {
+    global et_index
     set selected 0
+    if { ![info exists et_index] } {
+	# Initialize the effective target index that is used in some
+	# check_effective_target_* procs.
+	set et_index 0
+    }
     if { [info procs check_effective_target_${arg}] != [list] } {
 	set selected [check_effective_target_${arg}]
     } else {
@@ -5838,6 +6076,50 @@ proc is-effective-target-keyword { arg } {
     }
 }
 
+# Execute tests for all targets in EFFECTIVE_TARGETS list.  Set et_index to
+# indicate what target is currently being processed.  This is for
+# the vectorizer tests, e.g. vect_int, to keep track what target supports
+# a given feature.
+
+proc et-dg-runtest { runtest testcases flags default-extra-flags } {
+    global dg-do-what-default
+    global EFFECTIVE_TARGETS
+    global et_index
+
+    if { [llength $EFFECTIVE_TARGETS] > 0 } {
+	foreach target $EFFECTIVE_TARGETS {
+	    set target_flags $flags
+	    set dg-do-what-default compile
+	    set et_index [lsearch -exact $EFFECTIVE_TARGETS $target]
+	    if { [info procs add_options_for_${target}] != [list] } {
+		set target_flags [add_options_for_${target} "$flags"]
+	    }
+	    if { [info procs check_effective_target_${target}_runtime]
+		 != [list] && [check_effective_target_${target}_runtime] } {
+		set dg-do-what-default run
+	    }
+	    $runtest $testcases $target_flags ${default-extra-flags}
+	}
+    } else {
+	set et_index 0
+	$runtest $testcases $flags ${default-extra-flags}
+    }
+}
+
+# Return 1 if a target matches the target in EFFECTIVE_TARGETS at index
+# et_index, 0 otherwise.
+
+proc et-is-effective-target { target } {
+    global EFFECTIVE_TARGETS
+    global et_index
+
+    if { [llength $EFFECTIVE_TARGETS] > $et_index
+	 && [lindex $EFFECTIVE_TARGETS $et_index] == $target } {
+	    return 1
+    }
+    return 0
+}
+
 # Return 1 if target default to short enums
 
 proc check_effective_target_short_enums { } {
@@ -6508,13 +6790,19 @@ proc check_effective_target_stpcpy {} {
 
 # Check whether the vectorizer tests are supported by the target and
 # append additional target-dependent compile flags to DEFAULT_VECTCFLAGS.
+# If a port wants to execute the tests more than once it should append
+# the supported target to EFFECTIVE_TARGETS instead, and the compile flags
+# will be added by a call to add_options_for_<target>.
 # Set dg-do-what-default to either compile or run, depending on target
-# capabilities.  Return 1 if vectorizer tests are supported by
-# target, 0 otherwise.
+# capabilities.  Do not set this if the supported target is appended to
+# EFFECTIVE_TARGETS.  Flags and this variable will be set by et-dg-runtest
+# automatically.  Return the number of effective targets if vectorizer tests
+# are supported, 0 otherwise.
 
 proc check_vect_support_and_set_flags { } {
     global DEFAULT_VECTCFLAGS
     global dg-do-what-default
+    global EFFECTIVE_TARGETS
 
     if  [istarget powerpc-*paired*]  {
         lappend DEFAULT_VECTCFLAGS "-mpaired"
@@ -6557,13 +6845,14 @@ 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"
+	       && [check_effective_target_nomips16] } {
+	if { [check_effective_target_mpaired_single] } {
+	    lappend EFFECTIVE_TARGETS mpaired_single
+	}
+	if { [check_effective_target_mips_loongson] } {
+	    lappend EFFECTIVE_TARGETS mips_loongson
         }
-        set dg-do-what-default run
+	return [llength $EFFECTIVE_TARGETS]
     } elseif [istarget sparc*-*-*] {
         lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis"
         if [check_effective_target_ultrasparc_hw] {
-- 
2.4.5


^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2015-08-10 12:15 [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets Robert Suchanek
  2016-01-05 16:16 ` Robert Suchanek
@ 2016-05-05 15:14 ` Robert Suchanek
  2016-05-06 11:21   ` Matthew Fortune
                     ` (2 more replies)
  1 sibling, 3 replies; 17+ messages in thread
From: Robert Suchanek @ 2016-05-05 15:14 UTC (permalink / raw)
  To: Catherine_Moore, Matthew Fortune; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 7016 bytes --]

Hi,

I'm resending this patch as it has been rebased and updated.  I reverted a change
to check_effective_target_vect_call_lrint procedure because it does not use
cached result.

Regards,
Robert

> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-owner@gcc.gnu.org] On
> Behalf Of Robert Suchanek
> Sent: 10 August 2015 13:15
> To: Catherine_Moore@mentor.com; Matthew Fortune
> Cc: gcc-patches@gcc.gnu.org
> Subject: [PATCH 3/4] Add support to run auto-vectorization tests for multiple
> effective targets
> 
> Hi,
> 
> This patch allows to run auto-vectorization tests for more than one effective
> target.  The initial proposal
> 
> https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02289.html
> 
> had some issues that have been addressed and should work as expected now.
> 
> The idea was to add a wrapper procedure that would:
> 1. Iterative over a list of EFFECTIVE_TARGETS e.g. mips_msa, mpaired_single.
> 2. Add necessary compile time options for each effective target.
> 3. Check if it's possible to compile and/or run on a target, and set
>    dg-do-what-default accordingly.
> 4. Set the target index to tell check_effective_target_vect_* which target is
>    currently being processed.
> 5. Invoke {gfortran-,g++-,}dg-runtest with the list of vector tests as normal.
> 
> The above required that every vector feature e.g. vect_int that caches the
> result is
> capable of tracking what target supports a feature.  The result is saved to a
> list
> at an index controlled by the wrapper (et-dg-runtest).  Ports not using this
> feature,
> set DEFAULT_VECTFLAGS and the tests should run as they used to.
> 
> The patch was additionally tested on x86_64-unknown-linux-gnu and aarch64-
> linux-gnu.
> 
> Regards,
> Robert
> 
> gcc/testsuite/ChangeLog:
> 
> 	* g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS. Call
> 	g++-dg-runtest via et-dg-runtest.
> 	* gcc.dg/graphite/graphite.exp: Likewise, but for 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_effective_target_mpaired_single_runtime): Likewise.
> 	(check_effective_target_mips_loongson_runtime): Likewise.
> 	(add_options_for_mpaired_single): Likewise.
> 	(check_effective_target_vect_int): Add global et_index.
> 	Check and save the supported feature for a target selected by
> 	the et_index target.  Break long lines where appropriate.  Call
> 	et-is-effective-target for MIPS with an argument instead of
> 	check_effective_target_* where appropriate.
> 	(check_effective_target_vect_intfloat_cvt): Likewise.
> 	(check_effective_target_vect_uintfloat_cvt): Likewise.
> 	(check_effective_target_vect_floatint_cvt): Likewise.
> 	(check_effective_target_vect_floatuint_cvt): Likewise.
> 	(check_effective_target_vect_simd_clones): Likewise.
> 	(check_effective_target_vect_shift): ewise.
> 	(check_effective_target_whole_vector_shift): Likewise.
> 	(check_effective_target_vect_bswap): Likewise.
> 	(check_effective_target_vect_shift_char): Likewise.
> 	(check_effective_target_vect_long): Likewise.
> 	(check_effective_target_vect_float): Likewise.
> 	(check_effective_target_vect_double): Likewise.
> 	(check_effective_target_vect_long_long): Likewise.
> 	(check_effective_target_vect_no_int_max): Likewise.
> 	(check_effective_target_vect_no_int_add): Likewise.
> 	(check_effective_target_vect_no_bitwise): Likewise.
> 	(check_effective_target_vect_widen_shift): Likewise.
> 	(check_effective_target_vect_no_align): Likewise.
> 	(check_effective_target_vect_hw_misalign): Likewise.
> 	(check_effective_target_vect_element_align): Likewise.
> 	(check_effective_target_vect_condition): Likewise.
> 	(check_effective_target_vect_cond_mixed): Likewise.
> 	(check_effective_target_vect_char_mult): Likewise.
> 	(check_effective_target_vect_short_mult): Likewise.
> 	(check_effective_target_vect_int_mult): Likewise.
> 	(check_effective_target_vect_extract_even_odd): Likewise.
> 	(check_effective_target_vect_interleave): Likewise.
> 	(check_effective_target_vect_stridedN): Likewise.
> 	(check_effective_target_vect_multiple_sizes): Likewise.
> 	(check_effective_target_vect64): Likewise.
> 	(check_effective_target_vect_call_copysignf): Likewise.
> 	(check_effective_target_vect_call_sqrtf): Likewise.
> 	(check_effective_target_vect_call_lrint): Likewise.
> 	(check_effective_target_vect_call_btrunc): Likewise.
> 	(check_effective_target_vect_call_btruncf): Likewise.
> 	(check_effective_target_vect_call_ceil): Likewise.
> 	(check_effective_target_vect_call_ceilf): Likewise.
> 	(check_effective_target_vect_call_floor): Likewise.
> 	(check_effective_target_vect_call_floorf): Likewise.
> 	(check_effective_target_vect_call_lceil): Likewise.
> 	(check_effective_target_vect_call_lfloor): Likewise.
> 	(check_effective_target_vect_call_nearbyint): Likewise.
> 	(check_effective_target_vect_call_nearbyintf): Likewise.
> 	(check_effective_target_vect_call_round): Likewise.
> 	(check_effective_target_vect_call_roundf): Likewise.
> 	(check_effective_target_vect_perm): Likewise, but also append *_saved
> 	to the existing global name to properly cache the result.
> 	(check_effective_target_vect_perm_byte): Likewise.
> 	(check_effective_target_vect_perm_short): Likewise.
> 	(check_effective_target_vect_widen_sum_hi_to_si_pattern): Likewise.
> 	(check_effective_target_vect_widen_sum_hi_to_si): Likewise.
> 	(check_effective_target_vect_widen_sum_qi_to_hi): Likewise.
> 	(check_effective_target_vect_widen_sum_qi_to_si): Likewise.
> 	(check_effective_target_vect_widen_mult_qi_to_hi_pattern): Likewise.
> 	(check_effective_target_vect_widen_mult_qi_to_hi): Likewise.
> 	(check_effective_target_vect_widen_mult_hi_to_si_pattern): Likewise.
> 	(check_effective_target_vect_widen_mult_si_to_di_pattern): Likewise.
> 	(check_effective_target_vect_sdot_qi): Likewise.
> 	(check_effective_target_vect_udot_qi): Likewise.
> 	(check_effective_target_vect_sdot_hi): Likewise.
> 	(check_effective_target_vect_udot_hi): Likewise.
> 	(check_effective_target_vect_usad_char): Likewise.
> 	(check_effective_target_vect_pack_trunc): Likewise.
> 	(check_effective_target_vect_unpack): Likewise.
> 	(check_effective_target_vect_aligned_arrays): Likewise.
> 	(check_effective_target_vect_natural_alignment): Likewise.
> 	(check_effective_target_vector_alignment_reachable): Likewise.
> 	(check_effective_target_vector_alignment_reachable_for_64bit): Likewise.
> 	(is-effective-target): Initialize et_index if undefined.
> 	(et-dg-runtest): New.
> 	(et-is-effective-target): Likewise.
> 	(check_vect_support_and_set_flags): Add supported MIPS targets to
> 	EFFECTIVE_TARGETS list.  Return the number of supported targets.

[-- Attachment #2: 0003-Add-support-to-run-auto-vectorization-tests-for-mult.patch --]
[-- Type: application/octet-stream, Size: 113399 bytes --]

From a583b8d2df00d35a7cc830a7f7330d9cbba34cd9 Mon Sep 17 00:00:00 2001
From: Robert Suchanek <robert.suchanek@imgtec.com>
Date: Wed, 5 Aug 2015 16:47:06 +0100
Subject: [PATCH 3/4] Add support to run auto-vectorization tests for multiple
 effective targets.

gcc/testsuite/ChangeLog:

	* g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS. Call
	g++-dg-runtest via et-dg-runtest.
	* gcc.dg/graphite/graphite.exp: Likewise, but for 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_effective_target_mpaired_single_runtime): Likewise.
	(check_effective_target_mips_loongson_runtime): Likewise.
	(add_options_for_mpaired_single): Likewise.
	(check_effective_target_vect_int): Add global et_index.
	Check and save the supported feature for a target selected by
	the et_index target.  Break long lines where appropriate.  Call
	et-is-effective-target for MIPS with an argument instead of
	check_effective_target_* where appropriate.
	(check_effective_target_vect_intfloat_cvt): Likewise.
	(check_effective_target_vect_uintfloat_cvt): Likewise.
	(check_effective_target_vect_floatint_cvt): Likewise.
	(check_effective_target_vect_floatuint_cvt): Likewise.
	(check_effective_target_vect_simd_clones): Likewise.
	(check_effective_target_vect_shift): ewise.
	(check_effective_target_whole_vector_shift): Likewise.
	(check_effective_target_vect_bswap): Likewise.
	(check_effective_target_vect_shift_char): Likewise.
	(check_effective_target_vect_long): Likewise.
	(check_effective_target_vect_float): Likewise.
	(check_effective_target_vect_double): Likewise.
	(check_effective_target_vect_long_long): Likewise.
	(check_effective_target_vect_no_int_max): Likewise.
	(check_effective_target_vect_no_int_add): Likewise.
	(check_effective_target_vect_no_bitwise): Likewise.
	(check_effective_target_vect_widen_shift): Likewise.
	(check_effective_target_vect_no_align): Likewise.
	(check_effective_target_vect_hw_misalign): Likewise.
	(check_effective_target_vect_element_align): Likewise.
	(check_effective_target_vect_condition): Likewise.
	(check_effective_target_vect_cond_mixed): Likewise.
	(check_effective_target_vect_char_mult): Likewise.
	(check_effective_target_vect_short_mult): Likewise.
	(check_effective_target_vect_int_mult): Likewise.
	(check_effective_target_vect_extract_even_odd): Likewise.
	(check_effective_target_vect_interleave): Likewise.
	(check_effective_target_vect_stridedN): Likewise.
	(check_effective_target_vect_multiple_sizes): Likewise.
	(check_effective_target_vect64): Likewise.
	(check_effective_target_vect_call_copysignf): Likewise.
	(check_effective_target_vect_call_sqrtf): Likewise.
	(check_effective_target_vect_call_btrunc): Likewise.
	(check_effective_target_vect_call_btruncf): Likewise.
	(check_effective_target_vect_call_ceil): Likewise.
	(check_effective_target_vect_call_ceilf): Likewise.
	(check_effective_target_vect_call_floor): Likewise.
	(check_effective_target_vect_call_floorf): Likewise.
	(check_effective_target_vect_call_lceil): Likewise.
	(check_effective_target_vect_call_lfloor): Likewise.
	(check_effective_target_vect_call_nearbyint): Likewise.
	(check_effective_target_vect_call_nearbyintf): Likewise.
	(check_effective_target_vect_call_round): Likewise.
	(check_effective_target_vect_call_roundf): Likewise.
	(check_effective_target_vect_perm): Likewise, but also append *_saved
	to the existing global name to properly cache the result.
	(check_effective_target_vect_perm_byte): Likewise.
	(check_effective_target_vect_perm_short): Likewise.
	(check_effective_target_vect_widen_sum_hi_to_si_pattern): Likewise.
	(check_effective_target_vect_widen_sum_hi_to_si): Likewise.
	(check_effective_target_vect_widen_sum_qi_to_hi): Likewise.
	(check_effective_target_vect_widen_sum_qi_to_si): Likewise.
	(check_effective_target_vect_widen_mult_qi_to_hi_pattern): Likewise.
	(check_effective_target_vect_widen_mult_qi_to_hi): Likewise.
	(check_effective_target_vect_widen_mult_hi_to_si_pattern): Likewise.
	(check_effective_target_vect_widen_mult_si_to_di_pattern): Likewise.
	(check_effective_target_vect_sdot_qi): Likewise.
	(check_effective_target_vect_udot_qi): Likewise.
	(check_effective_target_vect_sdot_hi): Likewise.
	(check_effective_target_vect_udot_hi): Likewise.
	(check_effective_target_vect_usad_char): Likewise.
	(check_effective_target_vect_pack_trunc): Likewise.
	(check_effective_target_vect_unpack): Likewise.
	(check_effective_target_vect_aligned_arrays): Likewise.
	(check_effective_target_vect_natural_alignment): Likewise.
	(check_effective_target_vector_alignment_reachable): Likewise.
	(check_effective_target_vector_alignment_reachable_for_64bit): Likewise.
	(is-effective-target): Initialize et_index if undefined.
	(et-dg-runtest): New.
	(et-is-effective-target): Likewise.
	(check_vect_support_and_set_flags): Add supported MIPS targets to
	EFFECTIVE_TARGETS list.  Return the number of supported targets.
---
 gcc/testsuite/g++.dg/vect/vect.exp              |   17 +-
 gcc/testsuite/gcc.dg/graphite/graphite.exp      |    7 +-
 gcc/testsuite/gcc.dg/vect/vect.exp              |  158 ++--
 gcc/testsuite/gfortran.dg/graphite/graphite.exp |    8 +-
 gcc/testsuite/gfortran.dg/vect/vect.exp         |   46 +-
 gcc/testsuite/lib/target-supports.exp           | 1101 ++++++++++++++---------
 6 files changed, 848 insertions(+), 489 deletions(-)

diff --git a/gcc/testsuite/g++.dg/vect/vect.exp b/gcc/testsuite/g++.dg/vect/vect.exp
index bac923b..f699082 100644
--- a/gcc/testsuite/g++.dg/vect/vect.exp
+++ b/gcc/testsuite/g++.dg/vect/vect.exp
@@ -39,6 +39,11 @@ set save-dg-do-what-default ${dg-do-what-default}
 global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS ""
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_TARGETS ""
+
 # These flags are used for all targets.
 lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fno-vect-cost-model"
 
@@ -58,10 +63,10 @@ lappend VECT_SLP_CFLAGS "-fdump-tree-slp-details"
 dg-init
 
 # Main loop.
-g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/{pr,simd}*.{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,simd}*.{c,cc,S} ]] "" $DEFAULT_VECTCFLAGS
+et-dg-runtest g++-dg-runtest [lsort [glob -nocomplain \
+	$srcdir/$subdir/slp-pr*.{c,cc,S} ]] "" $VECT_SLP_CFLAGS
 
 #### Tests with special options
 global SAVED_DEFAULT_VECTCFLAGS
@@ -70,8 +75,8 @@ set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
 # --param max-aliased-vops=0
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "--param max-aliased-vops=0"
-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
 
 # Clean up.
 set dg-do-what-default ${save-dg-do-what-default} 
diff --git a/gcc/testsuite/gcc.dg/graphite/graphite.exp b/gcc/testsuite/gcc.dg/graphite/graphite.exp
index f24d10e..ac81e82 100644
--- a/gcc/testsuite/gcc.dg/graphite/graphite.exp
+++ b/gcc/testsuite/gcc.dg/graphite/graphite.exp
@@ -37,6 +37,11 @@ set save-dg-do-what-default ${dg-do-what-default}
 # Initialize `dg'.
 dg-init
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_TARGETS ""
+
 set wait_to_run_files [lsort [glob -nocomplain $srcdir/$subdir/*.c ] ]
 set scop_files        [lsort [glob -nocomplain $srcdir/$subdir/scop-*.c ] ]
 set id_files          [lsort [glob -nocomplain $srcdir/$subdir/id-*.c ] ]
@@ -69,7 +74,7 @@ global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details -ffast-math"
 
 if [check_vect_support_and_set_flags] {
-    dg-runtest $vect_files        "" $DEFAULT_VECTCFLAGS
+    et-dg-runtest dg-runtest $vect_files        "" $DEFAULT_VECTCFLAGS
 }
 
 # 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 e4a289d..bbb9f5c 100644
--- a/gcc/testsuite/gcc.dg/vect/vect.exp
+++ b/gcc/testsuite/gcc.dg/vect/vect.exp
@@ -24,6 +24,11 @@ load_lib clearcap.exp
 global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS ""
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_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 +67,15 @@ lappend O_VECTCFLAGS "-fdump-tree-vect-details"
 lappend DEFAULT_VECTCFLAGS "-O2"
 
 # 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
 
 # "-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
 
 set VECT_SLP_CFLAGS $DEFAULT_VECTCFLAGS
 
@@ -81,14 +88,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
 }
 
 #### Tests with special options
@@ -99,141 +110,164 @@ set SAVED_VECT_SLP_CFLAGS $VECT_SLP_CFLAGS
 # --param vect-max-version-for-alias-checks=0 tests
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=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
 
 # -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
 
 # -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-*.\[cS\]]]  \
-        "" $VECT_SLP_CFLAGS
+et-dg-runtest dg-runtest [lsort \
+	[glob -nocomplain $srcdir/$subdir/fast-math-bb-slp-*.\[cS\]]] \
+	"" $VECT_SLP_CFLAGS
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 # 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-anchors-*.\[cS\]]]  \
+et-dg-runtest dg-runtest [lsort \
+	[glob -nocomplain $srcdir/$subdir/aligned-section-anchors-*.\[cS\]]] \
 	"" $DEFAULT_VECTCFLAGS
 
 # -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
 
 # -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
 
 # -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-*.\[cS\]]]  \
+et-dg-runtest dg-runtest [lsort \
+	[glob -nocomplain $srcdir/$subdir/no-trapping-math-*.\[cS\]]] \
 	"" $DEFAULT_VECTCFLAGS
 
 # -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
 
 # -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
 
 # -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-*.\[cS\]]]  \
-        "" $DEFAULT_VECTCFLAGS
+et-dg-runtest dg-runtest [lsort \
+	[glob -nocomplain $srcdir/$subdir/no-scevccp-outer-*.\[cS\]]] \
+	"" $DEFAULT_VECTCFLAGS
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 # 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
 
 # With --param ggc-min-expand=0 --param ggc-min-heapsize=0 
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "--param" "ggc-min-expand=0" "--param" "ggc-min-heapsize=0"
-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
 
 # -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
 
 # With -O3.
 # Don't allow IPA cloning, because it throws our counts out of whack.
@@ -242,40 +276,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
 
 # 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
 
 # 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
 
 # -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
 
 # -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
 
 # -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
 
 # -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
 
 
 # Clean up.
diff --git a/gcc/testsuite/gfortran.dg/graphite/graphite.exp b/gcc/testsuite/gfortran.dg/graphite/graphite.exp
index 6a19b4c..f3f83ac 100644
--- a/gcc/testsuite/gfortran.dg/graphite/graphite.exp
+++ b/gcc/testsuite/gfortran.dg/graphite/graphite.exp
@@ -51,9 +51,15 @@ gfortran-dg-runtest $scop_files        "" "-O2 -fgraphite -fdump-tree-graphite-a
 gfortran-dg-runtest $id_files          "" "-O2 -fgraphite-identity -ffast-math"
 gfortran-dg-runtest $opt_files         "" "-O2 -floop-nest-optimize -ffast-math -fdump-tree-graphite-all"
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_TARGETS ""
+
 # Vectorizer tests, to be run or compiled, depending on target capabilities.
 if [check_vect_support_and_set_flags] {
-    gfortran-dg-runtest $vect_files "" "-O2 -fgraphite-identity -ftree-vectorize -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 -fdump-tree-vect-details -ffast-math"
 }
 
 # Tests to be run.
diff --git a/gcc/testsuite/gfortran.dg/vect/vect.exp b/gcc/testsuite/gfortran.dg/vect/vect.exp
index 9ed21fc..bd35a7c 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect.exp
+++ b/gcc/testsuite/gfortran.dg/vect/vect.exp
@@ -24,6 +24,11 @@ load_lib target-supports.exp
 global DEFAULT_VECTCFLAGS
 set DEFAULT_VECTCFLAGS ""
 
+# Set up a list of effective targets to run vector tests for all supported
+# targets.
+global EFFECTIVE_TARGETS
+set EFFECTIVE_TARGETS ""
+
 # These flags are used for all targets.
 lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model=unlimited" \
   "-fdump-tree-vect-details"
@@ -47,8 +52,10 @@ if ![check_vect_support_and_set_flags] {
 dg-init
 
 # 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\]{,90,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
 
 #### Tests with special options
 global SAVED_DEFAULT_VECTCFLAGS
@@ -57,44 +64,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
 
 # -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-real8*.\[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
 
 # -fvect-cost-model tests
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "-fvect-cost-model=dynamic"
-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
 
 # --param vect-max-version-for-alias-checks=0 tests
 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=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
 
 # 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
 
 # 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
 
 # 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-copy-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
 
 # 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/target-supports.exp
index 04ca176..8f0bc0d 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1549,6 +1549,47 @@ proc check_sse_hw_available { } {
     }]
 }
 
+# Return 1 if the target supports executing MIPS Paired-Single instructions,
+# 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.ps $f2,$f4,$f6");
+		return 0;
+	      }
+	    } ""
+	}
+    }]
+}
+
+# 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 <loongson.h>
+	      int main()
+	      {
+		asm volatile ("paddw $f2,$f4,$f6");
+		return 0;
+	      }
+	    } ""
+	}
+    }]
+}
+
 # Return 1 if the target supports executing SSE2 instructions, 0
 # otherwise.  Cache the result.
 
@@ -1618,6 +1659,27 @@ proc check_effective_target_sse2_runtime { } {
     return 0
 }
 
+# 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 otherwise.
+
+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 AVX executables, 0 otherwise.
 
 proc check_effective_target_avx_runtime { } {
@@ -2456,11 +2518,12 @@ proc check_effective_target_vect_cmdline_needed { } {
 
 proc check_effective_target_vect_int { } {
     global et_vect_int_saved
+    global et_index
 
-    if [info exists et_vect_int_saved] {
+    if [info exists et_vect_int_saved($et_index)] {
 	verbose "check_effective_target_vect_int: using cached result" 2
     } else {
-	set et_vect_int_saved 0
+	set et_vect_int_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
              || ([istarget powerpc*-*-*]
                   && ![istarget powerpc-*-linux*paired*])
@@ -2471,13 +2534,14 @@ proc check_effective_target_vect_int { } {
 	      || [istarget aarch64*-*-*]
 	      || [check_effective_target_arm32]
 	      || ([istarget mips*-*-*]
-		  && [check_effective_target_mips_loongson]) } {
-	   set et_vect_int_saved 1
+		  && [et-is-effective-target mips_loongson]) } {
+	    set et_vect_int_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_int: returning $et_vect_int_saved" 2
-    return $et_vect_int_saved
+    verbose "check_effective_target_vect_int:\
+	     returning $et_vect_int_saved($et_index)" 2
+    return $et_vect_int_saved($et_index)
 }
 
 # Return 1 if the target supports signed int->float conversion 
@@ -2485,22 +2549,25 @@ proc check_effective_target_vect_int { } {
 
 proc check_effective_target_vect_intfloat_cvt { } {
     global et_vect_intfloat_cvt_saved
+    global et_index
 
-    if [info exists et_vect_intfloat_cvt_saved] {
-        verbose "check_effective_target_vect_intfloat_cvt: using cached result" 2
+    if [info exists et_vect_intfloat_cvt_saved($et_index)] {
+	verbose "check_effective_target_vect_intfloat_cvt:\
+		 using cached result" 2
     } else {
-        set et_vect_intfloat_cvt_saved 0
+	set et_vect_intfloat_cvt_saved($et_index) 0
         if { [istarget i?86-*-*] || [istarget x86_64-*-*]
               || ([istarget powerpc*-*-*]
                    && ![istarget powerpc-*-linux*paired*])
               || ([istarget arm*-*-*]
                   && [check_effective_target_arm_neon_ok])} {
-           set et_vect_intfloat_cvt_saved 1
+	   set et_vect_intfloat_cvt_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_intfloat_cvt: returning $et_vect_intfloat_cvt_saved" 2
-    return $et_vect_intfloat_cvt_saved
+    verbose "check_effective_target_vect_intfloat_cvt:\
+	     returning $et_vect_intfloat_cvt_saved($et_index)" 2
+    return $et_vect_intfloat_cvt_saved($et_index)
 }
 
 #Return 1 if we're supporting __int128 for target, 0 otherwise.
@@ -2522,23 +2589,26 @@ proc check_effective_target_int128 { } {
 
 proc check_effective_target_vect_uintfloat_cvt { } {
     global et_vect_uintfloat_cvt_saved
+    global et_index
 
-    if [info exists et_vect_uintfloat_cvt_saved] {
-        verbose "check_effective_target_vect_uintfloat_cvt: using cached result" 2
+    if [info exists et_vect_uintfloat_cvt_saved($et_index)] {
+	verbose "check_effective_target_vect_uintfloat_cvt:\
+		 using cached result" 2
     } else {
-        set et_vect_uintfloat_cvt_saved 0
+	set et_vect_uintfloat_cvt_saved($et_index) 0
         if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	      || ([istarget powerpc*-*-*]
 		  && ![istarget powerpc-*-linux*paired*])
 	      || [istarget aarch64*-*-*]
 	      || ([istarget arm*-*-*]
 		  && [check_effective_target_arm_neon_ok])} {
-           set et_vect_uintfloat_cvt_saved 1
+	   set et_vect_uintfloat_cvt_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_uintfloat_cvt: returning $et_vect_uintfloat_cvt_saved" 2
-    return $et_vect_uintfloat_cvt_saved
+    verbose "check_effective_target_vect_uintfloat_cvt:\
+	     returning $et_vect_uintfloat_cvt_saved($et_index)" 2
+    return $et_vect_uintfloat_cvt_saved($et_index)
 }
 
 
@@ -2547,22 +2617,25 @@ proc check_effective_target_vect_uintfloat_cvt { } {
 
 proc check_effective_target_vect_floatint_cvt { } {
     global et_vect_floatint_cvt_saved
+    global et_index
 
-    if [info exists et_vect_floatint_cvt_saved] {
-        verbose "check_effective_target_vect_floatint_cvt: using cached result" 2
+    if [info exists et_vect_floatint_cvt_saved($et_index)] {
+	verbose "check_effective_target_vect_floatint_cvt:\
+		 using cached result" 2
     } else {
-        set et_vect_floatint_cvt_saved 0
+	set et_vect_floatint_cvt_saved($et_index) 0
         if { [istarget i?86-*-*] || [istarget x86_64-*-*]
               || ([istarget powerpc*-*-*]
                    && ![istarget powerpc-*-linux*paired*])
               || ([istarget arm*-*-*]
                   && [check_effective_target_arm_neon_ok])} {
-           set et_vect_floatint_cvt_saved 1
+	   set et_vect_floatint_cvt_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_floatint_cvt: returning $et_vect_floatint_cvt_saved" 2
-    return $et_vect_floatint_cvt_saved
+    verbose "check_effective_target_vect_floatint_cvt:\
+	     returning $et_vect_floatint_cvt_saved($et_index)" 2
+    return $et_vect_floatint_cvt_saved($et_index)
 }
 
 # Return 1 if the target supports unsigned float->int conversion
@@ -2570,21 +2643,24 @@ proc check_effective_target_vect_floatint_cvt { } {
 
 proc check_effective_target_vect_floatuint_cvt { } {
     global et_vect_floatuint_cvt_saved
+    global et_index
 
-    if [info exists et_vect_floatuint_cvt_saved] {
-        verbose "check_effective_target_vect_floatuint_cvt: using cached result" 2
+    if [info exists et_vect_floatuint_cvt_saved($et_index)] {
+	verbose "check_effective_target_vect_floatuint_cvt:\
+		 using cached result" 2
     } else {
-        set et_vect_floatuint_cvt_saved 0
+	set et_vect_floatuint_cvt_saved($et_index) 0
         if { ([istarget powerpc*-*-*]
 	      && ![istarget powerpc-*-linux*paired*])
 	    || ([istarget arm*-*-*]
-	        && [check_effective_target_arm_neon_ok])} {
-           set et_vect_floatuint_cvt_saved 1
+		&& [check_effective_target_arm_neon_ok])} {
+	   set et_vect_floatuint_cvt_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_floatuint_cvt: returning $et_vect_floatuint_cvt_saved" 2
-    return $et_vect_floatuint_cvt_saved
+    verbose "check_effective_target_vect_floatuint_cvt:\
+	     returning $et_vect_floatuint_cvt_saved($et_index)" 2
+    return $et_vect_floatuint_cvt_saved($et_index)
 }
 
 # Return 1 if the target supports #pragma omp declare simd, 0 otherwise.
@@ -2593,24 +2669,26 @@ proc check_effective_target_vect_floatuint_cvt { } {
 
 proc check_effective_target_vect_simd_clones { } {
     global et_vect_simd_clones_saved
+    global et_index
 
-    if [info exists et_vect_simd_clones_saved] {
+    if [info exists et_vect_simd_clones_saved($et_index)] {
 	verbose "check_effective_target_vect_simd_clones: using cached result" 2
     } else {
-	set et_vect_simd_clones_saved 0
+	set et_vect_simd_clones_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*] } {
 	    # On i?86/x86_64 #pragma omp declare simd builds a sse2, avx and
 	    # avx2 clone.  Only the right clone for the specified arch will be
 	    # chosen, but still we need to at least be able to assemble
 	    # avx2.
 	    if { [check_effective_target_avx512f] } {
-		set et_vect_simd_clones_saved 1
+		set et_vect_simd_clones_saved($et_index) 1
 	    }
 	}
     }
 
-    verbose "check_effective_target_vect_simd_clones: returning $et_vect_simd_clones_saved" 2
-    return $et_vect_simd_clones_saved
+    verbose "check_effective_target_vect_simd_clones:\
+	     returning $et_vect_simd_clones_saved($et_index)" 2
+    return $et_vect_simd_clones_saved($et_index)
 }
 
 # Return 1 if this is a AArch64 target supporting big endian
@@ -3494,6 +3572,15 @@ proc check_effective_target_arm_neonv2 { } {
     }
 }
 
+# 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"
+}
+
 # Return 1 if this a Loongson-2E or -2F target using an ABI that supports
 # the Loongson vector modes.
 
@@ -4015,11 +4102,12 @@ proc check_effective_target_sparc_vis { } {
 
 proc check_effective_target_vect_shift { } {
     global et_vect_shift_saved
+    global et_index
 
-    if [info exists et_vect_shift_saved] {
+    if [info exists et_vect_shift_saved($et_index)] {
 	verbose "check_effective_target_vect_shift: using cached result" 2
     } else {
-	set et_vect_shift_saved 0
+	set et_vect_shift_saved($et_index) 0
 	if { ([istarget powerpc*-*-*]
              && ![istarget powerpc-*-linux*paired*])
 	     || [istarget ia64-*-*]
@@ -4027,13 +4115,14 @@ proc check_effective_target_vect_shift { } {
 	     || [istarget aarch64*-*-*]
 	     || [check_effective_target_arm32]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mips_loongson]) } {
-	   set et_vect_shift_saved 1
+		&& [et-is-effective-target mips_loongson]) } {
+	   set et_vect_shift_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_shift: returning $et_vect_shift_saved" 2
-    return $et_vect_shift_saved
+    verbose "check_effective_target_vect_shift:\
+	     returning $et_vect_shift_saved($et_index)" 2
+    return $et_vect_shift_saved($et_index)
 }
 
 proc check_effective_target_whole_vector_shift { } {
@@ -4044,7 +4133,7 @@ proc check_effective_target_whole_vector_shift { } {
 	 || ([check_effective_target_arm32]
 	     && [check_effective_target_arm_little_endian])
 	 || ([istarget mips*-*-*]
-	     && [check_effective_target_mips_loongson]) } {
+	     && [et-is-effective-target mips_loongson]) } {
 	set answer 1
     } else {
 	set answer 0
@@ -4058,41 +4147,45 @@ proc check_effective_target_whole_vector_shift { } {
 
 proc check_effective_target_vect_bswap { } {
     global et_vect_bswap_saved
+    global et_index
 
-    if [info exists et_vect_bswap_saved] {
+    if [info exists et_vect_bswap_saved($et_index)] {
 	verbose "check_effective_target_vect_bswap: using cached result" 2
     } else {
-	set et_vect_bswap_saved 0
+	set et_vect_bswap_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
              || ([istarget arm*-*-*]
                 && [check_effective_target_arm_neon])
 	   } {
-	   set et_vect_bswap_saved 1
+	   set et_vect_bswap_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_bswap: returning $et_vect_bswap_saved" 2
-    return $et_vect_bswap_saved
+    verbose "check_effective_target_vect_bswap:\
+	     returning $et_vect_bswap_saved($et_index)" 2
+    return $et_vect_bswap_saved($et_index)
 }
 
 # Return 1 if the target supports hardware vector shift operation for char.
 
 proc check_effective_target_vect_shift_char { } {
     global et_vect_shift_char_saved
+    global et_index
 
-    if [info exists et_vect_shift_char_saved] {
+    if [info exists et_vect_shift_char_saved($et_index)] {
 	verbose "check_effective_target_vect_shift_char: using cached result" 2
     } else {
-	set et_vect_shift_char_saved 0
+	set et_vect_shift_char_saved($et_index) 0
 	if { ([istarget powerpc*-*-*]
              && ![istarget powerpc-*-linux*paired*])
 	     || [check_effective_target_arm32] } {
-	   set et_vect_shift_char_saved 1
+	   set et_vect_shift_char_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_shift_char: returning $et_vect_shift_char_saved" 2
-    return $et_vect_shift_char_saved
+    verbose "check_effective_target_vect_shift_char:\
+	     returning $et_vect_shift_char_saved($et_index)" 2
+    return $et_vect_shift_char_saved($et_index)
 }
 
 # Return 1 if the target supports hardware vectors of long, 0 otherwise.
@@ -4121,11 +4214,12 @@ proc check_effective_target_vect_long { } {
 
 proc check_effective_target_vect_float { } {
     global et_vect_float_saved
+    global et_index
 
-    if [info exists et_vect_float_saved] {
+    if [info exists et_vect_float_saved($et_index)] {
 	verbose "check_effective_target_vect_float: using cached result" 2
     } else {
-	set et_vect_float_saved 0
+	set et_vect_float_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	      || [istarget powerpc*-*-*]
 	      || [istarget spu-*-*]
@@ -4134,12 +4228,13 @@ proc check_effective_target_vect_float { } {
 	      || [istarget ia64-*-*]
 	      || [istarget aarch64*-*-*]
 	      || [check_effective_target_arm32] } {
-	   set et_vect_float_saved 1
+	   set et_vect_float_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_float: returning $et_vect_float_saved" 2
-    return $et_vect_float_saved
+    verbose "check_effective_target_vect_float:\
+	     returning $et_vect_float_saved($et_index)" 2
+    return $et_vect_float_saved($et_index)
 }
 
 # Return 1 if the target supports hardware vectors of double, 0 otherwise.
@@ -4148,11 +4243,12 @@ proc check_effective_target_vect_float { } {
 
 proc check_effective_target_vect_double { } {
     global et_vect_double_saved
+    global et_index
 
-    if [info exists et_vect_double_saved] {
+    if [info exists et_vect_double_saved($et_index)] {
 	verbose "check_effective_target_vect_double: using cached result" 2
     } else {
-	set et_vect_double_saved 0
+	set et_vect_double_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget aarch64*-*-*] } {
 	   if { [check_no_compiler_messages vect_double assembly {
@@ -4160,19 +4256,20 @@ proc check_effective_target_vect_double { } {
 		 # error No double vectorizer support.
 		 #endif
 		}] } {
-		set et_vect_double_saved 1
+		set et_vect_double_saved($et_index) 1
 	    } else {
-		set et_vect_double_saved 0
+		set et_vect_double_saved($et_index) 0
 	    }
 	} elseif { [istarget spu-*-*] } {
-	   set et_vect_double_saved 1
+	   set et_vect_double_saved($et_index) 1
 	} elseif { [istarget powerpc*-*-*] && [check_vsx_hw_available] } {
-	   set et_vect_double_saved 1
+	   set et_vect_double_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_double: returning $et_vect_double_saved" 2
-    return $et_vect_double_saved
+    verbose "check_effective_target_vect_double:\
+	     returning $et_vect_double_saved($et_index)" 2
+    return $et_vect_double_saved($et_index)
 }
 
 # Return 1 if the target supports hardware vectors of long long, 0 otherwise.
@@ -4181,18 +4278,20 @@ proc check_effective_target_vect_double { } {
 
 proc check_effective_target_vect_long_long { } {
     global et_vect_long_long_saved
+    global et_index
 
-    if [info exists et_vect_long_long_saved] {
+    if [info exists et_vect_long_long_saved($et_index)] {
         verbose "check_effective_target_vect_long_long: using cached result" 2
     } else {
-        set et_vect_long_long_saved 0
-        if { [istarget i?86-*-*] || [istarget x86_64-*-*] } {
-           set et_vect_long_long_saved 1
+	set et_vect_long_long_saved($et_index) 0
+	if { [istarget i?86-*-*] || [istarget x86_64-*-*] } {
+	   set et_vect_long_long_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_long_long: returning $et_vect_long_long_saved" 2
-    return $et_vect_long_long_saved
+    verbose "check_effective_target_vect_long_long:\
+	     returning $et_vect_long_long_saved($et_index)" 2
+    return $et_vect_long_long_saved($et_index)
 }
 
 
@@ -4203,21 +4302,24 @@ proc check_effective_target_vect_long_long { } {
 
 proc check_effective_target_vect_no_int_min_max { } {
     global et_vect_no_int_min_max_saved
+    global et_index
 
-    if [info exists et_vect_no_int_min_max_saved] {
-	verbose "check_effective_target_vect_no_int_min_max: using cached result" 2
+    if [info exists et_vect_no_int_min_max_saved($et_index)] {
+	verbose "check_effective_target_vect_no_int_min_max:\
+		 using cached result" 2
     } else {
-	set et_vect_no_int_min_max_saved 0
+	set et_vect_no_int_min_max_saved($et_index) 0
 	if { [istarget sparc*-*-*]
 	     || [istarget spu-*-*]
 	     || [istarget alpha*-*-*]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mips_loongson]) } {
-	    set et_vect_no_int_min_max_saved 1
+		 && [et-is-effective-target mips_loongson]) } {
+	    set et_vect_no_int_min_max_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_no_int_min_max: returning $et_vect_no_int_min_max_saved" 2
-    return $et_vect_no_int_min_max_saved
+    verbose "check_effective_target_vect_no_int_min_max:\
+	     returning $et_vect_no_int_min_max_saved($et_index)" 2
+    return $et_vect_no_int_min_max_saved($et_index)
 }
 
 # Return 1 if the target plus current options does not support a vector
@@ -4227,18 +4329,20 @@ proc check_effective_target_vect_no_int_min_max { } {
 
 proc check_effective_target_vect_no_int_add { } {
     global et_vect_no_int_add_saved
+    global et_index
 
-    if [info exists et_vect_no_int_add_saved] {
+    if [info exists et_vect_no_int_add_saved($et_index)] {
 	verbose "check_effective_target_vect_no_int_add: using cached result" 2
     } else {
-	set et_vect_no_int_add_saved 0
+	set et_vect_no_int_add_saved($et_index) 0
 	# Alpha only supports vector add on V8QI and V4HI.
 	if { [istarget alpha*-*-*] } {
-	    set et_vect_no_int_add_saved 1
+	    set et_vect_no_int_add_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_no_int_add: returning $et_vect_no_int_add_saved" 2
-    return $et_vect_no_int_add_saved
+    verbose "check_effective_target_vect_no_int_add:\
+	     returning $et_vect_no_int_add_saved($et_index)" 2
+    return $et_vect_no_int_add_saved($et_index)
 }
 
 # Return 1 if the target plus current options does not support vector
@@ -4248,14 +4352,16 @@ proc check_effective_target_vect_no_int_add { } {
 
 proc check_effective_target_vect_no_bitwise { } {
     global et_vect_no_bitwise_saved
+    global et_index
 
-    if [info exists et_vect_no_bitwise_saved] {
+    if [info exists et_vect_no_bitwise_saved($et_index)] {
 	verbose "check_effective_target_vect_no_bitwise: using cached result" 2
     } else {
-	set et_vect_no_bitwise_saved 0
+	set et_vect_no_bitwise_saved($et_index) 0
     }
-    verbose "check_effective_target_vect_no_bitwise: returning $et_vect_no_bitwise_saved" 2
-    return $et_vect_no_bitwise_saved
+    verbose "check_effective_target_vect_no_bitwise:\
+	     returning $et_vect_no_bitwise_saved($et_index)" 2
+    return $et_vect_no_bitwise_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports vector permutation,
@@ -4264,24 +4370,26 @@ proc check_effective_target_vect_no_bitwise { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_perm { } {
-    global et_vect_perm
+    global et_vect_perm_saved
+    global et_index
 
-    if [info exists et_vect_perm_saved] {
+    if [info exists et_vect_perm_saved($et_index)] {
         verbose "check_effective_target_vect_perm: using cached result" 2
     } else {
-        set et_vect_perm_saved 0
+	set et_vect_perm_saved($et_index) 0
         if { [is-effective-target arm_neon_ok]
 	     || [istarget aarch64*-*-*]
 	     || [istarget powerpc*-*-*]
              || [istarget spu-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mpaired_single]) } {
-            set et_vect_perm_saved 1
+		 && [et-is-effective-target mpaired_single]) } {
+	    set et_vect_perm_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_perm: returning $et_vect_perm_saved" 2
-    return $et_vect_perm_saved
+    verbose "check_effective_target_vect_perm:\
+	     returning $et_vect_perm_saved($et_index)" 2
+    return $et_vect_perm_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports vector permutation
@@ -4290,23 +4398,25 @@ proc check_effective_target_vect_perm { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_perm_byte { } {
-    global et_vect_perm_byte
+    global et_vect_perm_byte_saved
+    global et_index
 
-    if [info exists et_vect_perm_byte_saved] {
+    if [info exists et_vect_perm_byte_saved($et_index)] {
         verbose "check_effective_target_vect_perm_byte: using cached result" 2
     } else {
-        set et_vect_perm_byte_saved 0
+	set et_vect_perm_byte_saved($et_index) 0
         if { ([is-effective-target arm_neon_ok]
 	      && [is-effective-target arm_little_endian])
 	     || ([istarget aarch64*-*-*]
 		 && [is-effective-target aarch64_little_endian])
 	     || [istarget powerpc*-*-*]
              || [istarget spu-*-*] } {
-            set et_vect_perm_byte_saved 1
+	    set et_vect_perm_byte_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_perm_byte: returning $et_vect_perm_byte_saved" 2
-    return $et_vect_perm_byte_saved
+    verbose "check_effective_target_vect_perm_byte:\
+	     returning $et_vect_perm_byte_saved($et_index)" 2
+    return $et_vect_perm_byte_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports vector permutation
@@ -4315,23 +4425,25 @@ proc check_effective_target_vect_perm_byte { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_perm_short { } {
-    global et_vect_perm_short
+    global et_vect_perm_short_saved
+    global et_index
 
-    if [info exists et_vect_perm_short_saved] {
+    if [info exists et_vect_perm_short_saved($et_index)] {
         verbose "check_effective_target_vect_perm_short: using cached result" 2
     } else {
-        set et_vect_perm_short_saved 0
+	set et_vect_perm_short_saved($et_index) 0
         if { ([is-effective-target arm_neon_ok]
 	      && [is-effective-target arm_little_endian])
 	     || ([istarget aarch64*-*-*]
 		 && [is-effective-target aarch64_little_endian])
 	     || [istarget powerpc*-*-*]
              || [istarget spu-*-*] } {
-            set et_vect_perm_short_saved 1
+	    set et_vect_perm_short_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_perm_short: returning $et_vect_perm_short_saved" 2
-    return $et_vect_perm_short_saved
+    verbose "check_effective_target_vect_perm_short:\
+	     returning $et_vect_perm_short_saved($et_index)" 2
+    return $et_vect_perm_short_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4340,22 +4452,25 @@ proc check_effective_target_vect_perm_short { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_widen_sum_hi_to_si_pattern { } {
-    global et_vect_widen_sum_hi_to_si_pattern
+    global et_vect_widen_sum_hi_to_si_pattern_saved
+    global et_index
 
-    if [info exists et_vect_widen_sum_hi_to_si_pattern_saved] {
-        verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern: using cached result" 2
+    if [info exists et_vect_widen_sum_hi_to_si_pattern_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_sum_hi_to_si_pattern_saved 0
+	set et_vect_widen_sum_hi_to_si_pattern_saved($et_index) 0
         if { [istarget powerpc*-*-*]
              || [istarget aarch64*-*-*]
 	     || ([istarget arm*-*-*] &&
 		 [check_effective_target_arm_neon_ok])
              || [istarget ia64-*-*] } {
-            set et_vect_widen_sum_hi_to_si_pattern_saved 1
+	    set et_vect_widen_sum_hi_to_si_pattern_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern: returning $et_vect_widen_sum_hi_to_si_pattern_saved" 2
-    return $et_vect_widen_sum_hi_to_si_pattern_saved
+    verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern:\
+	     returning $et_vect_widen_sum_hi_to_si_pattern_saved($et_index)" 2
+    return $et_vect_widen_sum_hi_to_si_pattern_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4366,19 +4481,23 @@ proc check_effective_target_vect_widen_sum_hi_to_si_pattern { } {
 # This won't change for different subtargets so cache the result.
                                                                                                 
 proc check_effective_target_vect_widen_sum_hi_to_si { } {
-    global et_vect_widen_sum_hi_to_si
+    global et_vect_widen_sum_hi_to_si_saved
+    global et_index
 
-    if [info exists et_vect_widen_sum_hi_to_si_saved] {
-        verbose "check_effective_target_vect_widen_sum_hi_to_si: using cached result" 2
+    if [info exists et_vect_widen_sum_hi_to_si_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_sum_hi_to_si:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_sum_hi_to_si_saved [check_effective_target_vect_unpack]
+	set et_vect_widen_sum_hi_to_si_saved($et_index) \
+	    [check_effective_target_vect_unpack]
         if { [istarget powerpc*-*-*] 
 	     || [istarget ia64-*-*] } {
-            set et_vect_widen_sum_hi_to_si_saved 1
+	    set et_vect_widen_sum_hi_to_si_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_sum_hi_to_si: returning $et_vect_widen_sum_hi_to_si_saved" 2
-    return $et_vect_widen_sum_hi_to_si_saved
+    verbose "check_effective_target_vect_widen_sum_hi_to_si:\
+	     returning $et_vect_widen_sum_hi_to_si_saved($et_index)" 2
+    return $et_vect_widen_sum_hi_to_si_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4389,20 +4508,23 @@ proc check_effective_target_vect_widen_sum_hi_to_si { } {
 # This won't change for different subtargets so cache the result.
                                                                                                 
 proc check_effective_target_vect_widen_sum_qi_to_hi { } {
-    global et_vect_widen_sum_qi_to_hi
+    global et_vect_widen_sum_qi_to_hi_saved
+    global et_index
 
-    if [info exists et_vect_widen_sum_qi_to_hi_saved] {
-        verbose "check_effective_target_vect_widen_sum_qi_to_hi: using cached result" 2
+    if [info exists et_vect_widen_sum_qi_to_hi_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_sum_qi_to_hi:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_sum_qi_to_hi_saved 0
+	set et_vect_widen_sum_qi_to_hi_saved($et_index) 0
 	if { [check_effective_target_vect_unpack] 
 	     || [check_effective_target_arm_neon_ok]
 	     || [istarget ia64-*-*] } {
-            set et_vect_widen_sum_qi_to_hi_saved 1
+	    set et_vect_widen_sum_qi_to_hi_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_widen_sum_qi_to_hi: returning $et_vect_widen_sum_qi_to_hi_saved" 2
-    return $et_vect_widen_sum_qi_to_hi_saved
+    verbose "check_effective_target_vect_widen_sum_qi_to_hi:\
+	     returning $et_vect_widen_sum_qi_to_hi_saved($et_index)" 2
+    return $et_vect_widen_sum_qi_to_hi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4411,18 +4533,21 @@ proc check_effective_target_vect_widen_sum_qi_to_hi { } {
 # This won't change for different subtargets so cache the result.
                                                                                                 
 proc check_effective_target_vect_widen_sum_qi_to_si { } {
-    global et_vect_widen_sum_qi_to_si
+    global et_vect_widen_sum_qi_to_si_saved
+    global et_index
 
-    if [info exists et_vect_widen_sum_qi_to_si_saved] {
-        verbose "check_effective_target_vect_widen_sum_qi_to_si: using cached result" 2
+    if [info exists et_vect_widen_sum_qi_to_si_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_sum_qi_to_si:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_sum_qi_to_si_saved 0
+	set et_vect_widen_sum_qi_to_si_saved($et_index) 0
         if { [istarget powerpc*-*-*] } {
-            set et_vect_widen_sum_qi_to_si_saved 1
+	    set et_vect_widen_sum_qi_to_si_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_sum_qi_to_si: returning $et_vect_widen_sum_qi_to_si_saved" 2
-    return $et_vect_widen_sum_qi_to_si_saved
+    verbose "check_effective_target_vect_widen_sum_qi_to_si:\
+	     returning $et_vect_widen_sum_qi_to_si_saved($et_index)" 2
+    return $et_vect_widen_sum_qi_to_si_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4435,25 +4560,28 @@ proc check_effective_target_vect_widen_sum_qi_to_si { } {
 
 
 proc check_effective_target_vect_widen_mult_qi_to_hi { } {
-    global et_vect_widen_mult_qi_to_hi
+    global et_vect_widen_mult_qi_to_hi_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_qi_to_hi_saved] {
-        verbose "check_effective_target_vect_widen_mult_qi_to_hi: using cached result" 2
+    if [info exists et_vect_widen_mult_qi_to_hi_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_mult_qi_to_hi:\
+		 using cached result" 2
     } else {
 	if { [check_effective_target_vect_unpack]
 	     && [check_effective_target_vect_short_mult] } {
-	    set et_vect_widen_mult_qi_to_hi_saved 1
+	    set et_vect_widen_mult_qi_to_hi_saved($et_index) 1
 	} else {
-	    set et_vect_widen_mult_qi_to_hi_saved 0
+	    set et_vect_widen_mult_qi_to_hi_saved($et_index) 0
 	}
         if { [istarget powerpc*-*-*]
               || [istarget aarch64*-*-*]
               || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } {
-            set et_vect_widen_mult_qi_to_hi_saved 1
+	    set et_vect_widen_mult_qi_to_hi_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_qi_to_hi: returning $et_vect_widen_mult_qi_to_hi_saved" 2
-    return $et_vect_widen_mult_qi_to_hi_saved
+    verbose "check_effective_target_vect_widen_mult_qi_to_hi:\
+	     returning $et_vect_widen_mult_qi_to_hi_saved($et_index)" 2
+    return $et_vect_widen_mult_qi_to_hi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4466,28 +4594,32 @@ proc check_effective_target_vect_widen_mult_qi_to_hi { } {
 
 
 proc check_effective_target_vect_widen_mult_hi_to_si { } {
-    global et_vect_widen_mult_hi_to_si
+    global et_vect_widen_mult_hi_to_si_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_hi_to_si_saved] {
-        verbose "check_effective_target_vect_widen_mult_hi_to_si: using cached result" 2
+    if [info exists et_vect_widen_mult_hi_to_si_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_mult_hi_to_si:\
+		 using cached result" 2
     } else {
         if { [check_effective_target_vect_unpack]
              && [check_effective_target_vect_int_mult] } {
-          set et_vect_widen_mult_hi_to_si_saved 1
+	  set et_vect_widen_mult_hi_to_si_saved($et_index) 1
         } else {
-          set et_vect_widen_mult_hi_to_si_saved 0
+	  set et_vect_widen_mult_hi_to_si_saved($et_index) 0
         }
         if { [istarget powerpc*-*-*]
 	      || [istarget spu-*-*]
 	      || [istarget ia64-*-*]
 	      || [istarget aarch64*-*-*]
 	      || [istarget i?86-*-*] || [istarget x86_64-*-*]
-              || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } {
-            set et_vect_widen_mult_hi_to_si_saved 1
+	      || ([istarget arm*-*-*]
+		  && [check_effective_target_arm_neon_ok]) } {
+	    set et_vect_widen_mult_hi_to_si_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_hi_to_si: returning $et_vect_widen_mult_hi_to_si_saved" 2
-    return $et_vect_widen_mult_hi_to_si_saved
+    verbose "check_effective_target_vect_widen_mult_hi_to_si:\
+	     returning $et_vect_widen_mult_hi_to_si_saved($et_index)" 2
+    return $et_vect_widen_mult_hi_to_si_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4496,21 +4628,24 @@ proc check_effective_target_vect_widen_mult_hi_to_si { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_widen_mult_qi_to_hi_pattern { } {
-    global et_vect_widen_mult_qi_to_hi_pattern
+    global et_vect_widen_mult_qi_to_hi_pattern_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_qi_to_hi_pattern_saved] {
-        verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern: using cached result" 2
+    if [info exists et_vect_widen_mult_qi_to_hi_pattern_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_mult_qi_to_hi_pattern_saved 0
+	set et_vect_widen_mult_qi_to_hi_pattern_saved($et_index) 0
         if { [istarget powerpc*-*-*]
               || ([istarget arm*-*-*]
 		  && [check_effective_target_arm_neon_ok]
 		  && [check_effective_target_arm_little_endian]) } {
-            set et_vect_widen_mult_qi_to_hi_pattern_saved 1
+	    set et_vect_widen_mult_qi_to_hi_pattern_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern: returning $et_vect_widen_mult_qi_to_hi_pattern_saved" 2
-    return $et_vect_widen_mult_qi_to_hi_pattern_saved
+    verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern:\
+	     returning $et_vect_widen_mult_qi_to_hi_pattern_saved($et_index)" 2
+    return $et_vect_widen_mult_qi_to_hi_pattern_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4519,12 +4654,14 @@ proc check_effective_target_vect_widen_mult_qi_to_hi_pattern { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } {
-    global et_vect_widen_mult_hi_to_si_pattern
+    global et_vect_widen_mult_hi_to_si_pattern_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_hi_to_si_pattern_saved] {
-        verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern: using cached result" 2
+    if [info exists et_vect_widen_mult_hi_to_si_pattern_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern:\
+		 using cached result" 2
     } else {
-        set et_vect_widen_mult_hi_to_si_pattern_saved 0
+	set et_vect_widen_mult_hi_to_si_pattern_saved($et_index) 0
         if { [istarget powerpc*-*-*]
               || [istarget spu-*-*]
               || [istarget ia64-*-*]
@@ -4532,11 +4669,12 @@ proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } {
               || ([istarget arm*-*-*]
 		  && [check_effective_target_arm_neon_ok]
 		  && [check_effective_target_arm_little_endian]) } {
-            set et_vect_widen_mult_hi_to_si_pattern_saved 1
+	    set et_vect_widen_mult_hi_to_si_pattern_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern: returning $et_vect_widen_mult_hi_to_si_pattern_saved" 2
-    return $et_vect_widen_mult_hi_to_si_pattern_saved
+    verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern:\
+	     returning $et_vect_widen_mult_hi_to_si_pattern_saved($et_index)" 2
+    return $et_vect_widen_mult_hi_to_si_pattern_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4545,19 +4683,22 @@ proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_widen_mult_si_to_di_pattern { } {
-    global et_vect_widen_mult_si_to_di_pattern
+    global et_vect_widen_mult_si_to_di_pattern_saved
+    global et_index
 
-    if [info exists et_vect_widen_mult_si_to_di_pattern_saved] {
-        verbose "check_effective_target_vect_widen_mult_si_to_di_pattern: using cached result" 2
+    if [info exists et_vect_widen_mult_si_to_di_pattern_saved($et_index)] {
+	verbose "check_effective_target_vect_widen_mult_si_to_di_pattern:\
+		 using cached result" 2
     } else {
-	set et_vect_widen_mult_si_to_di_pattern_saved 0
+	set et_vect_widen_mult_si_to_di_pattern_saved($et_index) 0
         if {[istarget ia64-*-*]
 	    || [istarget i?86-*-*] || [istarget x86_64-*-*] } {
-            set et_vect_widen_mult_si_to_di_pattern_saved 1
+	    set et_vect_widen_mult_si_to_di_pattern_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_mult_si_to_di_pattern: returning $et_vect_widen_mult_si_to_di_pattern_saved" 2
-    return $et_vect_widen_mult_si_to_di_pattern_saved
+    verbose "check_effective_target_vect_widen_mult_si_to_di_pattern:\
+	     returning $et_vect_widen_mult_si_to_di_pattern_saved($et_index)" 2
+    return $et_vect_widen_mult_si_to_di_pattern_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4567,17 +4708,19 @@ proc check_effective_target_vect_widen_mult_si_to_di_pattern { } {
 
 proc check_effective_target_vect_widen_shift { } {
     global et_vect_widen_shift_saved
+    global et_index
 
-    if [info exists et_vect_shift_saved] {
+    if [info exists et_vect_shift_saved($et_index)] {
         verbose "check_effective_target_vect_widen_shift: using cached result" 2
     } else {
-        set et_vect_widen_shift_saved 0
+	set et_vect_widen_shift_saved($et_index) 0
         if { ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } {
-            set et_vect_widen_shift_saved 1
+	    set et_vect_widen_shift_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_widen_shift: returning $et_vect_widen_shift_saved" 2
-    return $et_vect_widen_shift_saved
+    verbose "check_effective_target_vect_widen_shift:\
+	     returning $et_vect_widen_shift_saved($et_index)" 2
+    return $et_vect_widen_shift_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4586,18 +4729,20 @@ proc check_effective_target_vect_widen_shift { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_sdot_qi { } {
-    global et_vect_sdot_qi
+    global et_vect_sdot_qi_saved
+    global et_index
 
-    if [info exists et_vect_sdot_qi_saved] {
+    if [info exists et_vect_sdot_qi_saved($et_index)] {
         verbose "check_effective_target_vect_sdot_qi: using cached result" 2
     } else {
-        set et_vect_sdot_qi_saved 0
+	set et_vect_sdot_qi_saved($et_index) 0
         if { [istarget ia64-*-*] } {
             set et_vect_udot_qi_saved 1
         }
     }
-    verbose "check_effective_target_vect_sdot_qi: returning $et_vect_sdot_qi_saved" 2
-    return $et_vect_sdot_qi_saved
+    verbose "check_effective_target_vect_sdot_qi:\
+	     returning $et_vect_sdot_qi_saved($et_index)" 2
+    return $et_vect_sdot_qi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4606,19 +4751,21 @@ proc check_effective_target_vect_sdot_qi { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_udot_qi { } {
-    global et_vect_udot_qi
+    global et_vect_udot_qi_saved
+    global et_index
 
-    if [info exists et_vect_udot_qi_saved] {
+    if [info exists et_vect_udot_qi_saved($et_index)] {
         verbose "check_effective_target_vect_udot_qi: using cached result" 2
     } else {
-        set et_vect_udot_qi_saved 0
+	set et_vect_udot_qi_saved($et_index) 0
         if { [istarget powerpc*-*-*]
              || [istarget ia64-*-*] } {
-            set et_vect_udot_qi_saved 1
+	    set et_vect_udot_qi_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_udot_qi: returning $et_vect_udot_qi_saved" 2
-    return $et_vect_udot_qi_saved
+    verbose "check_effective_target_vect_udot_qi:\
+	     returning $et_vect_udot_qi_saved($et_index)" 2
+    return $et_vect_udot_qi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4627,20 +4774,22 @@ proc check_effective_target_vect_udot_qi { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_sdot_hi { } {
-    global et_vect_sdot_hi
+    global et_vect_sdot_hi_saved
+    global et_index
 
-    if [info exists et_vect_sdot_hi_saved] {
+    if [info exists et_vect_sdot_hi_saved($et_index)] {
         verbose "check_effective_target_vect_sdot_hi: using cached result" 2
     } else {
-        set et_vect_sdot_hi_saved 0
+	set et_vect_sdot_hi_saved($et_index) 0
         if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
 	     || [istarget ia64-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*] } {
-            set et_vect_sdot_hi_saved 1
+	    set et_vect_sdot_hi_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_sdot_hi: returning $et_vect_sdot_hi_saved" 2
-    return $et_vect_sdot_hi_saved
+    verbose "check_effective_target_vect_sdot_hi:\
+	     returning $et_vect_sdot_hi_saved($et_index)" 2
+    return $et_vect_sdot_hi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4649,18 +4798,20 @@ proc check_effective_target_vect_sdot_hi { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_udot_hi { } {
-    global et_vect_udot_hi
+    global et_vect_udot_hi_saved
+    global et_index
 
-    if [info exists et_vect_udot_hi_saved] {
+    if [info exists et_vect_udot_hi_saved($et_index)] {
         verbose "check_effective_target_vect_udot_hi: using cached result" 2
     } else {
-        set et_vect_udot_hi_saved 0
+	set et_vect_udot_hi_saved($et_index) 0
         if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) } {
-            set et_vect_udot_hi_saved 1
+	    set et_vect_udot_hi_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_udot_hi: returning $et_vect_udot_hi_saved" 2
-    return $et_vect_udot_hi_saved
+    verbose "check_effective_target_vect_udot_hi:\
+	     returning $et_vect_udot_hi_saved($et_index)" 2
+    return $et_vect_udot_hi_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4669,18 +4820,20 @@ proc check_effective_target_vect_udot_hi { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_usad_char { } {
-    global et_vect_usad_char
+    global et_vect_usad_char_saved
+    global et_index
 
-    if [info exists et_vect_usad_char_saved] {
+    if [info exists et_vect_usad_char_saved($et_index)] {
         verbose "check_effective_target_vect_usad_char: using cached result" 2
     } else {
-        set et_vect_usad_char_saved 0
+	set et_vect_usad_char_saved($et_index) 0
         if { ([istarget i?86-*-*] || [istarget x86_64-*-*]) } {
-            set et_vect_usad_char_saved 1
+	    set et_vect_usad_char_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_usad_char: returning $et_vect_usad_char_saved" 2
-    return $et_vect_usad_char_saved
+    verbose "check_effective_target_vect_usad_char:\
+	     returning $et_vect_usad_char_saved($et_index)" 2
+    return $et_vect_usad_char_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4690,23 +4843,25 @@ proc check_effective_target_vect_usad_char { } {
 # This won't change for different subtargets so cache the result.
                                                                                 
 proc check_effective_target_vect_pack_trunc { } {
-    global et_vect_pack_trunc
+    global et_vect_pack_trunc_saved
+    global et_index
                                                                                 
-    if [info exists et_vect_pack_trunc_saved] {
+    if [info exists et_vect_pack_trunc_saved($et_index)] {
         verbose "check_effective_target_vect_pack_trunc: using cached result" 2
     } else {
-        set et_vect_pack_trunc_saved 0
+	set et_vect_pack_trunc_saved($et_index) 0
         if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
              || [istarget i?86-*-*] || [istarget x86_64-*-*]
              || [istarget aarch64*-*-*]
              || [istarget spu-*-*]
              || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]
 		 && [check_effective_target_arm_little_endian]) } {
-            set et_vect_pack_trunc_saved 1
+	    set et_vect_pack_trunc_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_pack_trunc: returning $et_vect_pack_trunc_saved" 2
-    return $et_vect_pack_trunc_saved
+    verbose "check_effective_target_vect_pack_trunc:\
+	     returning $et_vect_pack_trunc_saved($et_index)" 2
+    return $et_vect_pack_trunc_saved($et_index)
 }
 
 # Return 1 if the target plus current options supports a vector
@@ -4715,12 +4870,13 @@ proc check_effective_target_vect_pack_trunc { } {
 # This won't change for different subtargets so cache the result.
                                    
 proc check_effective_target_vect_unpack { } {
-    global et_vect_unpack
+    global et_vect_unpack_saved
+    global et_index
                                         
-    if [info exists et_vect_unpack_saved] {
+    if [info exists et_vect_unpack_saved($et_index)] {
         verbose "check_effective_target_vect_unpack: using cached result" 2
     } else {
-        set et_vect_unpack_saved 0
+	set et_vect_unpack_saved($et_index) 0
         if { ([istarget powerpc*-*-*] && ![istarget powerpc-*paired*])
              || [istarget i?86-*-*] || [istarget x86_64-*-*] 
              || [istarget spu-*-*]
@@ -4728,11 +4884,12 @@ proc check_effective_target_vect_unpack { } {
              || [istarget aarch64*-*-*]
              || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]
 		 && [check_effective_target_arm_little_endian]) } {
-            set et_vect_unpack_saved 1
+	    set et_vect_unpack_saved($et_index) 1
         }
     }
-    verbose "check_effective_target_vect_unpack: returning $et_vect_unpack_saved" 2  
-    return $et_vect_unpack_saved
+    verbose "check_effective_target_vect_unpack:\
+	     returning $et_vect_unpack_saved($et_index)" 2
+    return $et_vect_unpack_saved($et_index)
 }
 
 # Return 1 if the target plus current options does not guarantee
@@ -4759,11 +4916,12 @@ proc check_effective_target_unaligned_stack { } {
 
 proc check_effective_target_vect_no_align { } {
     global et_vect_no_align_saved
+    global et_index
 
-    if [info exists et_vect_no_align_saved] {
+    if [info exists et_vect_no_align_saved($et_index)] {
 	verbose "check_effective_target_vect_no_align: using cached result" 2
     } else {
-	set et_vect_no_align_saved 0
+	set et_vect_no_align_saved($et_index) 0
 	if { [istarget mipsisa64*-*-*]
 	     || [istarget mips-sde-elf]
 	     || [istarget sparc*-*-*]
@@ -4771,12 +4929,13 @@ proc check_effective_target_vect_no_align { } {
 	     || [check_effective_target_arm_vect_no_misalign]
 	     || ([istarget powerpc*-*-*] && [check_p8vector_hw_available])
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mips_loongson]) } {
-	    set et_vect_no_align_saved 1
+		 && [et-is-effective-target mips_loongson]) } {
+	    set et_vect_no_align_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_no_align: returning $et_vect_no_align_saved" 2
-    return $et_vect_no_align_saved
+    verbose "check_effective_target_vect_no_align:\
+	     returning $et_vect_no_align_saved($et_index)" 2
+    return $et_vect_no_align_saved($et_index)
 }
 
 # Return 1 if the target supports a vector misalign access, 0 otherwise.
@@ -4785,19 +4944,21 @@ proc check_effective_target_vect_no_align { } {
 
 proc check_effective_target_vect_hw_misalign { } {
     global et_vect_hw_misalign_saved
+    global et_index
 
-    if [info exists et_vect_hw_misalign_saved] {
+    if [info exists et_vect_hw_misalign_saved($et_index)] {
         verbose "check_effective_target_vect_hw_misalign: using cached result" 2
     } else {
-        set et_vect_hw_misalign_saved 0
-       if { [istarget i?86-*-*] || [istarget x86_64-*-*]
-            || ([istarget powerpc*-*-*] && [check_p8vector_hw_available])
-	    || [istarget aarch64*-*-*] } {
-          set et_vect_hw_misalign_saved 1
-       }
+	set et_vect_hw_misalign_saved($et_index) 0
+	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
+	     || ([istarget powerpc*-*-*] && [check_p8vector_hw_available])
+	     || [istarget aarch64*-*-*] } {
+	  set et_vect_hw_misalign_saved($et_index) 1
+	}
     }
-    verbose "check_effective_target_vect_hw_misalign: returning $et_vect_hw_misalign_saved" 2
-    return $et_vect_hw_misalign_saved
+    verbose "check_effective_target_vect_hw_misalign:\
+	     returning $et_vect_hw_misalign_saved($et_index)" 2
+    return $et_vect_hw_misalign_saved($et_index)
 }
 
 
@@ -4807,25 +4968,28 @@ proc check_effective_target_vect_hw_misalign { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_aligned_arrays { } {
-    global et_vect_aligned_arrays
+    global et_vect_aligned_arrays_saved
+    global et_index
 
-    if [info exists et_vect_aligned_arrays_saved] {
-	verbose "check_effective_target_vect_aligned_arrays: using cached result" 2
+    if [info exists et_vect_aligned_arrays_saved($et_index)] {
+	verbose "check_effective_target_vect_aligned_arrays:\
+		 using cached result" 2
     } else {
-	set et_vect_aligned_arrays_saved 0
+	set et_vect_aligned_arrays_saved($et_index) 0
         if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
 	    if { ([is-effective-target lp64]
 	          && ( ![check_avx_available]
 		     || [check_prefer_avx128])) } {
-	         set et_vect_aligned_arrays_saved 1
+		 set et_vect_aligned_arrays_saved($et_index) 1
 	    }
 	}
         if [istarget spu-*-*] {
-	    set et_vect_aligned_arrays_saved 1
+	    set et_vect_aligned_arrays_saved($et_index) 1
 	}
     }
-    verbose "check_effective_target_vect_aligned_arrays: returning $et_vect_aligned_arrays_saved" 2
-    return $et_vect_aligned_arrays_saved
+    verbose "check_effective_target_vect_aligned_arrays:\
+	     returning $et_vect_aligned_arrays_saved($et_index)" 2
+    return $et_vect_aligned_arrays_saved($et_index)
 }
 
 # Return 1 if types of size 32 bit or less are naturally aligned
@@ -4876,20 +5040,22 @@ proc check_effective_target_natural_alignment_64 { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_natural_alignment { } {
-    global et_vect_natural_alignment
+    global et_vect_natural_alignment_saved
+    global et_index
 
-    if [info exists et_vect_natural_alignment_saved] {
+    if [info exists et_vect_natural_alignment_saved($et_index)] {
         verbose "check_effective_target_vect_natural_alignment: using cached result" 2
     } else {
-        set et_vect_natural_alignment_saved 1
+	set et_vect_natural_alignment_saved($et_index) 1
         if { [check_effective_target_arm_eabi]
 	     || [istarget nvptx-*-*]
 	     || [istarget s390*-*-*] } {
-            set et_vect_natural_alignment_saved 0
+	    set et_vect_natural_alignment_saved($et_index) 0
         }
     }
-    verbose "check_effective_target_vect_natural_alignment: returning $et_vect_natural_alignment_saved" 2
-    return $et_vect_natural_alignment_saved
+    verbose "check_effective_target_vect_natural_alignment:\
+	     returning $et_vect_natural_alignment_saved($et_index)" 2
+    return $et_vect_natural_alignment_saved($et_index)
 }
 
 # Return 1 if vector alignment (for types of size 32 bit or less) is reachable, 0 otherwise.
@@ -4897,20 +5063,23 @@ proc check_effective_target_vect_natural_alignment { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vector_alignment_reachable { } {
-    global et_vector_alignment_reachable
+    global et_vector_alignment_reachable_saved
+    global et_index
 
-    if [info exists et_vector_alignment_reachable_saved] {
-        verbose "check_effective_target_vector_alignment_reachable: using cached result" 2
+    if [info exists et_vector_alignment_reachable_saved($et_index)] {
+	verbose "check_effective_target_vector_alignment_reachable:\
+		 using cached result" 2
     } else {
         if { [check_effective_target_vect_aligned_arrays]
              || [check_effective_target_natural_alignment_32] } {
-            set et_vector_alignment_reachable_saved 1
+	    set et_vector_alignment_reachable_saved($et_index) 1
         } else {
-            set et_vector_alignment_reachable_saved 0
+	    set et_vector_alignment_reachable_saved($et_index) 0
         }
     }
-    verbose "check_effective_target_vector_alignment_reachable: returning $et_vector_alignment_reachable_saved" 2
-    return $et_vector_alignment_reachable_saved
+    verbose "check_effective_target_vector_alignment_reachable:\
+	     returning $et_vector_alignment_reachable_saved($et_index)" 2
+    return $et_vector_alignment_reachable_saved($et_index)
 }
 
 # Return 1 if vector alignment for 64 bit is reachable, 0 otherwise.
@@ -4918,40 +5087,46 @@ proc check_effective_target_vector_alignment_reachable { } {
 # This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vector_alignment_reachable_for_64bit { } {
-    global et_vector_alignment_reachable_for_64bit
+    global et_vector_alignment_reachable_for_64bit_saved
+    global et_index
 
-    if [info exists et_vector_alignment_reachable_for_64bit_saved] {
-        verbose "check_effective_target_vector_alignment_reachable_for_64bit: using cached result" 2
+    if [info exists et_vector_alignment_reachable_for_64bit_saved($et_index)] {
+	verbose "check_effective_target_vector_alignment_reachable_for_64bit:\
+		 using cached result" 2
     } else {
         if { [check_effective_target_vect_aligned_arrays] 
              || [check_effective_target_natural_alignment_64] } {
-            set et_vector_alignment_reachable_for_64bit_saved 1
+	    set et_vector_alignment_reachable_for_64bit_saved($et_index) 1
         } else {
-            set et_vector_alignment_reachable_for_64bit_saved 0
+	    set et_vector_alignment_reachable_for_64bit_saved($et_index) 0
         }
     }
-    verbose "check_effective_target_vector_alignment_reachable_for_64bit: returning $et_vector_alignment_reachable_for_64bit_saved" 2
-    return $et_vector_alignment_reachable_for_64bit_saved
+    verbose "check_effective_target_vector_alignment_reachable_for_64bit:\
+	 returning $et_vector_alignment_reachable_for_64bit_saved($et_index)" 2
+    return $et_vector_alignment_reachable_for_64bit_saved($et_index)
 }
 
 # Return 1 if the target only requires element alignment for vector accesses
 
 proc check_effective_target_vect_element_align { } {
     global et_vect_element_align
+    global et_index
 
-    if [info exists et_vect_element_align] {
-	verbose "check_effective_target_vect_element_align: using cached result" 2
+    if [info exists et_vect_element_align($et_index)] {
+	verbose "check_effective_target_vect_element_align:\
+		 using cached result" 2
     } else {
-	set et_vect_element_align 0
+	set et_vect_element_align($et_index) 0
 	if { ([istarget arm*-*-*]
 	      && ![check_effective_target_arm_vect_no_misalign])
 	     || [check_effective_target_vect_hw_misalign] } {
-	   set et_vect_element_align 1
+	   set et_vect_element_align($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_element_align: returning $et_vect_element_align" 2
-    return $et_vect_element_align
+    verbose "check_effective_target_vect_element_align:\
+	     returning $et_vect_element_align($et_index)" 2
+    return $et_vect_element_align($et_index)
 }
 
 # Return 1 if the target supports vector LOAD_LANES operations, 0 otherwise.
@@ -4977,23 +5152,26 @@ proc check_effective_target_vect_load_lanes { } {
 
 proc check_effective_target_vect_condition { } {
     global et_vect_cond_saved
+    global et_index
 
-    if [info exists et_vect_cond_saved] {
+    if [info exists et_vect_cond_saved($et_index)] {
 	verbose "check_effective_target_vect_cond: using cached result" 2
     } else {
-	set et_vect_cond_saved 0
+	set et_vect_cond_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget powerpc*-*-*]
 	     || [istarget ia64-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget spu-*-*]
-	     || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } {
-	   set et_vect_cond_saved 1
+	     || ([istarget arm*-*-*]
+		 && [check_effective_target_arm_neon_ok]) } {
+	   set et_vect_cond_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_cond: returning $et_vect_cond_saved" 2
-    return $et_vect_cond_saved
+    verbose "check_effective_target_vect_cond:\
+	     returning $et_vect_cond_saved($et_index)" 2
+    return $et_vect_cond_saved($et_index)
 }
 
 # Return 1 if the target supports vector conditional operations where
@@ -5001,52 +5179,57 @@ proc check_effective_target_vect_condition { } {
 
 proc check_effective_target_vect_cond_mixed { } {
     global et_vect_cond_mixed_saved
+    global et_index
 
-    if [info exists et_vect_cond_mixed_saved] {
+    if [info exists et_vect_cond_mixed_saved($et_index)] {
 	verbose "check_effective_target_vect_cond_mixed: using cached result" 2
     } else {
-	set et_vect_cond_mixed_saved 0
+	set et_vect_cond_mixed_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget powerpc*-*-*] } {
-	   set et_vect_cond_mixed_saved 1
+	   set et_vect_cond_mixed_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_cond_mixed: returning $et_vect_cond_mixed_saved" 2
-    return $et_vect_cond_mixed_saved
+    verbose "check_effective_target_vect_cond_mixed:\
+	     returning $et_vect_cond_mixed_saved($et_index)" 2
+    return $et_vect_cond_mixed_saved($et_index)
 }
 
 # Return 1 if the target supports vector char multiplication, 0 otherwise.
 
 proc check_effective_target_vect_char_mult { } {
     global et_vect_char_mult_saved
+    global et_index
 
-    if [info exists et_vect_char_mult_saved] {
+    if [info exists et_vect_char_mult_saved($et_index)] {
 	verbose "check_effective_target_vect_char_mult: using cached result" 2
     } else {
-	set et_vect_char_mult_saved 0
+	set et_vect_char_mult_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget ia64-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
              || [check_effective_target_arm32]
 	     || [check_effective_target_powerpc_altivec] } {
-	   set et_vect_char_mult_saved 1
+	   set et_vect_char_mult_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_char_mult: returning $et_vect_char_mult_saved" 2
-    return $et_vect_char_mult_saved
+    verbose "check_effective_target_vect_char_mult:\
+	     returning $et_vect_char_mult_saved($et_index)" 2
+    return $et_vect_char_mult_saved($et_index)
 }
 
 # Return 1 if the target supports vector short multiplication, 0 otherwise.
 
 proc check_effective_target_vect_short_mult { } {
     global et_vect_short_mult_saved
+    global et_index
 
-    if [info exists et_vect_short_mult_saved] {
+    if [info exists et_vect_short_mult_saved($et_index)] {
 	verbose "check_effective_target_vect_short_mult: using cached result" 2
     } else {
-	set et_vect_short_mult_saved 0
+	set et_vect_short_mult_saved($et_index) 0
 	if { [istarget ia64-*-*]
 	     || [istarget spu-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
@@ -5054,47 +5237,52 @@ proc check_effective_target_vect_short_mult { } {
 	     || [istarget aarch64*-*-*]
 	     || [check_effective_target_arm32]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mips_loongson]) } {
-	   set et_vect_short_mult_saved 1
+		 && [et-is-effective-target mips_loongson]) } {
+	   set et_vect_short_mult_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_short_mult: returning $et_vect_short_mult_saved" 2
-    return $et_vect_short_mult_saved
+    verbose "check_effective_target_vect_short_mult:\
+	     returning $et_vect_short_mult_saved($et_index)" 2
+    return $et_vect_short_mult_saved($et_index)
 }
 
 # Return 1 if the target supports vector int multiplication, 0 otherwise.
 
 proc check_effective_target_vect_int_mult { } {
     global et_vect_int_mult_saved
+    global et_index
 
-    if [info exists et_vect_int_mult_saved] {
+    if [info exists et_vect_int_mult_saved($et_index)] {
 	verbose "check_effective_target_vect_int_mult: using cached result" 2
     } else {
-	set et_vect_int_mult_saved 0
+	set et_vect_int_mult_saved($et_index) 0
 	if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
 	     || [istarget spu-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget ia64-*-*]
 	     || [istarget aarch64*-*-*]
 	     || [check_effective_target_arm32] } {
-	   set et_vect_int_mult_saved 1
+	   set et_vect_int_mult_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_int_mult: returning $et_vect_int_mult_saved" 2
-    return $et_vect_int_mult_saved
+    verbose "check_effective_target_vect_int_mult:\
+	     returning $et_vect_int_mult_saved($et_index)" 2
+    return $et_vect_int_mult_saved($et_index)
 }
 
 # Return 1 if the target supports vector even/odd elements extraction, 0 otherwise.
 
 proc check_effective_target_vect_extract_even_odd { } {
     global et_vect_extract_even_odd_saved
+    global et_index
     
-    if [info exists et_vect_extract_even_odd_saved] {
-        verbose "check_effective_target_vect_extract_even_odd: using cached result" 2
+    if [info exists et_vect_extract_even_odd_saved($et_index)] {
+	verbose "check_effective_target_vect_extract_even_odd:\
+		 using cached result" 2
     } else {
-        set et_vect_extract_even_odd_saved 0 
+	set et_vect_extract_even_odd_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget powerpc*-*-*]
 	     || [is-effective-target arm_neon_ok]
@@ -5102,24 +5290,26 @@ proc check_effective_target_vect_extract_even_odd { } {
              || [istarget ia64-*-*]
              || [istarget spu-*-*]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mpaired_single]) } {
-	    set et_vect_extract_even_odd_saved 1
+		 && [et-is-effective-target mpaired_single]) } {
+	    set et_vect_extract_even_odd_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_extract_even_odd: returning $et_vect_extract_even_odd_saved" 2
-    return $et_vect_extract_even_odd_saved
+    verbose "check_effective_target_vect_extract_even_odd:\
+	     returning $et_vect_extract_even_odd_saved($et_index)" 2
+    return $et_vect_extract_even_odd_saved($et_index)
 }
 
 # Return 1 if the target supports vector interleaving, 0 otherwise.
 
 proc check_effective_target_vect_interleave { } {
     global et_vect_interleave_saved
+    global et_index
     
-    if [info exists et_vect_interleave_saved] {
+    if [info exists et_vect_interleave_saved($et_index)] {
         verbose "check_effective_target_vect_interleave: using cached result" 2
     } else {
-        set et_vect_interleave_saved 0
+	set et_vect_interleave_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget powerpc*-*-*]
 	     || [is-effective-target arm_neon_ok]
@@ -5127,13 +5317,14 @@ proc check_effective_target_vect_interleave { } {
              || [istarget ia64-*-*]
              || [istarget spu-*-*]
 	     || ([istarget mips*-*-*]
-		 && [check_effective_target_mpaired_single]) } {
-           set et_vect_interleave_saved 1
+		 && [et-is-effective-target mpaired_single]) } {
+	   set et_vect_interleave_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect_interleave: returning $et_vect_interleave_saved" 2
-    return $et_vect_interleave_saved
+    verbose "check_effective_target_vect_interleave:\
+	     returning $et_vect_interleave_saved($et_index)" 2
+    return $et_vect_interleave_saved($et_index)
 }
 
 foreach N {2 3 4 8} {
@@ -5141,24 +5332,27 @@ foreach N {2 3 4 8} {
 	# Return 1 if the target supports 2-vector interleaving
 	proc check_effective_target_vect_stridedN { } {
 	    global et_vect_stridedN_saved
+	    global et_index
 
-	    if [info exists et_vect_stridedN_saved] {
-		verbose "check_effective_target_vect_stridedN: using cached result" 2
+	    if [info exists et_vect_stridedN_saved($et_index)] {
+		verbose "check_effective_target_vect_stridedN:\
+			 using cached result" 2
 	    } else {
-		set et_vect_stridedN_saved 0
+		set et_vect_stridedN_saved($et_index) 0
 		if { (N & -N) == N
 		     && [check_effective_target_vect_interleave]
 		     && [check_effective_target_vect_extract_even_odd] } {
-		    set et_vect_stridedN_saved 1
+		    set et_vect_stridedN_saved($et_index) 1
 		}
 		if { ([istarget arm*-*-*]
 		      || [istarget aarch64*-*-*]) && N >= 2 && N <= 4 } {
-		    set et_vect_stridedN_saved 1
+		    set et_vect_stridedN_saved($et_index) 1
 		}
 	    }
 
-	    verbose "check_effective_target_vect_stridedN: returning $et_vect_stridedN_saved" 2
-	    return $et_vect_stridedN_saved
+	    verbose "check_effective_target_vect_stridedN:\
+		     returning $et_vect_stridedN_saved($et_index)" 2
+	    return $et_vect_stridedN_saved($et_index)
 	}
     }]
 }
@@ -5167,61 +5361,68 @@ foreach N {2 3 4 8} {
 
 proc check_effective_target_vect_multiple_sizes { } {
     global et_vect_multiple_sizes_saved
+    global et_index
 
-    set et_vect_multiple_sizes_saved 0
+    set et_vect_multiple_sizes_saved($et_index) 0
     if { ([istarget aarch64*-*-*]
 	  || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok])) } {
-       set et_vect_multiple_sizes_saved 1
+       set et_vect_multiple_sizes_saved($et_index) 1
     }
     if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
       if { ([check_avx_available] && ![check_prefer_avx128]) } {
-	set et_vect_multiple_sizes_saved 1
+	set et_vect_multiple_sizes_saved($et_index) 1
       }
     }
 
-    verbose "check_effective_target_vect_multiple_sizes: returning $et_vect_multiple_sizes_saved" 2
-    return $et_vect_multiple_sizes_saved
+    verbose "check_effective_target_vect_multiple_sizes:\
+	     returning $et_vect_multiple_sizes_saved($et_index)" 2
+    return $et_vect_multiple_sizes_saved($et_index)
 }
 
 # Return 1 if the target supports vectors of 64 bits.
 
 proc check_effective_target_vect64 { } {
     global et_vect64_saved
+    global et_index
 
-    if [info exists et_vect64_saved] {
+    if [info exists et_vect64_saved($et_index)] {
         verbose "check_effective_target_vect64: using cached result" 2
     } else {
-        set et_vect64_saved 0
+	set et_vect64_saved($et_index) 0
         if { ([istarget arm*-*-*]
 	      && [check_effective_target_arm_neon_ok]
 	      && [check_effective_target_arm_little_endian])
 	     || [istarget aarch64*-*-*]
              || [istarget sparc*-*-*] } {
-           set et_vect64_saved 1
+	   set et_vect64_saved($et_index) 1
         }
     }
 
-    verbose "check_effective_target_vect64: returning $et_vect64_saved" 2
-    return $et_vect64_saved
+    verbose "check_effective_target_vect64:\
+	     returning $et_vect64_saved($et_index)" 2
+    return $et_vect64_saved($et_index)
 }
 
 # Return 1 if the target supports vector copysignf calls.
 
 proc check_effective_target_vect_call_copysignf { } {
     global et_vect_call_copysignf_saved
+    global et_index
 
-    if [info exists et_vect_call_copysignf_saved] {
-	verbose "check_effective_target_vect_call_copysignf: using cached result" 2
+    if [info exists et_vect_call_copysignf_saved($et_index)] {
+	verbose "check_effective_target_vect_call_copysignf:\
+		 using cached result" 2
     } else {
-	set et_vect_call_copysignf_saved 0
+	set et_vect_call_copysignf_saved($et_index) 0
 	if { [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || [istarget powerpc*-*-*] } {
-	   set et_vect_call_copysignf_saved 1
+	   set et_vect_call_copysignf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_copysignf: returning $et_vect_call_copysignf_saved" 2
-    return $et_vect_call_copysignf_saved
+    verbose "check_effective_target_vect_call_copysignf:\
+	     returning $et_vect_call_copysignf_saved($et_index)" 2
+    return $et_vect_call_copysignf_saved($et_index)
 }
 
 # Return 1 if the target supports hardware square root instructions.
@@ -5249,20 +5450,22 @@ proc check_effective_target_sqrt_insn { } {
 
 proc check_effective_target_vect_call_sqrtf { } {
     global et_vect_call_sqrtf_saved
+    global et_index
 
-    if [info exists et_vect_call_sqrtf_saved] {
+    if [info exists et_vect_call_sqrtf_saved($et_index)] {
 	verbose "check_effective_target_vect_call_sqrtf: using cached result" 2
     } else {
-	set et_vect_call_sqrtf_saved 0
+	set et_vect_call_sqrtf_saved($et_index) 0
 	if { [istarget aarch64*-*-*]
 	     || [istarget i?86-*-*] || [istarget x86_64-*-*]
 	     || ([istarget powerpc*-*-*] && [check_vsx_hw_available]) } {
-	    set et_vect_call_sqrtf_saved 1
+	    set et_vect_call_sqrtf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_sqrtf: returning $et_vect_call_sqrtf_saved" 2
-    return $et_vect_call_sqrtf_saved
+    verbose "check_effective_target_vect_call_sqrtf:\
+	     returning $et_vect_call_sqrtf_saved($et_index)" 2
+    return $et_vect_call_sqrtf_saved($et_index)
 }
 
 # Return 1 if the target supports vector lrint calls.
@@ -5282,216 +5485,243 @@ proc check_effective_target_vect_call_lrint { } {
 
 proc check_effective_target_vect_call_btrunc { } {
     global et_vect_call_btrunc_saved
+    global et_index
 
-    if [info exists et_vect_call_btrunc_saved] {
-	verbose "check_effective_target_vect_call_btrunc: using cached result" 2
+    if [info exists et_vect_call_btrunc_saved($et_index)] {
+	verbose "check_effective_target_vect_call_btrunc:\
+		 using cached result" 2
     } else {
-	set et_vect_call_btrunc_saved 0
+	set et_vect_call_btrunc_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_btrunc_saved 1
+	  set et_vect_call_btrunc_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_btrunc: returning $et_vect_call_btrunc_saved" 2
-    return $et_vect_call_btrunc_saved
+    verbose "check_effective_target_vect_call_btrunc:\
+	     returning $et_vect_call_btrunc_saved($et_index)" 2
+    return $et_vect_call_btrunc_saved($et_index)
 }
 
 # Return 1 if the target supports vector btruncf calls.
 
 proc check_effective_target_vect_call_btruncf { } {
     global et_vect_call_btruncf_saved
+    global et_index
 
-    if [info exists et_vect_call_btruncf_saved] {
-	verbose "check_effective_target_vect_call_btruncf: using cached result" 2
+    if [info exists et_vect_call_btruncf_saved($et_index)] {
+	verbose "check_effective_target_vect_call_btruncf:\
+		 using cached result" 2
     } else {
-	set et_vect_call_btruncf_saved 0
+	set et_vect_call_btruncf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_btruncf_saved 1
+	  set et_vect_call_btruncf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_btruncf: returning $et_vect_call_btruncf_saved" 2
-    return $et_vect_call_btruncf_saved
+    verbose "check_effective_target_vect_call_btruncf:\
+	     returning $et_vect_call_btruncf_saved($et_index)" 2
+    return $et_vect_call_btruncf_saved($et_index)
 }
 
 # Return 1 if the target supports vector ceil calls.
 
 proc check_effective_target_vect_call_ceil { } {
     global et_vect_call_ceil_saved
+    global et_index
 
-    if [info exists et_vect_call_ceil_saved] {
+    if [info exists et_vect_call_ceil_saved($et_index)] {
 	verbose "check_effective_target_vect_call_ceil: using cached result" 2
     } else {
-	set et_vect_call_ceil_saved 0
+	set et_vect_call_ceil_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_ceil_saved 1
+	  set et_vect_call_ceil_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_ceil: returning $et_vect_call_ceil_saved" 2
-    return $et_vect_call_ceil_saved
+    verbose "check_effective_target_vect_call_ceil:\
+	     returning $et_vect_call_ceil_saved($et_index)" 2
+    return $et_vect_call_ceil_saved($et_index)
 }
 
 # Return 1 if the target supports vector ceilf calls.
 
 proc check_effective_target_vect_call_ceilf { } {
     global et_vect_call_ceilf_saved
+    global et_index
 
-    if [info exists et_vect_call_ceilf_saved] {
+    if [info exists et_vect_call_ceilf_saved($et_index)] {
 	verbose "check_effective_target_vect_call_ceilf: using cached result" 2
     } else {
-	set et_vect_call_ceilf_saved 0
+	set et_vect_call_ceilf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_ceilf_saved 1
+	  set et_vect_call_ceilf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_ceilf: returning $et_vect_call_ceilf_saved" 2
-    return $et_vect_call_ceilf_saved
+    verbose "check_effective_target_vect_call_ceilf:\
+	     returning $et_vect_call_ceilf_saved($et_index)" 2
+    return $et_vect_call_ceilf_saved($et_index)
 }
 
 # Return 1 if the target supports vector floor calls.
 
 proc check_effective_target_vect_call_floor { } {
     global et_vect_call_floor_saved
+    global et_index
 
-    if [info exists et_vect_call_floor_saved] {
+    if [info exists et_vect_call_floor_saved($et_index)] {
 	verbose "check_effective_target_vect_call_floor: using cached result" 2
     } else {
-	set et_vect_call_floor_saved 0
+	set et_vect_call_floor_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_floor_saved 1
+	  set et_vect_call_floor_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_floor: returning $et_vect_call_floor_saved" 2
-    return $et_vect_call_floor_saved
+    verbose "check_effective_target_vect_call_floor:\
+	     returning $et_vect_call_floor_saved($et_index)" 2
+    return $et_vect_call_floor_saved($et_index)
 }
 
 # Return 1 if the target supports vector floorf calls.
 
 proc check_effective_target_vect_call_floorf { } {
     global et_vect_call_floorf_saved
+    global et_index
 
-    if [info exists et_vect_call_floorf_saved] {
+    if [info exists et_vect_call_floorf_saved($et_index)] {
 	verbose "check_effective_target_vect_call_floorf: using cached result" 2
     } else {
-	set et_vect_call_floorf_saved 0
+	set et_vect_call_floorf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_floorf_saved 1
+	  set et_vect_call_floorf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_floorf: returning $et_vect_call_floorf_saved" 2
-    return $et_vect_call_floorf_saved
+    verbose "check_effective_target_vect_call_floorf:\
+	     returning $et_vect_call_floorf_saved($et_index)" 2
+    return $et_vect_call_floorf_saved($et_index)
 }
 
 # Return 1 if the target supports vector lceil calls.
 
 proc check_effective_target_vect_call_lceil { } {
     global et_vect_call_lceil_saved
+    global et_index
 
-    if [info exists et_vect_call_lceil_saved] {
+    if [info exists et_vect_call_lceil_saved($et_index)] {
 	verbose "check_effective_target_vect_call_lceil: using cached result" 2
     } else {
-	set et_vect_call_lceil_saved 0
+	set et_vect_call_lceil_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_lceil_saved 1
+	  set et_vect_call_lceil_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_lceil: returning $et_vect_call_lceil_saved" 2
-    return $et_vect_call_lceil_saved
+    verbose "check_effective_target_vect_call_lceil:\
+	     returning $et_vect_call_lceil_saved($et_index)" 2
+    return $et_vect_call_lceil_saved($et_index)
 }
 
 # Return 1 if the target supports vector lfloor calls.
 
 proc check_effective_target_vect_call_lfloor { } {
     global et_vect_call_lfloor_saved
+    global et_index
 
-    if [info exists et_vect_call_lfloor_saved] {
+    if [info exists et_vect_call_lfloor_saved($et_index)] {
 	verbose "check_effective_target_vect_call_lfloor: using cached result" 2
     } else {
-	set et_vect_call_lfloor_saved 0
+	set et_vect_call_lfloor_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_lfloor_saved 1
+	  set et_vect_call_lfloor_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_lfloor: returning $et_vect_call_lfloor_saved" 2
-    return $et_vect_call_lfloor_saved
+    verbose "check_effective_target_vect_call_lfloor:\
+	     returning $et_vect_call_lfloor_saved($et_index)" 2
+    return $et_vect_call_lfloor_saved($et_index)
 }
 
 # Return 1 if the target supports vector nearbyint calls.
 
 proc check_effective_target_vect_call_nearbyint { } {
     global et_vect_call_nearbyint_saved
+    global et_index
 
-    if [info exists et_vect_call_nearbyint_saved] {
+    if [info exists et_vect_call_nearbyint_saved($et_index)] {
 	verbose "check_effective_target_vect_call_nearbyint: using cached result" 2
     } else {
-	set et_vect_call_nearbyint_saved 0
+	set et_vect_call_nearbyint_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_nearbyint_saved 1
+	  set et_vect_call_nearbyint_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_nearbyint: returning $et_vect_call_nearbyint_saved" 2
-    return $et_vect_call_nearbyint_saved
+    verbose "check_effective_target_vect_call_nearbyint:\
+	     returning $et_vect_call_nearbyint_saved($et_index)" 2
+    return $et_vect_call_nearbyint_saved($et_index)
 }
 
 # Return 1 if the target supports vector nearbyintf calls.
 
 proc check_effective_target_vect_call_nearbyintf { } {
     global et_vect_call_nearbyintf_saved
+    global et_index
 
-    if [info exists et_vect_call_nearbyintf_saved] {
-	verbose "check_effective_target_vect_call_nearbyintf: using cached result" 2
+    if [info exists et_vect_call_nearbyintf_saved($et_index)] {
+	verbose "check_effective_target_vect_call_nearbyintf:\
+		 using cached result" 2
     } else {
-	set et_vect_call_nearbyintf_saved 0
+	set et_vect_call_nearbyintf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_nearbyintf_saved 1
+	  set et_vect_call_nearbyintf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_nearbyintf: returning $et_vect_call_nearbyintf_saved" 2
-    return $et_vect_call_nearbyintf_saved
+    verbose "check_effective_target_vect_call_nearbyintf:\
+	     returning $et_vect_call_nearbyintf_saved($et_index)" 2
+    return $et_vect_call_nearbyintf_saved($et_index)
 }
 
 # Return 1 if the target supports vector round calls.
 
 proc check_effective_target_vect_call_round { } {
     global et_vect_call_round_saved
+    global et_index
 
-    if [info exists et_vect_call_round_saved] {
+    if [info exists et_vect_call_round_saved($et_index)] {
 	verbose "check_effective_target_vect_call_round: using cached result" 2
     } else {
-	set et_vect_call_round_saved 0
+	set et_vect_call_round_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_round_saved 1
+	  set et_vect_call_round_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_round: returning $et_vect_call_round_saved" 2
-    return $et_vect_call_round_saved
+    verbose "check_effective_target_vect_call_round:\
+	     returning $et_vect_call_round_saved($et_index)" 2
+    return $et_vect_call_round_saved($et_index)
 }
 
 # Return 1 if the target supports vector roundf calls.
 
 proc check_effective_target_vect_call_roundf { } {
     global et_vect_call_roundf_saved
+    global et_index
 
-    if [info exists et_vect_call_roundf_saved] {
+    if [info exists et_vect_call_roundf_saved($et_index)] {
 	verbose "check_effective_target_vect_call_roundf: using cached result" 2
     } else {
-	set et_vect_call_roundf_saved 0
+	set et_vect_call_roundf_saved($et_index) 0
 	if { [istarget aarch64*-*-*] } {
-	  set et_vect_call_roundf_saved 1
+	  set et_vect_call_roundf_saved($et_index) 1
 	}
     }
 
-    verbose "check_effective_target_vect_call_roundf: returning $et_vect_call_roundf_saved" 2
-    return $et_vect_call_roundf_saved
+    verbose "check_effective_target_vect_call_roundf:\
+	     returning $et_vect_call_roundf_saved($et_index)" 2
+    return $et_vect_call_roundf_saved($et_index)
 }
 
 # Return 1 if the target supports section-anchors
@@ -5884,7 +6114,13 @@ proc check_effective_target_init_priority {} {
 # arguments with keywords that pass particular arguments.
 
 proc is-effective-target { arg } {
+    global et_index
     set selected 0
+    if { ![info exists et_index] } {
+	# Initialize the effective target index that is used in some
+	# check_effective_target_* procs.
+	set et_index 0
+    }
     if { [info procs check_effective_target_${arg}] != [list] } {
 	set selected [check_effective_target_${arg}]
     } else {
@@ -5935,6 +6171,50 @@ proc is-effective-target-keyword { arg } {
     }
 }
 
+# Execute tests for all targets in EFFECTIVE_TARGETS list.  Set et_index to
+# indicate what target is currently being processed.  This is for
+# the vectorizer tests, e.g. vect_int, to keep track what target supports
+# a given feature.
+
+proc et-dg-runtest { runtest testcases flags default-extra-flags } {
+    global dg-do-what-default
+    global EFFECTIVE_TARGETS
+    global et_index
+
+    if { [llength $EFFECTIVE_TARGETS] > 0 } {
+	foreach target $EFFECTIVE_TARGETS {
+	    set target_flags $flags
+	    set dg-do-what-default compile
+	    set et_index [lsearch -exact $EFFECTIVE_TARGETS $target]
+	    if { [info procs add_options_for_${target}] != [list] } {
+		set target_flags [add_options_for_${target} "$flags"]
+	    }
+	    if { [info procs check_effective_target_${target}_runtime]
+		 != [list] && [check_effective_target_${target}_runtime] } {
+		set dg-do-what-default run
+	    }
+	    $runtest $testcases $target_flags ${default-extra-flags}
+	}
+    } else {
+	set et_index 0
+	$runtest $testcases $flags ${default-extra-flags}
+    }
+}
+
+# Return 1 if a target matches the target in EFFECTIVE_TARGETS at index
+# et_index, 0 otherwise.
+
+proc et-is-effective-target { target } {
+    global EFFECTIVE_TARGETS
+    global et_index
+
+    if { [llength $EFFECTIVE_TARGETS] > $et_index
+	 && [lindex $EFFECTIVE_TARGETS $et_index] == $target } {
+	    return 1
+    }
+    return 0
+}
+
 # Return 1 if target default to short enums
 
 proc check_effective_target_short_enums { } {
@@ -6621,13 +6901,19 @@ proc check_effective_target_stpcpy {} {
 
 # Check whether the vectorizer tests are supported by the target and
 # append additional target-dependent compile flags to DEFAULT_VECTCFLAGS.
+# If a port wants to execute the tests more than once it should append
+# the supported target to EFFECTIVE_TARGETS instead, and the compile flags
+# will be added by a call to add_options_for_<target>.
 # Set dg-do-what-default to either compile or run, depending on target
-# capabilities.  Return 1 if vectorizer tests are supported by
-# target, 0 otherwise.
+# capabilities.  Do not set this if the supported target is appended to
+# EFFECTIVE_TARGETS.  Flags and this variable will be set by et-dg-runtest
+# automatically.  Return the number of effective targets if vectorizer tests
+# are supported, 0 otherwise.
 
 proc check_vect_support_and_set_flags { } {
     global DEFAULT_VECTCFLAGS
     global dg-do-what-default
+    global EFFECTIVE_TARGETS
 
     if  [istarget powerpc-*paired*]  {
         lappend DEFAULT_VECTCFLAGS "-mpaired"
@@ -6670,13 +6956,14 @@ 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"
+	       && [check_effective_target_nomips16] } {
+	if { [check_effective_target_mpaired_single] } {
+	    lappend EFFECTIVE_TARGETS mpaired_single
+	}
+	if { [check_effective_target_mips_loongson] } {
+	    lappend EFFECTIVE_TARGETS mips_loongson
         }
-        set dg-do-what-default run
+	return [llength $EFFECTIVE_TARGETS]
     } elseif [istarget sparc*-*-*] {
         lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis"
         if [check_effective_target_ultrasparc_hw] {
-- 
2.4.5


^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2016-05-05 15:14 ` Robert Suchanek
@ 2016-05-06 11:21   ` Matthew Fortune
  2016-06-29  7:49   ` Matthew Fortune
  2016-06-30 14:50   ` Mike Stump
  2 siblings, 0 replies; 17+ messages in thread
From: Matthew Fortune @ 2016-05-06 11:21 UTC (permalink / raw)
  To: gcc-patches; +Cc: Robert Suchanek, Catherine_Moore

Robert Suchanek <Robert.Suchanek@imgtec.com> writes:
> I'm resending this patch as it has been rebased and updated.  I reverted
> a change to check_effective_target_vect_call_lrint procedure because it
> does not use cached result.

Conceptually I think this is a good idea and to the extent that I can
follow TCL code it looks OK. I can't approve this though so need a global
reviewer to comment.

Thanks,
Matthew

> 
> Regards,
> Robert
> 
> > -----Original Message-----
> > From: gcc-patches-owner@gcc.gnu.org
> > [mailto:gcc-patches-owner@gcc.gnu.org] On Behalf Of Robert Suchanek
> > Sent: 10 August 2015 13:15
> > To: Catherine_Moore@mentor.com; Matthew Fortune
> > Cc: gcc-patches@gcc.gnu.org
> > Subject: [PATCH 3/4] Add support to run auto-vectorization tests for
> > multiple effective targets
> >
> > Hi,
> >
> > This patch allows to run auto-vectorization tests for more than one
> > effective target.  The initial proposal
> >
> > https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02289.html
> >
> > had some issues that have been addressed and should work as expected
> now.
> >
> > The idea was to add a wrapper procedure that would:
> > 1. Iterative over a list of EFFECTIVE_TARGETS e.g. mips_msa,
> mpaired_single.
> > 2. Add necessary compile time options for each effective target.
> > 3. Check if it's possible to compile and/or run on a target, and set
> >    dg-do-what-default accordingly.
> > 4. Set the target index to tell check_effective_target_vect_* which
> target is
> >    currently being processed.
> > 5. Invoke {gfortran-,g++-,}dg-runtest with the list of vector tests as
> normal.
> >
> > The above required that every vector feature e.g. vect_int that caches
> > the result is capable of tracking what target supports a feature.  The
> > result is saved to a list at an index controlled by the wrapper
> > (et-dg-runtest).  Ports not using this feature, set DEFAULT_VECTFLAGS
> > and the tests should run as they used to.
> >
> > The patch was additionally tested on x86_64-unknown-linux-gnu and
> > aarch64- linux-gnu.
> >
> > Regards,
> > Robert
> >
> > gcc/testsuite/ChangeLog:
> >
> > 	* g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS.
> Call
> > 	g++-dg-runtest via et-dg-runtest.
> > 	* gcc.dg/graphite/graphite.exp: Likewise, but for 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_effective_target_mpaired_single_runtime): Likewise.
> > 	(check_effective_target_mips_loongson_runtime): Likewise.
> > 	(add_options_for_mpaired_single): Likewise.
> > 	(check_effective_target_vect_int): Add global et_index.
> > 	Check and save the supported feature for a target selected by
> > 	the et_index target.  Break long lines where appropriate.  Call
> > 	et-is-effective-target for MIPS with an argument instead of
> > 	check_effective_target_* where appropriate.
> > 	(check_effective_target_vect_intfloat_cvt): Likewise.
> > 	(check_effective_target_vect_uintfloat_cvt): Likewise.
> > 	(check_effective_target_vect_floatint_cvt): Likewise.
> > 	(check_effective_target_vect_floatuint_cvt): Likewise.
> > 	(check_effective_target_vect_simd_clones): Likewise.
> > 	(check_effective_target_vect_shift): ewise.
> > 	(check_effective_target_whole_vector_shift): Likewise.
> > 	(check_effective_target_vect_bswap): Likewise.
> > 	(check_effective_target_vect_shift_char): Likewise.
> > 	(check_effective_target_vect_long): Likewise.
> > 	(check_effective_target_vect_float): Likewise.
> > 	(check_effective_target_vect_double): Likewise.
> > 	(check_effective_target_vect_long_long): Likewise.
> > 	(check_effective_target_vect_no_int_max): Likewise.
> > 	(check_effective_target_vect_no_int_add): Likewise.
> > 	(check_effective_target_vect_no_bitwise): Likewise.
> > 	(check_effective_target_vect_widen_shift): Likewise.
> > 	(check_effective_target_vect_no_align): Likewise.
> > 	(check_effective_target_vect_hw_misalign): Likewise.
> > 	(check_effective_target_vect_element_align): Likewise.
> > 	(check_effective_target_vect_condition): Likewise.
> > 	(check_effective_target_vect_cond_mixed): Likewise.
> > 	(check_effective_target_vect_char_mult): Likewise.
> > 	(check_effective_target_vect_short_mult): Likewise.
> > 	(check_effective_target_vect_int_mult): Likewise.
> > 	(check_effective_target_vect_extract_even_odd): Likewise.
> > 	(check_effective_target_vect_interleave): Likewise.
> > 	(check_effective_target_vect_stridedN): Likewise.
> > 	(check_effective_target_vect_multiple_sizes): Likewise.
> > 	(check_effective_target_vect64): Likewise.
> > 	(check_effective_target_vect_call_copysignf): Likewise.
> > 	(check_effective_target_vect_call_sqrtf): Likewise.
> > 	(check_effective_target_vect_call_lrint): Likewise.
> > 	(check_effective_target_vect_call_btrunc): Likewise.
> > 	(check_effective_target_vect_call_btruncf): Likewise.
> > 	(check_effective_target_vect_call_ceil): Likewise.
> > 	(check_effective_target_vect_call_ceilf): Likewise.
> > 	(check_effective_target_vect_call_floor): Likewise.
> > 	(check_effective_target_vect_call_floorf): Likewise.
> > 	(check_effective_target_vect_call_lceil): Likewise.
> > 	(check_effective_target_vect_call_lfloor): Likewise.
> > 	(check_effective_target_vect_call_nearbyint): Likewise.
> > 	(check_effective_target_vect_call_nearbyintf): Likewise.
> > 	(check_effective_target_vect_call_round): Likewise.
> > 	(check_effective_target_vect_call_roundf): Likewise.
> > 	(check_effective_target_vect_perm): Likewise, but also append
> *_saved
> > 	to the existing global name to properly cache the result.
> > 	(check_effective_target_vect_perm_byte): Likewise.
> > 	(check_effective_target_vect_perm_short): Likewise.
> > 	(check_effective_target_vect_widen_sum_hi_to_si_pattern): Likewise.
> > 	(check_effective_target_vect_widen_sum_hi_to_si): Likewise.
> > 	(check_effective_target_vect_widen_sum_qi_to_hi): Likewise.
> > 	(check_effective_target_vect_widen_sum_qi_to_si): Likewise.
> > 	(check_effective_target_vect_widen_mult_qi_to_hi_pattern):
> Likewise.
> > 	(check_effective_target_vect_widen_mult_qi_to_hi): Likewise.
> > 	(check_effective_target_vect_widen_mult_hi_to_si_pattern):
> Likewise.
> > 	(check_effective_target_vect_widen_mult_si_to_di_pattern):
> Likewise.
> > 	(check_effective_target_vect_sdot_qi): Likewise.
> > 	(check_effective_target_vect_udot_qi): Likewise.
> > 	(check_effective_target_vect_sdot_hi): Likewise.
> > 	(check_effective_target_vect_udot_hi): Likewise.
> > 	(check_effective_target_vect_usad_char): Likewise.
> > 	(check_effective_target_vect_pack_trunc): Likewise.
> > 	(check_effective_target_vect_unpack): Likewise.
> > 	(check_effective_target_vect_aligned_arrays): Likewise.
> > 	(check_effective_target_vect_natural_alignment): Likewise.
> > 	(check_effective_target_vector_alignment_reachable): Likewise.
> > 	(check_effective_target_vector_alignment_reachable_for_64bit):
> Likewise.
> > 	(is-effective-target): Initialize et_index if undefined.
> > 	(et-dg-runtest): New.
> > 	(et-is-effective-target): Likewise.
> > 	(check_vect_support_and_set_flags): Add supported MIPS targets to
> > 	EFFECTIVE_TARGETS list.  Return the number of supported targets.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2016-05-05 15:14 ` Robert Suchanek
  2016-05-06 11:21   ` Matthew Fortune
@ 2016-06-29  7:49   ` Matthew Fortune
  2016-06-29  8:16     ` Richard Biener
  2016-06-30 14:50   ` Mike Stump
  2 siblings, 1 reply; 17+ messages in thread
From: Matthew Fortune @ 2016-06-29  7:49 UTC (permalink / raw)
  To: Richard Biener (rguenther@suse.de)
  Cc: gcc-patches, Robert Suchanek, Catherine_Moore

Robert Suchanek <Robert.Suchanek@imgtec.com> writes:
> I'm resending this patch as it has been rebased and updated.  I reverted a change
> to check_effective_target_vect_call_lrint procedure because it does not use
> cached result.

Hi Richard,

Do you know who might be best to ask for a review for this vect.exp testsuite
change? 

Thanks,
Matthew

> 
> Regards,
> Robert
> 
> > -----Original Message-----
> > From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-owner@gcc.gnu.org] On
> > Behalf Of Robert Suchanek
> > Sent: 10 August 2015 13:15
> > To: Catherine_Moore@mentor.com; Matthew Fortune
> > Cc: gcc-patches@gcc.gnu.org
> > Subject: [PATCH 3/4] Add support to run auto-vectorization tests for multiple
> > effective targets
> >
> > Hi,
> >
> > This patch allows to run auto-vectorization tests for more than one effective
> > target.  The initial proposal
> >
> > https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02289.html
> >
> > had some issues that have been addressed and should work as expected now.
> >
> > The idea was to add a wrapper procedure that would:
> > 1. Iterative over a list of EFFECTIVE_TARGETS e.g. mips_msa, mpaired_single.
> > 2. Add necessary compile time options for each effective target.
> > 3. Check if it's possible to compile and/or run on a target, and set
> >    dg-do-what-default accordingly.
> > 4. Set the target index to tell check_effective_target_vect_* which target is
> >    currently being processed.
> > 5. Invoke {gfortran-,g++-,}dg-runtest with the list of vector tests as normal.
> >
> > The above required that every vector feature e.g. vect_int that caches the
> > result is
> > capable of tracking what target supports a feature.  The result is saved to a
> > list
> > at an index controlled by the wrapper (et-dg-runtest).  Ports not using this
> > feature,
> > set DEFAULT_VECTFLAGS and the tests should run as they used to.
> >
> > The patch was additionally tested on x86_64-unknown-linux-gnu and aarch64-
> > linux-gnu.
> >
> > Regards,
> > Robert
> >
> > gcc/testsuite/ChangeLog:
> >
> > 	* g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS. Call
> > 	g++-dg-runtest via et-dg-runtest.
> > 	* gcc.dg/graphite/graphite.exp: Likewise, but for 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_effective_target_mpaired_single_runtime): Likewise.
> > 	(check_effective_target_mips_loongson_runtime): Likewise.
> > 	(add_options_for_mpaired_single): Likewise.
> > 	(check_effective_target_vect_int): Add global et_index.
> > 	Check and save the supported feature for a target selected by
> > 	the et_index target.  Break long lines where appropriate.  Call
> > 	et-is-effective-target for MIPS with an argument instead of
> > 	check_effective_target_* where appropriate.
> > 	(check_effective_target_vect_intfloat_cvt): Likewise.
> > 	(check_effective_target_vect_uintfloat_cvt): Likewise.
> > 	(check_effective_target_vect_floatint_cvt): Likewise.
> > 	(check_effective_target_vect_floatuint_cvt): Likewise.
> > 	(check_effective_target_vect_simd_clones): Likewise.
> > 	(check_effective_target_vect_shift): ewise.
> > 	(check_effective_target_whole_vector_shift): Likewise.
> > 	(check_effective_target_vect_bswap): Likewise.
> > 	(check_effective_target_vect_shift_char): Likewise.
> > 	(check_effective_target_vect_long): Likewise.
> > 	(check_effective_target_vect_float): Likewise.
> > 	(check_effective_target_vect_double): Likewise.
> > 	(check_effective_target_vect_long_long): Likewise.
> > 	(check_effective_target_vect_no_int_max): Likewise.
> > 	(check_effective_target_vect_no_int_add): Likewise.
> > 	(check_effective_target_vect_no_bitwise): Likewise.
> > 	(check_effective_target_vect_widen_shift): Likewise.
> > 	(check_effective_target_vect_no_align): Likewise.
> > 	(check_effective_target_vect_hw_misalign): Likewise.
> > 	(check_effective_target_vect_element_align): Likewise.
> > 	(check_effective_target_vect_condition): Likewise.
> > 	(check_effective_target_vect_cond_mixed): Likewise.
> > 	(check_effective_target_vect_char_mult): Likewise.
> > 	(check_effective_target_vect_short_mult): Likewise.
> > 	(check_effective_target_vect_int_mult): Likewise.
> > 	(check_effective_target_vect_extract_even_odd): Likewise.
> > 	(check_effective_target_vect_interleave): Likewise.
> > 	(check_effective_target_vect_stridedN): Likewise.
> > 	(check_effective_target_vect_multiple_sizes): Likewise.
> > 	(check_effective_target_vect64): Likewise.
> > 	(check_effective_target_vect_call_copysignf): Likewise.
> > 	(check_effective_target_vect_call_sqrtf): Likewise.
> > 	(check_effective_target_vect_call_lrint): Likewise.
> > 	(check_effective_target_vect_call_btrunc): Likewise.
> > 	(check_effective_target_vect_call_btruncf): Likewise.
> > 	(check_effective_target_vect_call_ceil): Likewise.
> > 	(check_effective_target_vect_call_ceilf): Likewise.
> > 	(check_effective_target_vect_call_floor): Likewise.
> > 	(check_effective_target_vect_call_floorf): Likewise.
> > 	(check_effective_target_vect_call_lceil): Likewise.
> > 	(check_effective_target_vect_call_lfloor): Likewise.
> > 	(check_effective_target_vect_call_nearbyint): Likewise.
> > 	(check_effective_target_vect_call_nearbyintf): Likewise.
> > 	(check_effective_target_vect_call_round): Likewise.
> > 	(check_effective_target_vect_call_roundf): Likewise.
> > 	(check_effective_target_vect_perm): Likewise, but also append *_saved
> > 	to the existing global name to properly cache the result.
> > 	(check_effective_target_vect_perm_byte): Likewise.
> > 	(check_effective_target_vect_perm_short): Likewise.
> > 	(check_effective_target_vect_widen_sum_hi_to_si_pattern): Likewise.
> > 	(check_effective_target_vect_widen_sum_hi_to_si): Likewise.
> > 	(check_effective_target_vect_widen_sum_qi_to_hi): Likewise.
> > 	(check_effective_target_vect_widen_sum_qi_to_si): Likewise.
> > 	(check_effective_target_vect_widen_mult_qi_to_hi_pattern): Likewise.
> > 	(check_effective_target_vect_widen_mult_qi_to_hi): Likewise.
> > 	(check_effective_target_vect_widen_mult_hi_to_si_pattern): Likewise.
> > 	(check_effective_target_vect_widen_mult_si_to_di_pattern): Likewise.
> > 	(check_effective_target_vect_sdot_qi): Likewise.
> > 	(check_effective_target_vect_udot_qi): Likewise.
> > 	(check_effective_target_vect_sdot_hi): Likewise.
> > 	(check_effective_target_vect_udot_hi): Likewise.
> > 	(check_effective_target_vect_usad_char): Likewise.
> > 	(check_effective_target_vect_pack_trunc): Likewise.
> > 	(check_effective_target_vect_unpack): Likewise.
> > 	(check_effective_target_vect_aligned_arrays): Likewise.
> > 	(check_effective_target_vect_natural_alignment): Likewise.
> > 	(check_effective_target_vector_alignment_reachable): Likewise.
> > 	(check_effective_target_vector_alignment_reachable_for_64bit): Likewise.
> > 	(is-effective-target): Initialize et_index if undefined.
> > 	(et-dg-runtest): New.
> > 	(et-is-effective-target): Likewise.
> > 	(check_vect_support_and_set_flags): Add supported MIPS targets to
> > 	EFFECTIVE_TARGETS list.  Return the number of supported targets.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2016-06-29  7:49   ` Matthew Fortune
@ 2016-06-29  8:16     ` Richard Biener
  0 siblings, 0 replies; 17+ messages in thread
From: Richard Biener @ 2016-06-29  8:16 UTC (permalink / raw)
  To: Matthew Fortune; +Cc: gcc-patches, Robert Suchanek, Catherine_Moore

On Wed, 29 Jun 2016, Matthew Fortune wrote:

> Robert Suchanek <Robert.Suchanek@imgtec.com> writes:
> > I'm resending this patch as it has been rebased and updated.  I reverted a change
> > to check_effective_target_vect_call_lrint procedure because it does not use
> > cached result.
> 
> Hi Richard,
> 
> Do you know who might be best to ask for a review for this vect.exp testsuite
> change? 

Mike may be - you need a TCL speaking reviewer ;)

Richard.

> Thanks,
> Matthew
> 
> > 
> > Regards,
> > Robert
> > 
> > > -----Original Message-----
> > > From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-owner@gcc.gnu.org] On
> > > Behalf Of Robert Suchanek
> > > Sent: 10 August 2015 13:15
> > > To: Catherine_Moore@mentor.com; Matthew Fortune
> > > Cc: gcc-patches@gcc.gnu.org
> > > Subject: [PATCH 3/4] Add support to run auto-vectorization tests for multiple
> > > effective targets
> > >
> > > Hi,
> > >
> > > This patch allows to run auto-vectorization tests for more than one effective
> > > target.  The initial proposal
> > >
> > > https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02289.html
> > >
> > > had some issues that have been addressed and should work as expected now.
> > >
> > > The idea was to add a wrapper procedure that would:
> > > 1. Iterative over a list of EFFECTIVE_TARGETS e.g. mips_msa, mpaired_single.
> > > 2. Add necessary compile time options for each effective target.
> > > 3. Check if it's possible to compile and/or run on a target, and set
> > >    dg-do-what-default accordingly.
> > > 4. Set the target index to tell check_effective_target_vect_* which target is
> > >    currently being processed.
> > > 5. Invoke {gfortran-,g++-,}dg-runtest with the list of vector tests as normal.
> > >
> > > The above required that every vector feature e.g. vect_int that caches the
> > > result is
> > > capable of tracking what target supports a feature.  The result is saved to a
> > > list
> > > at an index controlled by the wrapper (et-dg-runtest).  Ports not using this
> > > feature,
> > > set DEFAULT_VECTFLAGS and the tests should run as they used to.
> > >
> > > The patch was additionally tested on x86_64-unknown-linux-gnu and aarch64-
> > > linux-gnu.
> > >
> > > Regards,
> > > Robert
> > >
> > > gcc/testsuite/ChangeLog:
> > >
> > > 	* g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS. Call
> > > 	g++-dg-runtest via et-dg-runtest.
> > > 	* gcc.dg/graphite/graphite.exp: Likewise, but for 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_effective_target_mpaired_single_runtime): Likewise.
> > > 	(check_effective_target_mips_loongson_runtime): Likewise.
> > > 	(add_options_for_mpaired_single): Likewise.
> > > 	(check_effective_target_vect_int): Add global et_index.
> > > 	Check and save the supported feature for a target selected by
> > > 	the et_index target.  Break long lines where appropriate.  Call
> > > 	et-is-effective-target for MIPS with an argument instead of
> > > 	check_effective_target_* where appropriate.
> > > 	(check_effective_target_vect_intfloat_cvt): Likewise.
> > > 	(check_effective_target_vect_uintfloat_cvt): Likewise.
> > > 	(check_effective_target_vect_floatint_cvt): Likewise.
> > > 	(check_effective_target_vect_floatuint_cvt): Likewise.
> > > 	(check_effective_target_vect_simd_clones): Likewise.
> > > 	(check_effective_target_vect_shift): ewise.
> > > 	(check_effective_target_whole_vector_shift): Likewise.
> > > 	(check_effective_target_vect_bswap): Likewise.
> > > 	(check_effective_target_vect_shift_char): Likewise.
> > > 	(check_effective_target_vect_long): Likewise.
> > > 	(check_effective_target_vect_float): Likewise.
> > > 	(check_effective_target_vect_double): Likewise.
> > > 	(check_effective_target_vect_long_long): Likewise.
> > > 	(check_effective_target_vect_no_int_max): Likewise.
> > > 	(check_effective_target_vect_no_int_add): Likewise.
> > > 	(check_effective_target_vect_no_bitwise): Likewise.
> > > 	(check_effective_target_vect_widen_shift): Likewise.
> > > 	(check_effective_target_vect_no_align): Likewise.
> > > 	(check_effective_target_vect_hw_misalign): Likewise.
> > > 	(check_effective_target_vect_element_align): Likewise.
> > > 	(check_effective_target_vect_condition): Likewise.
> > > 	(check_effective_target_vect_cond_mixed): Likewise.
> > > 	(check_effective_target_vect_char_mult): Likewise.
> > > 	(check_effective_target_vect_short_mult): Likewise.
> > > 	(check_effective_target_vect_int_mult): Likewise.
> > > 	(check_effective_target_vect_extract_even_odd): Likewise.
> > > 	(check_effective_target_vect_interleave): Likewise.
> > > 	(check_effective_target_vect_stridedN): Likewise.
> > > 	(check_effective_target_vect_multiple_sizes): Likewise.
> > > 	(check_effective_target_vect64): Likewise.
> > > 	(check_effective_target_vect_call_copysignf): Likewise.
> > > 	(check_effective_target_vect_call_sqrtf): Likewise.
> > > 	(check_effective_target_vect_call_lrint): Likewise.
> > > 	(check_effective_target_vect_call_btrunc): Likewise.
> > > 	(check_effective_target_vect_call_btruncf): Likewise.
> > > 	(check_effective_target_vect_call_ceil): Likewise.
> > > 	(check_effective_target_vect_call_ceilf): Likewise.
> > > 	(check_effective_target_vect_call_floor): Likewise.
> > > 	(check_effective_target_vect_call_floorf): Likewise.
> > > 	(check_effective_target_vect_call_lceil): Likewise.
> > > 	(check_effective_target_vect_call_lfloor): Likewise.
> > > 	(check_effective_target_vect_call_nearbyint): Likewise.
> > > 	(check_effective_target_vect_call_nearbyintf): Likewise.
> > > 	(check_effective_target_vect_call_round): Likewise.
> > > 	(check_effective_target_vect_call_roundf): Likewise.
> > > 	(check_effective_target_vect_perm): Likewise, but also append *_saved
> > > 	to the existing global name to properly cache the result.
> > > 	(check_effective_target_vect_perm_byte): Likewise.
> > > 	(check_effective_target_vect_perm_short): Likewise.
> > > 	(check_effective_target_vect_widen_sum_hi_to_si_pattern): Likewise.
> > > 	(check_effective_target_vect_widen_sum_hi_to_si): Likewise.
> > > 	(check_effective_target_vect_widen_sum_qi_to_hi): Likewise.
> > > 	(check_effective_target_vect_widen_sum_qi_to_si): Likewise.
> > > 	(check_effective_target_vect_widen_mult_qi_to_hi_pattern): Likewise.
> > > 	(check_effective_target_vect_widen_mult_qi_to_hi): Likewise.
> > > 	(check_effective_target_vect_widen_mult_hi_to_si_pattern): Likewise.
> > > 	(check_effective_target_vect_widen_mult_si_to_di_pattern): Likewise.
> > > 	(check_effective_target_vect_sdot_qi): Likewise.
> > > 	(check_effective_target_vect_udot_qi): Likewise.
> > > 	(check_effective_target_vect_sdot_hi): Likewise.
> > > 	(check_effective_target_vect_udot_hi): Likewise.
> > > 	(check_effective_target_vect_usad_char): Likewise.
> > > 	(check_effective_target_vect_pack_trunc): Likewise.
> > > 	(check_effective_target_vect_unpack): Likewise.
> > > 	(check_effective_target_vect_aligned_arrays): Likewise.
> > > 	(check_effective_target_vect_natural_alignment): Likewise.
> > > 	(check_effective_target_vector_alignment_reachable): Likewise.
> > > 	(check_effective_target_vector_alignment_reachable_for_64bit): Likewise.
> > > 	(is-effective-target): Initialize et_index if undefined.
> > > 	(et-dg-runtest): New.
> > > 	(et-is-effective-target): Likewise.
> > > 	(check_vect_support_and_set_flags): Add supported MIPS targets to
> > > 	EFFECTIVE_TARGETS list.  Return the number of supported targets.
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2016-05-05 15:14 ` Robert Suchanek
  2016-05-06 11:21   ` Matthew Fortune
  2016-06-29  7:49   ` Matthew Fortune
@ 2016-06-30 14:50   ` Mike Stump
  2016-07-26 13:52     ` Robert Suchanek
  2 siblings, 1 reply; 17+ messages in thread
From: Mike Stump @ 2016-06-30 14:50 UTC (permalink / raw)
  To: Robert Suchanek; +Cc: Catherine_Moore, Matthew Fortune, gcc-patches

On May 5, 2016, at 8:14 AM, Robert Suchanek <Robert.Suchanek@imgtec.com> wrote:
> 
> I'm resending this patch as it has been rebased and updated.  I reverted a change
> to check_effective_target_vect_call_lrint procedure because it does not use
> cached result.

Ok.

Please ensure that the compilation flag is mixed into the test case name so that as you iterate over them, the test case names are unique.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2016-06-30 14:50   ` Mike Stump
@ 2016-07-26 13:52     ` Robert Suchanek
  2016-08-15 10:38       ` Trevor Saunders
  0 siblings, 1 reply; 17+ messages in thread
From: Robert Suchanek @ 2016-07-26 13:52 UTC (permalink / raw)
  To: Mike Stump; +Cc: Catherine_Moore, Matthew Fortune, gcc-patches

Hi,

> On May 5, 2016, at 8:14 AM, Robert Suchanek <Robert.Suchanek@imgtec.com> wrote:
> >
> > I'm resending this patch as it has been rebased and updated.  I reverted a
> change
> > to check_effective_target_vect_call_lrint procedure because it does not use
> > cached result.
> 
> Ok.
> 
> Please ensure that the compilation flag is mixed into the test case name so
> that as you iterate over them, the test case names are unique.

An effective target is likely to have a unique flag to enable a given set of
SIMD operations and this is mixed into test case names.

I double-checked this with mips-mti-linux-gnu where auto-vectorization tests
can be run twice i.e. for -mmsa and -mpaired-single.

The patch was rebased once again and tested on x86_64-unknown-linux-gnu.

Committed as r238755.

Thanks and regards,
Robert

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2016-07-26 13:52     ` Robert Suchanek
@ 2016-08-15 10:38       ` Trevor Saunders
  2016-08-23  8:15         ` Robert Suchanek
  0 siblings, 1 reply; 17+ messages in thread
From: Trevor Saunders @ 2016-08-15 10:38 UTC (permalink / raw)
  To: Robert Suchanek; +Cc: Mike Stump, Catherine_Moore, Matthew Fortune, gcc-patches

On Tue, Jul 26, 2016 at 01:51:33PM +0000, Robert Suchanek wrote:
> Hi,
> 
> > On May 5, 2016, at 8:14 AM, Robert Suchanek <Robert.Suchanek@imgtec.com> wrote:
> > >
> > > I'm resending this patch as it has been rebased and updated.  I reverted a
> > change
> > > to check_effective_target_vect_call_lrint procedure because it does not use
> > > cached result.
> > 
> > Ok.
> > 
> > Please ensure that the compilation flag is mixed into the test case name so
> > that as you iterate over them, the test case names are unique.
> 
> An effective target is likely to have a unique flag to enable a given set of
> SIMD operations and this is mixed into test case names.
> 
> I double-checked this with mips-mti-linux-gnu where auto-vectorization tests
> can be run twice i.e. for -mmsa and -mpaired-single.
> 
> The patch was rebased once again and tested on x86_64-unknown-linux-gnu.
> 
> Committed as r238755.

unfortunately this broke make check-c
RUNTESTFLAGS='vect.exp=*no-vfa-vect-dv-2.c
--target_board=unix\{-m32,-m64\}', causing the check if
vect_aligned_arrays to be cached between the -m64 and -m32 variants
which is incorrect at least on my machine if you actually run that test
for -m32 and -m64 you get different results.  In both case et_index is 0
so you use the cached value the second time, but that's not correct
because the options changed.

I suspect this also causes some random vectorizer tests to appear and
disappear during regression testing with the same -m64 and -m32, but I'm
not absolutely sure of that part.

Thanks!

Trev

> 
> Thanks and regards,
> Robert
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2016-08-15 10:38       ` Trevor Saunders
@ 2016-08-23  8:15         ` Robert Suchanek
  2016-08-23 15:52           ` Jeff Law
  0 siblings, 1 reply; 17+ messages in thread
From: Robert Suchanek @ 2016-08-23  8:15 UTC (permalink / raw)
  To: Trevor Saunders; +Cc: Mike Stump, Catherine_Moore, Matthew Fortune, gcc-patches

Hi,

> unfortunately this broke make check-c
> RUNTESTFLAGS='vect.exp=*no-vfa-vect-dv-2.c
> --target_board=unix\{-m32,-m64\}', causing the check if
> vect_aligned_arrays to be cached between the -m64 and -m32 variants
> which is incorrect at least on my machine if you actually run that test
> for -m32 and -m64 you get different results.  In both case et_index is 0
> so you use the cached value the second time, but that's not correct
> because the options changed.
> 
> I suspect this also causes some random vectorizer tests to appear and
> disappear during regression testing with the same -m64 and -m32, but I'm
> not absolutely sure of that part.
> 
> Thanks!
> 
> Trev

I was misled by the comments in a few procedures suggesting that the results
should have been cached and the use of global variable looked mistyped.

The following patch reverts to the old behaviour. I also removed misleading
comments and related logic that checks for the cached result.  There might be
other procedures with similar inconsistency but here I only modified the offending ones.

Alternatively, it would be possible to switch to the new method and do the caching
but it is more intrusive change that requires careful analysis of the results
and the tests will not likely be directly comparable with old results (because of
flag mixing into the test names).  It's safer to restore the original behaviour
as the patch was not supposed to change any existing results.

Ok to apply?

Regards,
Robert

gcc/testsuite/
	* lib/target-supports.exp
	(check_effective_target_vect_aligned_arrays): Don't cache the result.
	(check_effective_target_vect_natural_alignment): Ditto.
	(check_effective_target_vector_alignment_reachable): Ditto.
	(check_effective_target_vector_alignment_reachable_for_64bit): Ditto.

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 533d3a6..0dabea0 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5309,32 +5309,22 @@ proc check_effective_target_vect_hw_misalign { } {
 
 # Return 1 if arrays are aligned to the vector alignment
 # boundary, 0 otherwise.
-#
-# This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_aligned_arrays { } {
-    global et_vect_aligned_arrays_saved
-    global et_index
-
-    if [info exists et_vect_aligned_arrays_saved($et_index)] {
-	verbose "check_effective_target_vect_aligned_arrays:\
-		 using cached result" 2
-    } else {
-	set et_vect_aligned_arrays_saved($et_index) 0
-        if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
-	    if { ([is-effective-target lp64]
-	          && ( ![check_avx_available]
-		     || [check_prefer_avx128])) } {
-		 set et_vect_aligned_arrays_saved($et_index) 1
-	    }
-	}
-        if [istarget spu-*-*] {
-	    set et_vect_aligned_arrays_saved($et_index) 1
+    set et_vect_aligned_arrays 0
+    if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+	if { ([is-effective-target lp64]
+	      && ( ![check_avx_available]
+		 || [check_prefer_avx128])) } {
+	     set et_vect_aligned_arrays 1
 	}
     }
+    if [istarget spu-*-*] {
+	set et_vect_aligned_arrays 1
+    }
     verbose "check_effective_target_vect_aligned_arrays:\
-	     returning $et_vect_aligned_arrays_saved($et_index)" 2
-    return $et_vect_aligned_arrays_saved($et_index)
+	     returning $et_vect_aligned_arrays" 2
+    return $et_vect_aligned_arrays
 }
 
 # Return 1 if types of size 32 bit or less are naturally aligned
@@ -5382,74 +5372,43 @@ proc check_effective_target_natural_alignment_64 { } {
 
 # Return 1 if all vector types are naturally aligned (aligned to their
 # type-size), 0 otherwise.
-#
-# This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_natural_alignment { } {
-    global et_vect_natural_alignment_saved
-    global et_index
-
-    if [info exists et_vect_natural_alignment_saved($et_index)] {
-        verbose "check_effective_target_vect_natural_alignment: using cached result" 2
-    } else {
-	set et_vect_natural_alignment_saved($et_index) 1
-        if { [check_effective_target_arm_eabi]
-	     || [istarget nvptx-*-*]
-	     || [istarget s390*-*-*] } {
-	    set et_vect_natural_alignment_saved($et_index) 0
-        }
+    set et_vect_natural_alignment 1
+    if { [check_effective_target_arm_eabi]
+	 || [istarget nvptx-*-*]
+	 || [istarget s390*-*-*] } {
+	set et_vect_natural_alignment 0
     }
     verbose "check_effective_target_vect_natural_alignment:\
-	     returning $et_vect_natural_alignment_saved($et_index)" 2
-    return $et_vect_natural_alignment_saved($et_index)
+	     returning $et_vect_natural_alignment" 2
+    return $et_vect_natural_alignment
 }
 
 # Return 1 if vector alignment (for types of size 32 bit or less) is reachable, 0 otherwise.
-#
-# This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vector_alignment_reachable { } {
-    global et_vector_alignment_reachable_saved
-    global et_index
-
-    if [info exists et_vector_alignment_reachable_saved($et_index)] {
-	verbose "check_effective_target_vector_alignment_reachable:\
-		 using cached result" 2
-    } else {
-        if { [check_effective_target_vect_aligned_arrays]
-             || [check_effective_target_natural_alignment_32] } {
-	    set et_vector_alignment_reachable_saved($et_index) 1
-        } else {
-	    set et_vector_alignment_reachable_saved($et_index) 0
-        }
+    set et_vector_alignment_reachable 0
+    if { [check_effective_target_vect_aligned_arrays]
+	 || [check_effective_target_natural_alignment_32] } {
+	set et_vector_alignment_reachable 1
     }
     verbose "check_effective_target_vector_alignment_reachable:\
-	     returning $et_vector_alignment_reachable_saved($et_index)" 2
-    return $et_vector_alignment_reachable_saved($et_index)
+	     returning $et_vector_alignment_reachable" 2
+    return $et_vector_alignment_reachable
 }
 
 # Return 1 if vector alignment for 64 bit is reachable, 0 otherwise.
-#
-# This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vector_alignment_reachable_for_64bit { } {
-    global et_vector_alignment_reachable_for_64bit_saved
-    global et_index
-
-    if [info exists et_vector_alignment_reachable_for_64bit_saved($et_index)] {
-	verbose "check_effective_target_vector_alignment_reachable_for_64bit:\
-		 using cached result" 2
-    } else {
-        if { [check_effective_target_vect_aligned_arrays] 
-             || [check_effective_target_natural_alignment_64] } {
-	    set et_vector_alignment_reachable_for_64bit_saved($et_index) 1
-        } else {
-	    set et_vector_alignment_reachable_for_64bit_saved($et_index) 0
-        }
+    set et_vector_alignment_reachable_for_64bit 0
+    if { [check_effective_target_vect_aligned_arrays] 
+	 || [check_effective_target_natural_alignment_64] } {
+	set et_vector_alignment_reachable_for_64bit 1
     }
     verbose "check_effective_target_vector_alignment_reachable_for_64bit:\
-	 returning $et_vector_alignment_reachable_for_64bit_saved($et_index)" 2
-    return $et_vector_alignment_reachable_for_64bit_saved($et_index)
+	     returning $et_vector_alignment_reachable_for_64bit" 2
+    return $et_vector_alignment_reachable_for_64bit
 }
 
 # Return 1 if the target only requires element alignment for vector accesses
-- 
2.8.2

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2016-08-23  8:15         ` Robert Suchanek
@ 2016-08-23 15:52           ` Jeff Law
  2016-08-23 22:07             ` Trevor Saunders
  2016-08-24  7:54             ` Robert Suchanek
  0 siblings, 2 replies; 17+ messages in thread
From: Jeff Law @ 2016-08-23 15:52 UTC (permalink / raw)
  To: Robert Suchanek, Trevor Saunders
  Cc: Mike Stump, Catherine_Moore, Matthew Fortune, gcc-patches

On 08/23/2016 02:15 AM, Robert Suchanek wrote:
> Hi,
>
>> unfortunately this broke make check-c
>> RUNTESTFLAGS='vect.exp=*no-vfa-vect-dv-2.c
>> --target_board=unix\{-m32,-m64\}', causing the check if
>> vect_aligned_arrays to be cached between the -m64 and -m32 variants
>> which is incorrect at least on my machine if you actually run that test
>> for -m32 and -m64 you get different results.  In both case et_index is 0
>> so you use the cached value the second time, but that's not correct
>> because the options changed.
>>
>> I suspect this also causes some random vectorizer tests to appear and
>> disappear during regression testing with the same -m64 and -m32, but I'm
>> not absolutely sure of that part.
>>
>> Thanks!
>>
>> Trev
>
> I was misled by the comments in a few procedures suggesting that the results
> should have been cached and the use of global variable looked mistyped.
Comments wrong, surely you jest :-)

>
> The following patch reverts to the old behaviour. I also removed misleading
> comments and related logic that checks for the cached result.  There might be
> other procedures with similar inconsistency but here I only modified the offending ones.
Thanks.  Given how much cut-n-paste we do with the tcl code there's a 
good chance this problem exists elsewhere.   I don't start ranting about 
tcl/dejagnu, I'll just put me in a terrible mood for the rest of the day.

>
> Alternatively, it would be possible to switch to the new method and do the caching
> but it is more intrusive change that requires careful analysis of the results
> and the tests will not likely be directly comparable with old results (because of
> flag mixing into the test names).  It's safer to restore the original behaviour
> as the patch was not supposed to change any existing results.
I'd go with the safer approach for now -- I keep holding out hope that 
there's a silver bullet out there that will allow us to replace dejagnu 
and all its tcl goop some day.

>
> Ok to apply?
>
> Regards,
> Robert
>
> gcc/testsuite/
> 	* lib/target-supports.exp
> 	(check_effective_target_vect_aligned_arrays): Don't cache the result.
> 	(check_effective_target_vect_natural_alignment): Ditto.
> 	(check_effective_target_vector_alignment_reachable): Ditto.
> 	(check_effective_target_vector_alignment_reachable_for_64bit): Ditto.
OK.
jeff
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2016-08-23 15:52           ` Jeff Law
@ 2016-08-23 22:07             ` Trevor Saunders
  2016-08-24  3:33               ` Jeff Law
  2016-08-24  7:54             ` Robert Suchanek
  1 sibling, 1 reply; 17+ messages in thread
From: Trevor Saunders @ 2016-08-23 22:07 UTC (permalink / raw)
  To: Jeff Law
  Cc: Robert Suchanek, Mike Stump, Catherine_Moore, Matthew Fortune,
	gcc-patches

On Tue, Aug 23, 2016 at 09:52:23AM -0600, Jeff Law wrote:
> On 08/23/2016 02:15 AM, Robert Suchanek wrote:
> > Hi,
> > 
> > > unfortunately this broke make check-c
> > > RUNTESTFLAGS='vect.exp=*no-vfa-vect-dv-2.c
> > > --target_board=unix\{-m32,-m64\}', causing the check if
> > > vect_aligned_arrays to be cached between the -m64 and -m32 variants
> > > which is incorrect at least on my machine if you actually run that test
> > > for -m32 and -m64 you get different results.  In both case et_index is 0
> > > so you use the cached value the second time, but that's not correct
> > > because the options changed.
> > > 
> > > I suspect this also causes some random vectorizer tests to appear and
> > > disappear during regression testing with the same -m64 and -m32, but I'm
> > > not absolutely sure of that part.
> > > 
> > > Thanks!
> > > 
> > > Trev
> > 
> > I was misled by the comments in a few procedures suggesting that the results
> > should have been cached and the use of global variable looked mistyped.
> Comments wrong, surely you jest :-)
> 
> > 
> > The following patch reverts to the old behaviour. I also removed misleading
> > comments and related logic that checks for the cached result.  There might be
> > other procedures with similar inconsistency but here I only modified the offending ones.
> Thanks.  Given how much cut-n-paste we do with the tcl code there's a good
> chance this problem exists elsewhere.   I don't start ranting about
> tcl/dejagnu, I'll just put me in a terrible mood for the rest of the day.
> 
> > 
> > Alternatively, it would be possible to switch to the new method and do the caching
> > but it is more intrusive change that requires careful analysis of the results
> > and the tests will not likely be directly comparable with old results (because of
> > flag mixing into the test names).  It's safer to restore the original behaviour
> > as the patch was not supposed to change any existing results.
> I'd go with the safer approach for now -- I keep holding out hope that
> there's a silver bullet out there that will allow us to replace dejagnu and
> all its tcl goop some day.

I've certainly been tempted to take a stab at at least replacing the
expect stuff with something else, it drives me kind of crazy to see how
much testsuite time is spent running expect.  Even if we can't do all of
it, the vast majority is just run the compiler and grep dump files or
the compiler's stdout / stderr.

Trev

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2016-08-23 22:07             ` Trevor Saunders
@ 2016-08-24  3:33               ` Jeff Law
  2016-08-24  7:30                 ` Robert Suchanek
  0 siblings, 1 reply; 17+ messages in thread
From: Jeff Law @ 2016-08-24  3:33 UTC (permalink / raw)
  To: Trevor Saunders
  Cc: Robert Suchanek, Mike Stump, Catherine_Moore, Matthew Fortune,
	gcc-patches

On 08/23/2016 04:15 PM, Trevor Saunders wrote:
>
> I've certainly been tempted to take a stab at at least replacing the
> expect stuff with something else, it drives me kind of crazy to see how
> much testsuite time is spent running expect.  Even if we can't do all of
> it, the vast majority is just run the compiler and grep dump files or
> the compiler's stdout / stderr.
Yup.  When Rob was making noise about rewriting dejagnu I tried to steer 
him a bit towards instead replacing the expect layer, but his plans 
where more on the tcl/dejagnu side.  I don't think anything ever came 
out of that proposal.

Expect is severe overkill for what we need and yes, it burns an amazing 
about of CPU time for what get out of it.

Jeff

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2016-08-24  3:33               ` Jeff Law
@ 2016-08-24  7:30                 ` Robert Suchanek
  0 siblings, 0 replies; 17+ messages in thread
From: Robert Suchanek @ 2016-08-24  7:30 UTC (permalink / raw)
  To: Jeff Law, Trevor Saunders
  Cc: Mike Stump, Catherine_Moore, Matthew Fortune, gcc-patches

> On 08/23/2016 04:15 PM, Trevor Saunders wrote:
> >
> > I've certainly been tempted to take a stab at at least replacing the
> > expect stuff with something else, it drives me kind of crazy to see how
> > much testsuite time is spent running expect.  Even if we can't do all of
> > it, the vast majority is just run the compiler and grep dump files or
> > the compiler's stdout / stderr.
> Yup.  When Rob was making noise about rewriting dejagnu I tried to steer
> him a bit towards instead replacing the expect layer, but his plans
> where more on the tcl/dejagnu side.  I don't think anything ever came
> out of that proposal.
> 
> Expect is severe overkill for what we need and yes, it burns an amazing
> about of CPU time for what get out of it.
> 
> Jeff

True.  I wasn't considering replacing the expect layer, just to overcome
the limitation of auto-vect tests.  This in itself is rather another hack
but didn't have a suggestion what to replace it with.

Regards,
Robert



^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets
  2016-08-23 15:52           ` Jeff Law
  2016-08-23 22:07             ` Trevor Saunders
@ 2016-08-24  7:54             ` Robert Suchanek
  1 sibling, 0 replies; 17+ messages in thread
From: Robert Suchanek @ 2016-08-24  7:54 UTC (permalink / raw)
  To: Jeff Law, Trevor Saunders
  Cc: Mike Stump, Catherine_Moore, Matthew Fortune, gcc-patches

Hi Jeff,

> > The following patch reverts to the old behaviour. I also removed misleading
> > comments and related logic that checks for the cached result.  There might be
> > other procedures with similar inconsistency but here I only modified the
> offending ones.
> Thanks.  Given how much cut-n-paste we do with the tcl code there's a
> good chance this problem exists elsewhere.   I don't start ranting about
> tcl/dejagnu, I'll just put me in a terrible mood for the rest of the day.

Indeed.

> > Alternatively, it would be possible to switch to the new method and do the
> caching
> > but it is more intrusive change that requires careful analysis of the results
> > and the tests will not likely be directly comparable with old results
> (because of
> > flag mixing into the test names).  It's safer to restore the original
> behaviour
> > as the patch was not supposed to change any existing results.
> I'd go with the safer approach for now -- I keep holding out hope that
> there's a silver bullet out there that will allow us to replace dejagnu
> and all its tcl goop some day.

I noticed over time that tcl/dejagnu have a unique set of features.
Replacing them with something else at some point wouldn't be a bad thing.

> 
> >
> > Ok to apply?
> >
> > Regards,
> > Robert
> >
> > gcc/testsuite/
> > 	* lib/target-supports.exp
> > 	(check_effective_target_vect_aligned_arrays): Don't cache the result.
> > 	(check_effective_target_vect_natural_alignment): Ditto.
> > 	(check_effective_target_vector_alignment_reachable): Ditto.
> > 	(check_effective_target_vector_alignment_reachable_for_64bit): Ditto.
> OK.
> jeff
> >

Committed as r239730.

Regards,
Robert

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-08-24  7:54 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-10 12:15 [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets Robert Suchanek
2016-01-05 16:16 ` Robert Suchanek
2016-01-11 13:35   ` Matthew Fortune
2016-01-11 13:37     ` Robert Suchanek
2016-05-05 15:14 ` Robert Suchanek
2016-05-06 11:21   ` Matthew Fortune
2016-06-29  7:49   ` Matthew Fortune
2016-06-29  8:16     ` Richard Biener
2016-06-30 14:50   ` Mike Stump
2016-07-26 13:52     ` Robert Suchanek
2016-08-15 10:38       ` Trevor Saunders
2016-08-23  8:15         ` Robert Suchanek
2016-08-23 15:52           ` Jeff Law
2016-08-23 22:07             ` Trevor Saunders
2016-08-24  3:33               ` Jeff Law
2016-08-24  7:30                 ` Robert Suchanek
2016-08-24  7:54             ` Robert Suchanek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).