Commit 9b7937cf by Robert Suchanek Committed by Robert Suchanek

Add support to run auto-vectorization tests for multiple effective targets.

gcc/testsuite/

	* 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.

From-SVN: r238755
parent 8f63caf6
2016-07-26 Robert Suchanek <robert.suchanek@imgtec.com>
* 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.
2016-07-26 Richard Biener <rguenther@suse.de> 2016-07-26 Richard Biener <rguenther@suse.de>
Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
......
...@@ -39,6 +39,11 @@ set save-dg-do-what-default ${dg-do-what-default} ...@@ -39,6 +39,11 @@ set save-dg-do-what-default ${dg-do-what-default}
global DEFAULT_VECTCFLAGS global DEFAULT_VECTCFLAGS
set 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. # These flags are used for all targets.
lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fno-vect-cost-model" lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fno-vect-cost-model"
...@@ -58,10 +63,10 @@ lappend VECT_SLP_CFLAGS "-fdump-tree-slp-details" ...@@ -58,10 +63,10 @@ lappend VECT_SLP_CFLAGS "-fdump-tree-slp-details"
dg-init dg-init
# Main loop. # Main loop.
g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/{pr,simd}*.{c,cc,S} ]] \ et-dg-runtest g++-dg-runtest [lsort [glob -nocomplain \
"" $DEFAULT_VECTCFLAGS $srcdir/$subdir/{pr,simd}*.{c,cc,S} ]] "" $DEFAULT_VECTCFLAGS
g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/slp-pr*.{c,cc,S} ]] \ et-dg-runtest g++-dg-runtest [lsort [glob -nocomplain \
"" $VECT_SLP_CFLAGS $srcdir/$subdir/slp-pr*.{c,cc,S} ]] "" $VECT_SLP_CFLAGS
#### Tests with special options #### Tests with special options
global SAVED_DEFAULT_VECTCFLAGS global SAVED_DEFAULT_VECTCFLAGS
...@@ -70,8 +75,8 @@ set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS ...@@ -70,8 +75,8 @@ set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
# --param max-aliased-vops=0 # --param max-aliased-vops=0
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "--param max-aliased-vops=0" lappend DEFAULT_VECTCFLAGS "--param max-aliased-vops=0"
g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/param-max-aliased*.\[cS\]]] \ et-dg-runtest g++-dg-runtest [lsort [glob -nocomplain \
"" $DEFAULT_VECTCFLAGS $srcdir/$subdir/param-max-aliased*.\[cS\]]] "" $DEFAULT_VECTCFLAGS
# Clean up. # Clean up.
set dg-do-what-default ${save-dg-do-what-default} set dg-do-what-default ${save-dg-do-what-default}
......
...@@ -37,6 +37,11 @@ set save-dg-do-what-default ${dg-do-what-default} ...@@ -37,6 +37,11 @@ set save-dg-do-what-default ${dg-do-what-default}
# Initialize `dg'. # Initialize `dg'.
dg-init 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 wait_to_run_files [lsort [glob -nocomplain $srcdir/$subdir/*.c ] ]
set scop_files [lsort [glob -nocomplain $srcdir/$subdir/scop-*.c ] ] set scop_files [lsort [glob -nocomplain $srcdir/$subdir/scop-*.c ] ]
set id_files [lsort [glob -nocomplain $srcdir/$subdir/id-*.c ] ] set id_files [lsort [glob -nocomplain $srcdir/$subdir/id-*.c ] ]
...@@ -69,7 +74,7 @@ global DEFAULT_VECTCFLAGS ...@@ -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" 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] { 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'. # The default action for the rest of the files is 'compile'.
......
...@@ -24,6 +24,11 @@ load_lib clearcap.exp ...@@ -24,6 +24,11 @@ load_lib clearcap.exp
global DEFAULT_VECTCFLAGS global DEFAULT_VECTCFLAGS
set 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 # If the target system supports vector instructions, the default action
# for a test is 'run', otherwise it's 'compile'. Save current default. # for a test is 'run', otherwise it's 'compile'. Save current default.
# Executing vector instructions on a system without hardware vector support # Executing vector instructions on a system without hardware vector support
...@@ -62,13 +67,15 @@ lappend O_VECTCFLAGS "-fdump-tree-vect-details" ...@@ -62,13 +67,15 @@ lappend O_VECTCFLAGS "-fdump-tree-vect-details"
lappend DEFAULT_VECTCFLAGS "-O2" lappend DEFAULT_VECTCFLAGS "-O2"
# Tests that should be run without generating dump info # 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 "" $DEFAULT_VECTCFLAGS
# "-O -fdump-tree-veclower2" # "-O -fdump-tree-veclower2"
lappend VEC_FLAGS "-O" "-fdump-tree-veclower2" lappend VEC_FLAGS "-O" "-fdump-tree-veclower2"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vec-scal-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort [glob -nocomplain \
"" $VEC_FLAGS $srcdir/$subdir/vec-scal-*.\[cS\]]] \
"" $VEC_FLAGS
set VECT_SLP_CFLAGS $DEFAULT_VECTCFLAGS set VECT_SLP_CFLAGS $DEFAULT_VECTCFLAGS
...@@ -81,14 +88,18 @@ if { [check_effective_target_lto] } { ...@@ -81,14 +88,18 @@ if { [check_effective_target_lto] } {
lappend VECT_ADDITIONAL_FLAGS "-flto -ffat-lto-objects" lappend VECT_ADDITIONAL_FLAGS "-flto -ffat-lto-objects"
} }
foreach flags $VECT_ADDITIONAL_FLAGS { 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 $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 $flags $DEFAULT_VECTCFLAGS
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/slp-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
$flags $DEFAULT_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/bb-slp*.\[cS\]]] \
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/bb-slp*.\[cS\]]] \ $flags $VECT_SLP_CFLAGS
$flags $VECT_SLP_CFLAGS
} }
#### Tests with special options #### Tests with special options
...@@ -99,141 +110,164 @@ set SAVED_VECT_SLP_CFLAGS $VECT_SLP_CFLAGS ...@@ -99,141 +110,164 @@ set SAVED_VECT_SLP_CFLAGS $VECT_SLP_CFLAGS
# --param vect-max-version-for-alias-checks=0 tests # --param vect-max-version-for-alias-checks=0 tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=0" 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 "" $DEFAULT_VECTCFLAGS
# -ffast-math tests # -ffast-math tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-ffast-math" 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 "" $DEFAULT_VECTCFLAGS
# -ffast-math SLP tests # -ffast-math SLP tests
set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS
lappend VECT_SLP_CFLAGS "-ffast-math" lappend VECT_SLP_CFLAGS "-ffast-math"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-bb-slp-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $VECT_SLP_CFLAGS [glob -nocomplain $srcdir/$subdir/fast-math-bb-slp-*.\[cS\]]] \
"" $VECT_SLP_CFLAGS
# -fno-fast-math tests # -fno-fast-math tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-fast-math" lappend DEFAULT_VECTCFLAGS "-fno-fast-math"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-fast-math-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $DEFAULT_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/no-fast-math-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# -fno-math-errno tests # -fno-math-errno tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-math-errno" 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 "" $DEFAULT_VECTCFLAGS
# -fwrapv tests # -fwrapv tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fwrapv" lappend DEFAULT_VECTCFLAGS "-fwrapv"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/wrapv-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $DEFAULT_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/wrapv-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# -ftrapv tests # -ftrapv tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-ftrapv" 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 "" $DEFAULT_VECTCFLAGS
# -fno-tree-dce tests # -fno-tree-dce tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-tree-dce" 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 "" $DEFAULT_VECTCFLAGS
# -fsection-anchors tests # -fsection-anchors tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fsection-anchors" 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 "" $DEFAULT_VECTCFLAGS
# alignment-sensitive -fsection-anchors tests # alignment-sensitive -fsection-anchors tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fsection-anchors" \ lappend DEFAULT_VECTCFLAGS "-fsection-anchors" \
"-fdump-ipa-increase_alignment-details" "-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 "" $DEFAULT_VECTCFLAGS
# -fno-section-anchors tests # -fno-section-anchors tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-section-anchors" 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 "" $DEFAULT_VECTCFLAGS
# -funswitch-loops tests # -funswitch-loops tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-funswitch-loops" 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 "" $DEFAULT_VECTCFLAGS
# -fno-trapping-math tests # -fno-trapping-math tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-trapping-math" 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 "" $DEFAULT_VECTCFLAGS
# -fno-tree-scev-cprop # -fno-tree-scev-cprop
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-vect-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $DEFAULT_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/no-scevccp-vect-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# -fno-tree-scev-cprop # -fno-tree-scev-cprop
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-pr*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $DEFAULT_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/no-scevccp-pr*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# -fno-tree-scev-cprop # -fno-tree-scev-cprop
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-outer-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $DEFAULT_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/no-scevccp-outer-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# -fno-tree-scev-cprop -fno-tree-reassoc # -fno-tree-scev-cprop -fno-tree-reassoc
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" "-fno-tree-reassoc" lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" "-fno-tree-reassoc"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-noreassoc-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $DEFAULT_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/no-scevccp-noreassoc-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# -fno-tree-scev-cprop # -fno-tree-scev-cprop
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-slp-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $DEFAULT_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/no-scevccp-slp-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# -fno-tree-dominator-opts # -fno-tree-dominator-opts
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-tree-dominator-opts" 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 "" $DEFAULT_VECTCFLAGS
# -fno-tree-pre # -fno-tree-pre
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-tree-pre" lappend DEFAULT_VECTCFLAGS "-fno-tree-pre"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-pre-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $DEFAULT_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/no-tree-pre-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# With -Os # With -Os
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-Os" lappend DEFAULT_VECTCFLAGS "-Os"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/Os-vect-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $DEFAULT_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/Os-vect-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# With --param ggc-min-expand=0 --param ggc-min-heapsize=0 # With --param ggc-min-expand=0 --param ggc-min-heapsize=0
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "--param" "ggc-min-expand=0" "--param" "ggc-min-heapsize=0" lappend DEFAULT_VECTCFLAGS "--param" "ggc-min-expand=0" "--param" "ggc-min-heapsize=0"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/ggc-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $DEFAULT_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/ggc-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# -ftree-loop-if-convert-stores # -ftree-loop-if-convert-stores
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-ftree-loop-if-convert-stores" lappend DEFAULT_VECTCFLAGS "-ftree-loop-if-convert-stores"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/if-cvt-stores-vect-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $DEFAULT_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/if-cvt-stores-vect-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# With -O3. # With -O3.
# Don't allow IPA cloning, because it throws our counts out of whack. # 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" ...@@ -242,40 +276,48 @@ lappend DEFAULT_VECTCFLAGS "-O3" "-fno-ipa-cp-clone"
if [istarget "spu-*-*"] { if [istarget "spu-*-*"] {
lappend DEFAULT_VECTCFLAGS "-funroll-loops" 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 # With -O1
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O1-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $O1_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/O1-*.\[cS\]]] \
"" $O1_VECTCFLAGS
# With -O # With -O
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $O_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/O-*.\[cS\]]] \
"" $O_VECTCFLAGS
# -fno-tree-reassoc # -fno-tree-reassoc
set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS
lappend VECT_SLP_CFLAGS "-fno-tree-reassoc" lappend VECT_SLP_CFLAGS "-fno-tree-reassoc"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-reassoc-bb-slp-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $VECT_SLP_CFLAGS [glob -nocomplain $srcdir/$subdir/no-tree-reassoc-bb-slp-*.\[cS\]]] \
"" $VECT_SLP_CFLAGS
# -fno-tree-fre # -fno-tree-fre
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-tree-fre" lappend DEFAULT_VECTCFLAGS "-fno-tree-fre"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-fre-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $DEFAULT_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/no-tree-fre-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# -fno-tree-fre -fno-tree-pre # -fno-tree-fre -fno-tree-pre
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-tree-fre" "-fno-tree-pre" lappend DEFAULT_VECTCFLAGS "-fno-tree-fre" "-fno-tree-pre"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-fre-pre*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $DEFAULT_VECTCFLAGS [glob -nocomplain $srcdir/$subdir/no-fre-pre*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# -fno-tree-sra # -fno-tree-sra
set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS
lappend VECT_SLP_CFLAGS "-fno-tree-sra" lappend VECT_SLP_CFLAGS "-fno-tree-sra"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-sra-bb-slp-*.\[cS\]]] \ et-dg-runtest dg-runtest [lsort \
"" $VECT_SLP_CFLAGS [glob -nocomplain $srcdir/$subdir/no-tree-sra-bb-slp-*.\[cS\]]] \
"" $VECT_SLP_CFLAGS
# Clean up. # Clean up.
......
...@@ -51,9 +51,15 @@ gfortran-dg-runtest $scop_files "" "-O2 -fgraphite -fdump-tree-graphite-a ...@@ -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 $id_files "" "-O2 -fgraphite-identity -ffast-math"
gfortran-dg-runtest $opt_files "" "-O2 -floop-nest-optimize -ffast-math -fdump-tree-graphite-all" 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. # Vectorizer tests, to be run or compiled, depending on target capabilities.
if [check_vect_support_and_set_flags] { 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. # Tests to be run.
......
...@@ -24,6 +24,11 @@ load_lib target-supports.exp ...@@ -24,6 +24,11 @@ load_lib target-supports.exp
global DEFAULT_VECTCFLAGS global DEFAULT_VECTCFLAGS
set 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. # These flags are used for all targets.
lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model=unlimited" \ lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model=unlimited" \
"-fdump-tree-vect-details" "-fdump-tree-vect-details"
...@@ -47,8 +52,10 @@ if ![check_vect_support_and_set_flags] { ...@@ -47,8 +52,10 @@ if ![check_vect_support_and_set_flags] {
dg-init dg-init
# Main loop. # Main loop.
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 \
gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.\[fF\]{,90,95,03,08} ]] "" $DEFAULT_VECTCFLAGS $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 #### Tests with special options
global SAVED_DEFAULT_VECTCFLAGS global SAVED_DEFAULT_VECTCFLAGS
...@@ -57,44 +64,51 @@ set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS ...@@ -57,44 +64,51 @@ set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
# -ffast-math tests # -ffast-math tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-ffast-math" lappend DEFAULT_VECTCFLAGS "-ffast-math"
gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-*.\[fF\]{,90,95,03,08} ]] \ et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \
"" $DEFAULT_VECTCFLAGS $srcdir/$subdir/fast-math-*.\[fF\]{,90,95,03,08} ]] \
"" $DEFAULT_VECTCFLAGS
# -ffast-math tests # -ffast-math tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-ffast-math" "-fdefault-real-8" lappend DEFAULT_VECTCFLAGS "-ffast-math" "-fdefault-real-8"
gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-real8*.\[fF\]{,90,95,03,08} ]] \ et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \
"" $DEFAULT_VECTCFLAGS $srcdir/$subdir/fast-math-real8*.\[fF\]{,90,95,03,08} ]] \
"" $DEFAULT_VECTCFLAGS
# -fvect-cost-model tests # -fvect-cost-model tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fvect-cost-model=dynamic" lappend DEFAULT_VECTCFLAGS "-fvect-cost-model=dynamic"
gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/cost-model-*.\[fF\]{,90,95,03,08} ]] \ et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \
"" $DEFAULT_VECTCFLAGS $srcdir/$subdir/cost-model-*.\[fF\]{,90,95,03,08} ]] \
"" $DEFAULT_VECTCFLAGS
# --param vect-max-version-for-alias-checks=0 tests # --param vect-max-version-for-alias-checks=0 tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=0" 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} ]] \ et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \
"" $DEFAULT_VECTCFLAGS $srcdir/$subdir/no-vfa-*.\[fF\]{,90,95,03,08} ]] \
"" $DEFAULT_VECTCFLAGS
# With -O3 # With -O3
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-O3" lappend DEFAULT_VECTCFLAGS "-O3"
gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O3-*.\[fF\]{,90,95,03,08} ]] \ et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \
"" $DEFAULT_VECTCFLAGS $srcdir/$subdir/O3-*.\[fF\]{,90,95,03,08} ]] \
"" $DEFAULT_VECTCFLAGS
# With -Ofast # With -Ofast
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-Ofast" lappend DEFAULT_VECTCFLAGS "-Ofast"
gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/Ofast-*.\[fF\]{,90,95,03,08} ]] \ et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \
"" $DEFAULT_VECTCFLAGS $srcdir/$subdir/Ofast-*.\[fF\]{,90,95,03,08} ]] \
"" $DEFAULT_VECTCFLAGS
# With -fno-tree-copy-prop -fno-tree-fre -O3 # With -fno-tree-copy-prop -fno-tree-fre -O3
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fno-tree-copy-prop" "-fno-tree-fre" "-O3" 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} ]] \ et-dg-runtest gfortran-dg-runtest [lsort [glob -nocomplain \
"" $DEFAULT_VECTCFLAGS $srcdir/$subdir/no-fre-no-copy-prop-O3-*.\[fF\]{,90,95,03,08} ]] \
"" $DEFAULT_VECTCFLAGS
# Clean up. # Clean up.
set dg-do-what-default ${save-dg-do-what-default} set dg-do-what-default ${save-dg-do-what-default}
......
...@@ -1585,6 +1585,47 @@ proc check_sse_hw_available { } { ...@@ -1585,6 +1585,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 # Return 1 if the target supports executing SSE2 instructions, 0
# otherwise. Cache the result. # otherwise. Cache the result.
...@@ -1688,6 +1729,27 @@ proc check_effective_target_sse4_runtime { } { ...@@ -1688,6 +1729,27 @@ proc check_effective_target_sse4_runtime { } {
return 0 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. # Return 1 if the target supports running AVX executables, 0 otherwise.
proc check_effective_target_avx_runtime { } { proc check_effective_target_avx_runtime { } {
...@@ -2560,11 +2622,12 @@ proc check_effective_target_vect_cmdline_needed { } { ...@@ -2560,11 +2622,12 @@ proc check_effective_target_vect_cmdline_needed { } {
proc check_effective_target_vect_int { } { proc check_effective_target_vect_int { } {
global et_vect_int_saved 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 verbose "check_effective_target_vect_int: using cached result" 2
} else { } else {
set et_vect_int_saved 0 set et_vect_int_saved($et_index) 0
if { [istarget i?86-*-*] || [istarget x86_64-*-*] if { [istarget i?86-*-*] || [istarget x86_64-*-*]
|| ([istarget powerpc*-*-*] || ([istarget powerpc*-*-*]
&& ![istarget powerpc-*-linux*paired*]) && ![istarget powerpc-*-linux*paired*])
...@@ -2575,13 +2638,14 @@ proc check_effective_target_vect_int { } { ...@@ -2575,13 +2638,14 @@ proc check_effective_target_vect_int { } {
|| [istarget aarch64*-*-*] || [istarget aarch64*-*-*]
|| [check_effective_target_arm32] || [check_effective_target_arm32]
|| ([istarget mips*-*-*] || ([istarget mips*-*-*]
&& [check_effective_target_mips_loongson]) } { && [et-is-effective-target mips_loongson]) } {
set et_vect_int_saved 1 set et_vect_int_saved($et_index) 1
} }
} }
verbose "check_effective_target_vect_int: returning $et_vect_int_saved" 2 verbose "check_effective_target_vect_int:\
return $et_vect_int_saved 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 # Return 1 if the target supports signed int->float conversion
...@@ -2589,22 +2653,25 @@ proc check_effective_target_vect_int { } { ...@@ -2589,22 +2653,25 @@ proc check_effective_target_vect_int { } {
proc check_effective_target_vect_intfloat_cvt { } { proc check_effective_target_vect_intfloat_cvt { } {
global et_vect_intfloat_cvt_saved global et_vect_intfloat_cvt_saved
global et_index
if [info exists et_vect_intfloat_cvt_saved] { if [info exists et_vect_intfloat_cvt_saved($et_index)] {
verbose "check_effective_target_vect_intfloat_cvt: using cached result" 2 verbose "check_effective_target_vect_intfloat_cvt:\
using cached result" 2
} else { } else {
set et_vect_intfloat_cvt_saved 0 set et_vect_intfloat_cvt_saved($et_index) 0
if { [istarget i?86-*-*] || [istarget x86_64-*-*] if { [istarget i?86-*-*] || [istarget x86_64-*-*]
|| ([istarget powerpc*-*-*] || ([istarget powerpc*-*-*]
&& ![istarget powerpc-*-linux*paired*]) && ![istarget powerpc-*-linux*paired*])
|| ([istarget arm*-*-*] || ([istarget arm*-*-*]
&& [check_effective_target_arm_neon_ok])} { && [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 verbose "check_effective_target_vect_intfloat_cvt:\
return $et_vect_intfloat_cvt_saved 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. #Return 1 if we're supporting __int128 for target, 0 otherwise.
...@@ -2626,23 +2693,26 @@ proc check_effective_target_int128 { } { ...@@ -2626,23 +2693,26 @@ proc check_effective_target_int128 { } {
proc check_effective_target_vect_uintfloat_cvt { } { proc check_effective_target_vect_uintfloat_cvt { } {
global et_vect_uintfloat_cvt_saved global et_vect_uintfloat_cvt_saved
global et_index
if [info exists et_vect_uintfloat_cvt_saved] { if [info exists et_vect_uintfloat_cvt_saved($et_index)] {
verbose "check_effective_target_vect_uintfloat_cvt: using cached result" 2 verbose "check_effective_target_vect_uintfloat_cvt:\
using cached result" 2
} else { } else {
set et_vect_uintfloat_cvt_saved 0 set et_vect_uintfloat_cvt_saved($et_index) 0
if { [istarget i?86-*-*] || [istarget x86_64-*-*] if { [istarget i?86-*-*] || [istarget x86_64-*-*]
|| ([istarget powerpc*-*-*] || ([istarget powerpc*-*-*]
&& ![istarget powerpc-*-linux*paired*]) && ![istarget powerpc-*-linux*paired*])
|| [istarget aarch64*-*-*] || [istarget aarch64*-*-*]
|| ([istarget arm*-*-*] || ([istarget arm*-*-*]
&& [check_effective_target_arm_neon_ok])} { && [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 verbose "check_effective_target_vect_uintfloat_cvt:\
return $et_vect_uintfloat_cvt_saved returning $et_vect_uintfloat_cvt_saved($et_index)" 2
return $et_vect_uintfloat_cvt_saved($et_index)
} }
...@@ -2651,22 +2721,25 @@ proc check_effective_target_vect_uintfloat_cvt { } { ...@@ -2651,22 +2721,25 @@ proc check_effective_target_vect_uintfloat_cvt { } {
proc check_effective_target_vect_floatint_cvt { } { proc check_effective_target_vect_floatint_cvt { } {
global et_vect_floatint_cvt_saved global et_vect_floatint_cvt_saved
global et_index
if [info exists et_vect_floatint_cvt_saved] { if [info exists et_vect_floatint_cvt_saved($et_index)] {
verbose "check_effective_target_vect_floatint_cvt: using cached result" 2 verbose "check_effective_target_vect_floatint_cvt:\
using cached result" 2
} else { } else {
set et_vect_floatint_cvt_saved 0 set et_vect_floatint_cvt_saved($et_index) 0
if { [istarget i?86-*-*] || [istarget x86_64-*-*] if { [istarget i?86-*-*] || [istarget x86_64-*-*]
|| ([istarget powerpc*-*-*] || ([istarget powerpc*-*-*]
&& ![istarget powerpc-*-linux*paired*]) && ![istarget powerpc-*-linux*paired*])
|| ([istarget arm*-*-*] || ([istarget arm*-*-*]
&& [check_effective_target_arm_neon_ok])} { && [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 verbose "check_effective_target_vect_floatint_cvt:\
return $et_vect_floatint_cvt_saved 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 # Return 1 if the target supports unsigned float->int conversion
...@@ -2674,21 +2747,24 @@ proc check_effective_target_vect_floatint_cvt { } { ...@@ -2674,21 +2747,24 @@ proc check_effective_target_vect_floatint_cvt { } {
proc check_effective_target_vect_floatuint_cvt { } { proc check_effective_target_vect_floatuint_cvt { } {
global et_vect_floatuint_cvt_saved global et_vect_floatuint_cvt_saved
global et_index
if [info exists et_vect_floatuint_cvt_saved] { if [info exists et_vect_floatuint_cvt_saved($et_index)] {
verbose "check_effective_target_vect_floatuint_cvt: using cached result" 2 verbose "check_effective_target_vect_floatuint_cvt:\
using cached result" 2
} else { } else {
set et_vect_floatuint_cvt_saved 0 set et_vect_floatuint_cvt_saved($et_index) 0
if { ([istarget powerpc*-*-*] if { ([istarget powerpc*-*-*]
&& ![istarget powerpc-*-linux*paired*]) && ![istarget powerpc-*-linux*paired*])
|| ([istarget arm*-*-*] || ([istarget arm*-*-*]
&& [check_effective_target_arm_neon_ok])} { && [check_effective_target_arm_neon_ok])} {
set et_vect_floatuint_cvt_saved 1 set et_vect_floatuint_cvt_saved($et_index) 1
} }
} }
verbose "check_effective_target_vect_floatuint_cvt: returning $et_vect_floatuint_cvt_saved" 2 verbose "check_effective_target_vect_floatuint_cvt:\
return $et_vect_floatuint_cvt_saved 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. # Return 1 if the target supports #pragma omp declare simd, 0 otherwise.
...@@ -2697,24 +2773,26 @@ proc check_effective_target_vect_floatuint_cvt { } { ...@@ -2697,24 +2773,26 @@ proc check_effective_target_vect_floatuint_cvt { } {
proc check_effective_target_vect_simd_clones { } { proc check_effective_target_vect_simd_clones { } {
global et_vect_simd_clones_saved 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 verbose "check_effective_target_vect_simd_clones: using cached result" 2
} else { } else {
set et_vect_simd_clones_saved 0 set et_vect_simd_clones_saved($et_index) 0
if { [istarget i?86-*-*] || [istarget x86_64-*-*] } { if { [istarget i?86-*-*] || [istarget x86_64-*-*] } {
# On i?86/x86_64 #pragma omp declare simd builds a sse2, avx and # 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 # avx2 clone. Only the right clone for the specified arch will be
# chosen, but still we need to at least be able to assemble # chosen, but still we need to at least be able to assemble
# avx2. # avx2.
if { [check_effective_target_avx512f] } { 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 verbose "check_effective_target_vect_simd_clones:\
return $et_vect_simd_clones_saved 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 # Return 1 if this is a AArch64 target supporting big endian
...@@ -3709,6 +3787,15 @@ proc check_effective_target_arm_acq_rel { } { ...@@ -3709,6 +3787,15 @@ proc check_effective_target_arm_acq_rel { } {
}] }]
} }
# 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 # Return 1 if this a Loongson-2E or -2F target using an ABI that supports
# the Loongson vector modes. # the Loongson vector modes.
...@@ -4230,11 +4317,12 @@ proc check_effective_target_sparc_vis { } { ...@@ -4230,11 +4317,12 @@ proc check_effective_target_sparc_vis { } {
proc check_effective_target_vect_shift { } { proc check_effective_target_vect_shift { } {
global et_vect_shift_saved 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 verbose "check_effective_target_vect_shift: using cached result" 2
} else { } else {
set et_vect_shift_saved 0 set et_vect_shift_saved($et_index) 0
if { ([istarget powerpc*-*-*] if { ([istarget powerpc*-*-*]
&& ![istarget powerpc-*-linux*paired*]) && ![istarget powerpc-*-linux*paired*])
|| [istarget ia64-*-*] || [istarget ia64-*-*]
...@@ -4242,13 +4330,14 @@ proc check_effective_target_vect_shift { } { ...@@ -4242,13 +4330,14 @@ proc check_effective_target_vect_shift { } {
|| [istarget aarch64*-*-*] || [istarget aarch64*-*-*]
|| [check_effective_target_arm32] || [check_effective_target_arm32]
|| ([istarget mips*-*-*] || ([istarget mips*-*-*]
&& [check_effective_target_mips_loongson]) } { && [et-is-effective-target mips_loongson]) } {
set et_vect_shift_saved 1 set et_vect_shift_saved($et_index) 1
} }
} }
verbose "check_effective_target_vect_shift: returning $et_vect_shift_saved" 2 verbose "check_effective_target_vect_shift:\
return $et_vect_shift_saved returning $et_vect_shift_saved($et_index)" 2
return $et_vect_shift_saved($et_index)
} }
proc check_effective_target_whole_vector_shift { } { proc check_effective_target_whole_vector_shift { } {
...@@ -4259,7 +4348,7 @@ proc check_effective_target_whole_vector_shift { } { ...@@ -4259,7 +4348,7 @@ proc check_effective_target_whole_vector_shift { } {
|| ([check_effective_target_arm32] || ([check_effective_target_arm32]
&& [check_effective_target_arm_little_endian]) && [check_effective_target_arm_little_endian])
|| ([istarget mips*-*-*] || ([istarget mips*-*-*]
&& [check_effective_target_mips_loongson]) } { && [et-is-effective-target mips_loongson]) } {
set answer 1 set answer 1
} else { } else {
set answer 0 set answer 0
...@@ -4273,41 +4362,45 @@ proc check_effective_target_whole_vector_shift { } { ...@@ -4273,41 +4362,45 @@ proc check_effective_target_whole_vector_shift { } {
proc check_effective_target_vect_bswap { } { proc check_effective_target_vect_bswap { } {
global et_vect_bswap_saved 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 verbose "check_effective_target_vect_bswap: using cached result" 2
} else { } else {
set et_vect_bswap_saved 0 set et_vect_bswap_saved($et_index) 0
if { [istarget aarch64*-*-*] if { [istarget aarch64*-*-*]
|| ([istarget arm*-*-*] || ([istarget arm*-*-*]
&& [check_effective_target_arm_neon]) && [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 verbose "check_effective_target_vect_bswap:\
return $et_vect_bswap_saved 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. # Return 1 if the target supports hardware vector shift operation for char.
proc check_effective_target_vect_shift_char { } { proc check_effective_target_vect_shift_char { } {
global et_vect_shift_char_saved 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 verbose "check_effective_target_vect_shift_char: using cached result" 2
} else { } else {
set et_vect_shift_char_saved 0 set et_vect_shift_char_saved($et_index) 0
if { ([istarget powerpc*-*-*] if { ([istarget powerpc*-*-*]
&& ![istarget powerpc-*-linux*paired*]) && ![istarget powerpc-*-linux*paired*])
|| [check_effective_target_arm32] } { || [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 verbose "check_effective_target_vect_shift_char:\
return $et_vect_shift_char_saved 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. # Return 1 if the target supports hardware vectors of long, 0 otherwise.
...@@ -4337,11 +4430,12 @@ proc check_effective_target_vect_long { } { ...@@ -4337,11 +4430,12 @@ proc check_effective_target_vect_long { } {
proc check_effective_target_vect_float { } { proc check_effective_target_vect_float { } {
global et_vect_float_saved 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 verbose "check_effective_target_vect_float: using cached result" 2
} else { } else {
set et_vect_float_saved 0 set et_vect_float_saved($et_index) 0
if { [istarget i?86-*-*] || [istarget x86_64-*-*] if { [istarget i?86-*-*] || [istarget x86_64-*-*]
|| [istarget powerpc*-*-*] || [istarget powerpc*-*-*]
|| [istarget spu-*-*] || [istarget spu-*-*]
...@@ -4350,12 +4444,13 @@ proc check_effective_target_vect_float { } { ...@@ -4350,12 +4444,13 @@ proc check_effective_target_vect_float { } {
|| [istarget ia64-*-*] || [istarget ia64-*-*]
|| [istarget aarch64*-*-*] || [istarget aarch64*-*-*]
|| [check_effective_target_arm32] } { || [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 verbose "check_effective_target_vect_float:\
return $et_vect_float_saved 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. # Return 1 if the target supports hardware vectors of double, 0 otherwise.
...@@ -4364,11 +4459,12 @@ proc check_effective_target_vect_float { } { ...@@ -4364,11 +4459,12 @@ proc check_effective_target_vect_float { } {
proc check_effective_target_vect_double { } { proc check_effective_target_vect_double { } {
global et_vect_double_saved 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 verbose "check_effective_target_vect_double: using cached result" 2
} else { } else {
set et_vect_double_saved 0 set et_vect_double_saved($et_index) 0
if { [istarget i?86-*-*] || [istarget x86_64-*-*] if { [istarget i?86-*-*] || [istarget x86_64-*-*]
|| [istarget aarch64*-*-*] } { || [istarget aarch64*-*-*] } {
if { [check_no_compiler_messages vect_double assembly { if { [check_no_compiler_messages vect_double assembly {
...@@ -4376,19 +4472,20 @@ proc check_effective_target_vect_double { } { ...@@ -4376,19 +4472,20 @@ proc check_effective_target_vect_double { } {
# error No double vectorizer support. # error No double vectorizer support.
#endif #endif
}] } { }] } {
set et_vect_double_saved 1 set et_vect_double_saved($et_index) 1
} else { } else {
set et_vect_double_saved 0 set et_vect_double_saved($et_index) 0
} }
} elseif { [istarget spu-*-*] } { } elseif { [istarget spu-*-*] } {
set et_vect_double_saved 1 set et_vect_double_saved($et_index) 1
} elseif { [istarget powerpc*-*-*] && [check_vsx_hw_available] } { } 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 verbose "check_effective_target_vect_double:\
return $et_vect_double_saved 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. # Return 1 if the target supports hardware vectors of long long, 0 otherwise.
...@@ -4397,18 +4494,20 @@ proc check_effective_target_vect_double { } { ...@@ -4397,18 +4494,20 @@ proc check_effective_target_vect_double { } {
proc check_effective_target_vect_long_long { } { proc check_effective_target_vect_long_long { } {
global et_vect_long_long_saved 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 verbose "check_effective_target_vect_long_long: using cached result" 2
} else { } else {
set et_vect_long_long_saved 0 set et_vect_long_long_saved($et_index) 0
if { [istarget i?86-*-*] || [istarget x86_64-*-*] } { if { [istarget i?86-*-*] || [istarget x86_64-*-*] } {
set et_vect_long_long_saved 1 set et_vect_long_long_saved($et_index) 1
} }
} }
verbose "check_effective_target_vect_long_long: returning $et_vect_long_long_saved" 2 verbose "check_effective_target_vect_long_long:\
return $et_vect_long_long_saved returning $et_vect_long_long_saved($et_index)" 2
return $et_vect_long_long_saved($et_index)
} }
...@@ -4419,21 +4518,24 @@ proc check_effective_target_vect_long_long { } { ...@@ -4419,21 +4518,24 @@ proc check_effective_target_vect_long_long { } {
proc check_effective_target_vect_no_int_min_max { } { proc check_effective_target_vect_no_int_min_max { } {
global et_vect_no_int_min_max_saved global et_vect_no_int_min_max_saved
global et_index
if [info exists et_vect_no_int_min_max_saved] { 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 verbose "check_effective_target_vect_no_int_min_max:\
using cached result" 2
} else { } else {
set et_vect_no_int_min_max_saved 0 set et_vect_no_int_min_max_saved($et_index) 0
if { [istarget sparc*-*-*] if { [istarget sparc*-*-*]
|| [istarget spu-*-*] || [istarget spu-*-*]
|| [istarget alpha*-*-*] || [istarget alpha*-*-*]
|| ([istarget mips*-*-*] || ([istarget mips*-*-*]
&& [check_effective_target_mips_loongson]) } { && [et-is-effective-target mips_loongson]) } {
set et_vect_no_int_min_max_saved 1 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 verbose "check_effective_target_vect_no_int_min_max:\
return $et_vect_no_int_min_max_saved 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 # Return 1 if the target plus current options does not support a vector
...@@ -4443,18 +4545,20 @@ proc check_effective_target_vect_no_int_min_max { } { ...@@ -4443,18 +4545,20 @@ proc check_effective_target_vect_no_int_min_max { } {
proc check_effective_target_vect_no_int_add { } { proc check_effective_target_vect_no_int_add { } {
global et_vect_no_int_add_saved 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 verbose "check_effective_target_vect_no_int_add: using cached result" 2
} else { } 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. # Alpha only supports vector add on V8QI and V4HI.
if { [istarget alpha*-*-*] } { 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 verbose "check_effective_target_vect_no_int_add:\
return $et_vect_no_int_add_saved 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 # Return 1 if the target plus current options does not support vector
...@@ -4464,14 +4568,16 @@ proc check_effective_target_vect_no_int_add { } { ...@@ -4464,14 +4568,16 @@ proc check_effective_target_vect_no_int_add { } {
proc check_effective_target_vect_no_bitwise { } { proc check_effective_target_vect_no_bitwise { } {
global et_vect_no_bitwise_saved 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 verbose "check_effective_target_vect_no_bitwise: using cached result" 2
} else { } 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 verbose "check_effective_target_vect_no_bitwise:\
return $et_vect_no_bitwise_saved 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, # Return 1 if the target plus current options supports vector permutation,
...@@ -4480,24 +4586,26 @@ proc check_effective_target_vect_no_bitwise { } { ...@@ -4480,24 +4586,26 @@ proc check_effective_target_vect_no_bitwise { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_perm { } { 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 verbose "check_effective_target_vect_perm: using cached result" 2
} else { } else {
set et_vect_perm_saved 0 set et_vect_perm_saved($et_index) 0
if { [is-effective-target arm_neon_ok] if { [is-effective-target arm_neon_ok]
|| [istarget aarch64*-*-*] || [istarget aarch64*-*-*]
|| [istarget powerpc*-*-*] || [istarget powerpc*-*-*]
|| [istarget spu-*-*] || [istarget spu-*-*]
|| [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*]
|| ([istarget mips*-*-*] || ([istarget mips*-*-*]
&& [check_effective_target_mpaired_single]) } { && [et-is-effective-target mpaired_single]) } {
set et_vect_perm_saved 1 set et_vect_perm_saved($et_index) 1
} }
} }
verbose "check_effective_target_vect_perm: returning $et_vect_perm_saved" 2 verbose "check_effective_target_vect_perm:\
return $et_vect_perm_saved 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 # Return 1 if the target plus current options supports vector permutation
...@@ -4506,23 +4614,25 @@ proc check_effective_target_vect_perm { } { ...@@ -4506,23 +4614,25 @@ proc check_effective_target_vect_perm { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_perm_byte { } { 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 verbose "check_effective_target_vect_perm_byte: using cached result" 2
} else { } else {
set et_vect_perm_byte_saved 0 set et_vect_perm_byte_saved($et_index) 0
if { ([is-effective-target arm_neon_ok] if { ([is-effective-target arm_neon_ok]
&& [is-effective-target arm_little_endian]) && [is-effective-target arm_little_endian])
|| ([istarget aarch64*-*-*] || ([istarget aarch64*-*-*]
&& [is-effective-target aarch64_little_endian]) && [is-effective-target aarch64_little_endian])
|| [istarget powerpc*-*-*] || [istarget powerpc*-*-*]
|| [istarget spu-*-*] } { || [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 verbose "check_effective_target_vect_perm_byte:\
return $et_vect_perm_byte_saved 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 # Return 1 if the target plus current options supports vector permutation
...@@ -4531,23 +4641,25 @@ proc check_effective_target_vect_perm_byte { } { ...@@ -4531,23 +4641,25 @@ proc check_effective_target_vect_perm_byte { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_perm_short { } { 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 verbose "check_effective_target_vect_perm_short: using cached result" 2
} else { } else {
set et_vect_perm_short_saved 0 set et_vect_perm_short_saved($et_index) 0
if { ([is-effective-target arm_neon_ok] if { ([is-effective-target arm_neon_ok]
&& [is-effective-target arm_little_endian]) && [is-effective-target arm_little_endian])
|| ([istarget aarch64*-*-*] || ([istarget aarch64*-*-*]
&& [is-effective-target aarch64_little_endian]) && [is-effective-target aarch64_little_endian])
|| [istarget powerpc*-*-*] || [istarget powerpc*-*-*]
|| [istarget spu-*-*] } { || [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 verbose "check_effective_target_vect_perm_short:\
return $et_vect_perm_short_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4556,22 +4668,25 @@ proc check_effective_target_vect_perm_short { } { ...@@ -4556,22 +4668,25 @@ proc check_effective_target_vect_perm_short { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_widen_sum_hi_to_si_pattern { } { 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] { 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 verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern:\
using cached result" 2
} else { } 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*-*-*] if { [istarget powerpc*-*-*]
|| [istarget aarch64*-*-*] || [istarget aarch64*-*-*]
|| ([istarget arm*-*-*] && || ([istarget arm*-*-*] &&
[check_effective_target_arm_neon_ok]) [check_effective_target_arm_neon_ok])
|| [istarget ia64-*-*] } { || [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 verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern:\
return $et_vect_widen_sum_hi_to_si_pattern_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4582,19 +4697,23 @@ proc check_effective_target_vect_widen_sum_hi_to_si_pattern { } { ...@@ -4582,19 +4697,23 @@ proc check_effective_target_vect_widen_sum_hi_to_si_pattern { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_widen_sum_hi_to_si { } { 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] { 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 verbose "check_effective_target_vect_widen_sum_hi_to_si:\
using cached result" 2
} else { } 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*-*-*] if { [istarget powerpc*-*-*]
|| [istarget ia64-*-*] } { || [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 verbose "check_effective_target_vect_widen_sum_hi_to_si:\
return $et_vect_widen_sum_hi_to_si_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4605,20 +4724,23 @@ proc check_effective_target_vect_widen_sum_hi_to_si { } { ...@@ -4605,20 +4724,23 @@ proc check_effective_target_vect_widen_sum_hi_to_si { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_widen_sum_qi_to_hi { } { 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] { 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 verbose "check_effective_target_vect_widen_sum_qi_to_hi:\
using cached result" 2
} else { } 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] if { [check_effective_target_vect_unpack]
|| [check_effective_target_arm_neon_ok] || [check_effective_target_arm_neon_ok]
|| [istarget ia64-*-*] } { || [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 verbose "check_effective_target_vect_widen_sum_qi_to_hi:\
return $et_vect_widen_sum_qi_to_hi_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4627,18 +4749,21 @@ proc check_effective_target_vect_widen_sum_qi_to_hi { } { ...@@ -4627,18 +4749,21 @@ proc check_effective_target_vect_widen_sum_qi_to_hi { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_widen_sum_qi_to_si { } { 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] { 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 verbose "check_effective_target_vect_widen_sum_qi_to_si:\
using cached result" 2
} else { } 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*-*-*] } { 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 verbose "check_effective_target_vect_widen_sum_qi_to_si:\
return $et_vect_widen_sum_qi_to_si_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4651,25 +4776,28 @@ proc check_effective_target_vect_widen_sum_qi_to_si { } { ...@@ -4651,25 +4776,28 @@ proc check_effective_target_vect_widen_sum_qi_to_si { } {
proc check_effective_target_vect_widen_mult_qi_to_hi { } { 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] { 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 verbose "check_effective_target_vect_widen_mult_qi_to_hi:\
using cached result" 2
} else { } else {
if { [check_effective_target_vect_unpack] if { [check_effective_target_vect_unpack]
&& [check_effective_target_vect_short_mult] } { && [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 { } 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*-*-*] if { [istarget powerpc*-*-*]
|| [istarget aarch64*-*-*] || [istarget aarch64*-*-*]
|| ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } { || ([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 verbose "check_effective_target_vect_widen_mult_qi_to_hi:\
return $et_vect_widen_mult_qi_to_hi_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4682,28 +4810,32 @@ proc check_effective_target_vect_widen_mult_qi_to_hi { } { ...@@ -4682,28 +4810,32 @@ proc check_effective_target_vect_widen_mult_qi_to_hi { } {
proc check_effective_target_vect_widen_mult_hi_to_si { } { 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] { 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 verbose "check_effective_target_vect_widen_mult_hi_to_si:\
using cached result" 2
} else { } else {
if { [check_effective_target_vect_unpack] if { [check_effective_target_vect_unpack]
&& [check_effective_target_vect_int_mult] } { && [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 { } 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*-*-*] if { [istarget powerpc*-*-*]
|| [istarget spu-*-*] || [istarget spu-*-*]
|| [istarget ia64-*-*] || [istarget ia64-*-*]
|| [istarget aarch64*-*-*] || [istarget aarch64*-*-*]
|| [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*]
|| ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } { || ([istarget arm*-*-*]
set et_vect_widen_mult_hi_to_si_saved 1 && [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 verbose "check_effective_target_vect_widen_mult_hi_to_si:\
return $et_vect_widen_mult_hi_to_si_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4712,21 +4844,24 @@ proc check_effective_target_vect_widen_mult_hi_to_si { } { ...@@ -4712,21 +4844,24 @@ proc check_effective_target_vect_widen_mult_hi_to_si { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_widen_mult_qi_to_hi_pattern { } { 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] { 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 verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern:\
using cached result" 2
} else { } 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*-*-*] if { [istarget powerpc*-*-*]
|| ([istarget arm*-*-*] || ([istarget arm*-*-*]
&& [check_effective_target_arm_neon_ok] && [check_effective_target_arm_neon_ok]
&& [check_effective_target_arm_little_endian]) } { && [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 verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern:\
return $et_vect_widen_mult_qi_to_hi_pattern_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4735,12 +4870,14 @@ proc check_effective_target_vect_widen_mult_qi_to_hi_pattern { } { ...@@ -4735,12 +4870,14 @@ proc check_effective_target_vect_widen_mult_qi_to_hi_pattern { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } { 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] { 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 verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern:\
using cached result" 2
} else { } 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*-*-*] if { [istarget powerpc*-*-*]
|| [istarget spu-*-*] || [istarget spu-*-*]
|| [istarget ia64-*-*] || [istarget ia64-*-*]
...@@ -4748,11 +4885,12 @@ proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } { ...@@ -4748,11 +4885,12 @@ proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } {
|| ([istarget arm*-*-*] || ([istarget arm*-*-*]
&& [check_effective_target_arm_neon_ok] && [check_effective_target_arm_neon_ok]
&& [check_effective_target_arm_little_endian]) } { && [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 verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern:\
return $et_vect_widen_mult_hi_to_si_pattern_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4761,19 +4899,22 @@ proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } { ...@@ -4761,19 +4899,22 @@ proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_widen_mult_si_to_di_pattern { } { 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] { 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 verbose "check_effective_target_vect_widen_mult_si_to_di_pattern:\
using cached result" 2
} else { } 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-*-*] if {[istarget ia64-*-*]
|| [istarget i?86-*-*] || [istarget x86_64-*-*] } { || [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 verbose "check_effective_target_vect_widen_mult_si_to_di_pattern:\
return $et_vect_widen_mult_si_to_di_pattern_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4783,17 +4924,19 @@ proc check_effective_target_vect_widen_mult_si_to_di_pattern { } { ...@@ -4783,17 +4924,19 @@ proc check_effective_target_vect_widen_mult_si_to_di_pattern { } {
proc check_effective_target_vect_widen_shift { } { proc check_effective_target_vect_widen_shift { } {
global et_vect_widen_shift_saved 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 verbose "check_effective_target_vect_widen_shift: using cached result" 2
} else { } 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]) } { 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 verbose "check_effective_target_vect_widen_shift:\
return $et_vect_widen_shift_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4802,18 +4945,20 @@ proc check_effective_target_vect_widen_shift { } { ...@@ -4802,18 +4945,20 @@ proc check_effective_target_vect_widen_shift { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_sdot_qi { } { 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 verbose "check_effective_target_vect_sdot_qi: using cached result" 2
} else { } else {
set et_vect_sdot_qi_saved 0 set et_vect_sdot_qi_saved($et_index) 0
if { [istarget ia64-*-*] } { if { [istarget ia64-*-*] } {
set et_vect_udot_qi_saved 1 set et_vect_udot_qi_saved 1
} }
} }
verbose "check_effective_target_vect_sdot_qi: returning $et_vect_sdot_qi_saved" 2 verbose "check_effective_target_vect_sdot_qi:\
return $et_vect_sdot_qi_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4822,19 +4967,21 @@ proc check_effective_target_vect_sdot_qi { } { ...@@ -4822,19 +4967,21 @@ proc check_effective_target_vect_sdot_qi { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_udot_qi { } { 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 verbose "check_effective_target_vect_udot_qi: using cached result" 2
} else { } else {
set et_vect_udot_qi_saved 0 set et_vect_udot_qi_saved($et_index) 0
if { [istarget powerpc*-*-*] if { [istarget powerpc*-*-*]
|| [istarget ia64-*-*] } { || [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 verbose "check_effective_target_vect_udot_qi:\
return $et_vect_udot_qi_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4843,20 +4990,22 @@ proc check_effective_target_vect_udot_qi { } { ...@@ -4843,20 +4990,22 @@ proc check_effective_target_vect_udot_qi { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_sdot_hi { } { 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 verbose "check_effective_target_vect_sdot_hi: using cached result" 2
} else { } else {
set et_vect_sdot_hi_saved 0 set et_vect_sdot_hi_saved($et_index) 0
if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
|| [istarget ia64-*-*] || [istarget ia64-*-*]
|| [istarget i?86-*-*] || [istarget x86_64-*-*] } { || [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 verbose "check_effective_target_vect_sdot_hi:\
return $et_vect_sdot_hi_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4865,18 +5014,20 @@ proc check_effective_target_vect_sdot_hi { } { ...@@ -4865,18 +5014,20 @@ proc check_effective_target_vect_sdot_hi { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_udot_hi { } { 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 verbose "check_effective_target_vect_udot_hi: using cached result" 2
} else { } else {
set et_vect_udot_hi_saved 0 set et_vect_udot_hi_saved($et_index) 0
if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) } { 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 verbose "check_effective_target_vect_udot_hi:\
return $et_vect_udot_hi_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4885,18 +5036,20 @@ proc check_effective_target_vect_udot_hi { } { ...@@ -4885,18 +5036,20 @@ proc check_effective_target_vect_udot_hi { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_usad_char { } { 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 verbose "check_effective_target_vect_usad_char: using cached result" 2
} else { } else {
set et_vect_usad_char_saved 0 set et_vect_usad_char_saved($et_index) 0
if { ([istarget i?86-*-*] || [istarget x86_64-*-*]) } { 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 verbose "check_effective_target_vect_usad_char:\
return $et_vect_usad_char_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4906,23 +5059,25 @@ proc check_effective_target_vect_usad_char { } { ...@@ -4906,23 +5059,25 @@ proc check_effective_target_vect_usad_char { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_pack_trunc { } { 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 verbose "check_effective_target_vect_pack_trunc: using cached result" 2
} else { } else {
set et_vect_pack_trunc_saved 0 set et_vect_pack_trunc_saved($et_index) 0
if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
|| [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*]
|| [istarget aarch64*-*-*] || [istarget aarch64*-*-*]
|| [istarget spu-*-*] || [istarget spu-*-*]
|| ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok] || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]
&& [check_effective_target_arm_little_endian]) } { && [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 verbose "check_effective_target_vect_pack_trunc:\
return $et_vect_pack_trunc_saved 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 # Return 1 if the target plus current options supports a vector
...@@ -4931,12 +5086,13 @@ proc check_effective_target_vect_pack_trunc { } { ...@@ -4931,12 +5086,13 @@ proc check_effective_target_vect_pack_trunc { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_unpack { } { 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 verbose "check_effective_target_vect_unpack: using cached result" 2
} else { } else {
set et_vect_unpack_saved 0 set et_vect_unpack_saved($et_index) 0
if { ([istarget powerpc*-*-*] && ![istarget powerpc-*paired*]) if { ([istarget powerpc*-*-*] && ![istarget powerpc-*paired*])
|| [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*]
|| [istarget spu-*-*] || [istarget spu-*-*]
...@@ -4944,11 +5100,12 @@ proc check_effective_target_vect_unpack { } { ...@@ -4944,11 +5100,12 @@ proc check_effective_target_vect_unpack { } {
|| [istarget aarch64*-*-*] || [istarget aarch64*-*-*]
|| ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok] || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]
&& [check_effective_target_arm_little_endian]) } { && [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 verbose "check_effective_target_vect_unpack:\
return $et_vect_unpack_saved 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 # Return 1 if the target plus current options does not guarantee
...@@ -4975,11 +5132,12 @@ proc check_effective_target_unaligned_stack { } { ...@@ -4975,11 +5132,12 @@ proc check_effective_target_unaligned_stack { } {
proc check_effective_target_vect_no_align { } { proc check_effective_target_vect_no_align { } {
global et_vect_no_align_saved 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 verbose "check_effective_target_vect_no_align: using cached result" 2
} else { } else {
set et_vect_no_align_saved 0 set et_vect_no_align_saved($et_index) 0
if { [istarget mipsisa64*-*-*] if { [istarget mipsisa64*-*-*]
|| [istarget mips-sde-elf] || [istarget mips-sde-elf]
|| [istarget sparc*-*-*] || [istarget sparc*-*-*]
...@@ -4987,12 +5145,13 @@ proc check_effective_target_vect_no_align { } { ...@@ -4987,12 +5145,13 @@ proc check_effective_target_vect_no_align { } {
|| [check_effective_target_arm_vect_no_misalign] || [check_effective_target_arm_vect_no_misalign]
|| ([istarget powerpc*-*-*] && [check_p8vector_hw_available]) || ([istarget powerpc*-*-*] && [check_p8vector_hw_available])
|| ([istarget mips*-*-*] || ([istarget mips*-*-*]
&& [check_effective_target_mips_loongson]) } { && [et-is-effective-target mips_loongson]) } {
set et_vect_no_align_saved 1 set et_vect_no_align_saved($et_index) 1
} }
} }
verbose "check_effective_target_vect_no_align: returning $et_vect_no_align_saved" 2 verbose "check_effective_target_vect_no_align:\
return $et_vect_no_align_saved 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. # Return 1 if the target supports a vector misalign access, 0 otherwise.
...@@ -5001,19 +5160,21 @@ proc check_effective_target_vect_no_align { } { ...@@ -5001,19 +5160,21 @@ proc check_effective_target_vect_no_align { } {
proc check_effective_target_vect_hw_misalign { } { proc check_effective_target_vect_hw_misalign { } {
global et_vect_hw_misalign_saved 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 verbose "check_effective_target_vect_hw_misalign: using cached result" 2
} else { } else {
set et_vect_hw_misalign_saved 0 set et_vect_hw_misalign_saved($et_index) 0
if { [istarget i?86-*-*] || [istarget x86_64-*-*] if { [istarget i?86-*-*] || [istarget x86_64-*-*]
|| ([istarget powerpc*-*-*] && [check_p8vector_hw_available]) || ([istarget powerpc*-*-*] && [check_p8vector_hw_available])
|| [istarget aarch64*-*-*] } { || [istarget aarch64*-*-*] } {
set et_vect_hw_misalign_saved 1 set et_vect_hw_misalign_saved($et_index) 1
} }
} }
verbose "check_effective_target_vect_hw_misalign: returning $et_vect_hw_misalign_saved" 2 verbose "check_effective_target_vect_hw_misalign:\
return $et_vect_hw_misalign_saved returning $et_vect_hw_misalign_saved($et_index)" 2
return $et_vect_hw_misalign_saved($et_index)
} }
...@@ -5023,25 +5184,28 @@ proc check_effective_target_vect_hw_misalign { } { ...@@ -5023,25 +5184,28 @@ proc check_effective_target_vect_hw_misalign { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_aligned_arrays { } { 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] { if [info exists et_vect_aligned_arrays_saved($et_index)] {
verbose "check_effective_target_vect_aligned_arrays: using cached result" 2 verbose "check_effective_target_vect_aligned_arrays:\
using cached result" 2
} else { } 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 { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
if { ([is-effective-target lp64] if { ([is-effective-target lp64]
&& ( ![check_avx_available] && ( ![check_avx_available]
|| [check_prefer_avx128])) } { || [check_prefer_avx128])) } {
set et_vect_aligned_arrays_saved 1 set et_vect_aligned_arrays_saved($et_index) 1
} }
} }
if [istarget spu-*-*] { 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 verbose "check_effective_target_vect_aligned_arrays:\
return $et_vect_aligned_arrays_saved 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 # Return 1 if types of size 32 bit or less are naturally aligned
...@@ -5092,20 +5256,22 @@ proc check_effective_target_natural_alignment_64 { } { ...@@ -5092,20 +5256,22 @@ proc check_effective_target_natural_alignment_64 { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vect_natural_alignment { } { 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 verbose "check_effective_target_vect_natural_alignment: using cached result" 2
} else { } else {
set et_vect_natural_alignment_saved 1 set et_vect_natural_alignment_saved($et_index) 1
if { [check_effective_target_arm_eabi] if { [check_effective_target_arm_eabi]
|| [istarget nvptx-*-*] || [istarget nvptx-*-*]
|| [istarget s390*-*-*] } { || [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 verbose "check_effective_target_vect_natural_alignment:\
return $et_vect_natural_alignment_saved 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. # Return 1 if vector alignment (for types of size 32 bit or less) is reachable, 0 otherwise.
...@@ -5113,20 +5279,23 @@ proc check_effective_target_vect_natural_alignment { } { ...@@ -5113,20 +5279,23 @@ proc check_effective_target_vect_natural_alignment { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vector_alignment_reachable { } { 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] { if [info exists et_vector_alignment_reachable_saved($et_index)] {
verbose "check_effective_target_vector_alignment_reachable: using cached result" 2 verbose "check_effective_target_vector_alignment_reachable:\
using cached result" 2
} else { } else {
if { [check_effective_target_vect_aligned_arrays] if { [check_effective_target_vect_aligned_arrays]
|| [check_effective_target_natural_alignment_32] } { || [check_effective_target_natural_alignment_32] } {
set et_vector_alignment_reachable_saved 1 set et_vector_alignment_reachable_saved($et_index) 1
} else { } 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 verbose "check_effective_target_vector_alignment_reachable:\
return $et_vector_alignment_reachable_saved 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. # Return 1 if vector alignment for 64 bit is reachable, 0 otherwise.
...@@ -5134,40 +5303,46 @@ proc check_effective_target_vector_alignment_reachable { } { ...@@ -5134,40 +5303,46 @@ proc check_effective_target_vector_alignment_reachable { } {
# This won't change for different subtargets so cache the result. # This won't change for different subtargets so cache the result.
proc check_effective_target_vector_alignment_reachable_for_64bit { } { 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] { 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 verbose "check_effective_target_vector_alignment_reachable_for_64bit:\
using cached result" 2
} else { } else {
if { [check_effective_target_vect_aligned_arrays] if { [check_effective_target_vect_aligned_arrays]
|| [check_effective_target_natural_alignment_64] } { || [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 { } 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 verbose "check_effective_target_vector_alignment_reachable_for_64bit:\
return $et_vector_alignment_reachable_for_64bit_saved 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 # Return 1 if the target only requires element alignment for vector accesses
proc check_effective_target_vect_element_align { } { proc check_effective_target_vect_element_align { } {
global et_vect_element_align global et_vect_element_align
global et_index
if [info exists et_vect_element_align] { if [info exists et_vect_element_align($et_index)] {
verbose "check_effective_target_vect_element_align: using cached result" 2 verbose "check_effective_target_vect_element_align:\
using cached result" 2
} else { } else {
set et_vect_element_align 0 set et_vect_element_align($et_index) 0
if { ([istarget arm*-*-*] if { ([istarget arm*-*-*]
&& ![check_effective_target_arm_vect_no_misalign]) && ![check_effective_target_arm_vect_no_misalign])
|| [check_effective_target_vect_hw_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 verbose "check_effective_target_vect_element_align:\
return $et_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. # Return 1 if the target supports vector LOAD_LANES operations, 0 otherwise.
...@@ -5193,23 +5368,26 @@ proc check_effective_target_vect_load_lanes { } { ...@@ -5193,23 +5368,26 @@ proc check_effective_target_vect_load_lanes { } {
proc check_effective_target_vect_condition { } { proc check_effective_target_vect_condition { } {
global et_vect_cond_saved 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 verbose "check_effective_target_vect_cond: using cached result" 2
} else { } else {
set et_vect_cond_saved 0 set et_vect_cond_saved($et_index) 0
if { [istarget aarch64*-*-*] if { [istarget aarch64*-*-*]
|| [istarget powerpc*-*-*] || [istarget powerpc*-*-*]
|| [istarget ia64-*-*] || [istarget ia64-*-*]
|| [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*]
|| [istarget spu-*-*] || [istarget spu-*-*]
|| ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } { || ([istarget arm*-*-*]
set et_vect_cond_saved 1 && [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 verbose "check_effective_target_vect_cond:\
return $et_vect_cond_saved 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 # Return 1 if the target supports vector conditional operations where
...@@ -5217,52 +5395,57 @@ proc check_effective_target_vect_condition { } { ...@@ -5217,52 +5395,57 @@ proc check_effective_target_vect_condition { } {
proc check_effective_target_vect_cond_mixed { } { proc check_effective_target_vect_cond_mixed { } {
global et_vect_cond_mixed_saved 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 verbose "check_effective_target_vect_cond_mixed: using cached result" 2
} else { } else {
set et_vect_cond_mixed_saved 0 set et_vect_cond_mixed_saved($et_index) 0
if { [istarget i?86-*-*] || [istarget x86_64-*-*] if { [istarget i?86-*-*] || [istarget x86_64-*-*]
|| [istarget powerpc*-*-*] } { || [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 verbose "check_effective_target_vect_cond_mixed:\
return $et_vect_cond_mixed_saved 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. # Return 1 if the target supports vector char multiplication, 0 otherwise.
proc check_effective_target_vect_char_mult { } { proc check_effective_target_vect_char_mult { } {
global et_vect_char_mult_saved 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 verbose "check_effective_target_vect_char_mult: using cached result" 2
} else { } else {
set et_vect_char_mult_saved 0 set et_vect_char_mult_saved($et_index) 0
if { [istarget aarch64*-*-*] if { [istarget aarch64*-*-*]
|| [istarget ia64-*-*] || [istarget ia64-*-*]
|| [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*]
|| [check_effective_target_arm32] || [check_effective_target_arm32]
|| [check_effective_target_powerpc_altivec] } { || [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 verbose "check_effective_target_vect_char_mult:\
return $et_vect_char_mult_saved 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. # Return 1 if the target supports vector short multiplication, 0 otherwise.
proc check_effective_target_vect_short_mult { } { proc check_effective_target_vect_short_mult { } {
global et_vect_short_mult_saved 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 verbose "check_effective_target_vect_short_mult: using cached result" 2
} else { } else {
set et_vect_short_mult_saved 0 set et_vect_short_mult_saved($et_index) 0
if { [istarget ia64-*-*] if { [istarget ia64-*-*]
|| [istarget spu-*-*] || [istarget spu-*-*]
|| [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*]
...@@ -5270,47 +5453,52 @@ proc check_effective_target_vect_short_mult { } { ...@@ -5270,47 +5453,52 @@ proc check_effective_target_vect_short_mult { } {
|| [istarget aarch64*-*-*] || [istarget aarch64*-*-*]
|| [check_effective_target_arm32] || [check_effective_target_arm32]
|| ([istarget mips*-*-*] || ([istarget mips*-*-*]
&& [check_effective_target_mips_loongson]) } { && [et-is-effective-target mips_loongson]) } {
set et_vect_short_mult_saved 1 set et_vect_short_mult_saved($et_index) 1
} }
} }
verbose "check_effective_target_vect_short_mult: returning $et_vect_short_mult_saved" 2 verbose "check_effective_target_vect_short_mult:\
return $et_vect_short_mult_saved 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. # Return 1 if the target supports vector int multiplication, 0 otherwise.
proc check_effective_target_vect_int_mult { } { proc check_effective_target_vect_int_mult { } {
global et_vect_int_mult_saved 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 verbose "check_effective_target_vect_int_mult: using cached result" 2
} else { } else {
set et_vect_int_mult_saved 0 set et_vect_int_mult_saved($et_index) 0
if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
|| [istarget spu-*-*] || [istarget spu-*-*]
|| [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*]
|| [istarget ia64-*-*] || [istarget ia64-*-*]
|| [istarget aarch64*-*-*] || [istarget aarch64*-*-*]
|| [check_effective_target_arm32] } { || [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 verbose "check_effective_target_vect_int_mult:\
return $et_vect_int_mult_saved 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. # Return 1 if the target supports vector even/odd elements extraction, 0 otherwise.
proc check_effective_target_vect_extract_even_odd { } { proc check_effective_target_vect_extract_even_odd { } {
global et_vect_extract_even_odd_saved global et_vect_extract_even_odd_saved
global et_index
if [info exists et_vect_extract_even_odd_saved] { if [info exists et_vect_extract_even_odd_saved($et_index)] {
verbose "check_effective_target_vect_extract_even_odd: using cached result" 2 verbose "check_effective_target_vect_extract_even_odd:\
using cached result" 2
} else { } else {
set et_vect_extract_even_odd_saved 0 set et_vect_extract_even_odd_saved($et_index) 0
if { [istarget aarch64*-*-*] if { [istarget aarch64*-*-*]
|| [istarget powerpc*-*-*] || [istarget powerpc*-*-*]
|| [is-effective-target arm_neon_ok] || [is-effective-target arm_neon_ok]
...@@ -5318,24 +5506,26 @@ proc check_effective_target_vect_extract_even_odd { } { ...@@ -5318,24 +5506,26 @@ proc check_effective_target_vect_extract_even_odd { } {
|| [istarget ia64-*-*] || [istarget ia64-*-*]
|| [istarget spu-*-*] || [istarget spu-*-*]
|| ([istarget mips*-*-*] || ([istarget mips*-*-*]
&& [check_effective_target_mpaired_single]) } { && [et-is-effective-target mpaired_single]) } {
set et_vect_extract_even_odd_saved 1 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 verbose "check_effective_target_vect_extract_even_odd:\
return $et_vect_extract_even_odd_saved 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. # Return 1 if the target supports vector interleaving, 0 otherwise.
proc check_effective_target_vect_interleave { } { proc check_effective_target_vect_interleave { } {
global et_vect_interleave_saved 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 verbose "check_effective_target_vect_interleave: using cached result" 2
} else { } else {
set et_vect_interleave_saved 0 set et_vect_interleave_saved($et_index) 0
if { [istarget aarch64*-*-*] if { [istarget aarch64*-*-*]
|| [istarget powerpc*-*-*] || [istarget powerpc*-*-*]
|| [is-effective-target arm_neon_ok] || [is-effective-target arm_neon_ok]
...@@ -5343,13 +5533,14 @@ proc check_effective_target_vect_interleave { } { ...@@ -5343,13 +5533,14 @@ proc check_effective_target_vect_interleave { } {
|| [istarget ia64-*-*] || [istarget ia64-*-*]
|| [istarget spu-*-*] || [istarget spu-*-*]
|| ([istarget mips*-*-*] || ([istarget mips*-*-*]
&& [check_effective_target_mpaired_single]) } { && [et-is-effective-target mpaired_single]) } {
set et_vect_interleave_saved 1 set et_vect_interleave_saved($et_index) 1
} }
} }
verbose "check_effective_target_vect_interleave: returning $et_vect_interleave_saved" 2 verbose "check_effective_target_vect_interleave:\
return $et_vect_interleave_saved returning $et_vect_interleave_saved($et_index)" 2
return $et_vect_interleave_saved($et_index)
} }
foreach N {2 3 4 8} { foreach N {2 3 4 8} {
...@@ -5357,24 +5548,27 @@ foreach N {2 3 4 8} { ...@@ -5357,24 +5548,27 @@ foreach N {2 3 4 8} {
# Return 1 if the target supports 2-vector interleaving # Return 1 if the target supports 2-vector interleaving
proc check_effective_target_vect_stridedN { } { proc check_effective_target_vect_stridedN { } {
global et_vect_stridedN_saved global et_vect_stridedN_saved
global et_index
if [info exists et_vect_stridedN_saved] { if [info exists et_vect_stridedN_saved($et_index)] {
verbose "check_effective_target_vect_stridedN: using cached result" 2 verbose "check_effective_target_vect_stridedN:\
using cached result" 2
} else { } else {
set et_vect_stridedN_saved 0 set et_vect_stridedN_saved($et_index) 0
if { (N & -N) == N if { (N & -N) == N
&& [check_effective_target_vect_interleave] && [check_effective_target_vect_interleave]
&& [check_effective_target_vect_extract_even_odd] } { && [check_effective_target_vect_extract_even_odd] } {
set et_vect_stridedN_saved 1 set et_vect_stridedN_saved($et_index) 1
} }
if { ([istarget arm*-*-*] if { ([istarget arm*-*-*]
|| [istarget aarch64*-*-*]) && N >= 2 && N <= 4 } { || [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 verbose "check_effective_target_vect_stridedN:\
return $et_vect_stridedN_saved returning $et_vect_stridedN_saved($et_index)" 2
return $et_vect_stridedN_saved($et_index)
} }
}] }]
} }
...@@ -5383,61 +5577,68 @@ foreach N {2 3 4 8} { ...@@ -5383,61 +5577,68 @@ foreach N {2 3 4 8} {
proc check_effective_target_vect_multiple_sizes { } { proc check_effective_target_vect_multiple_sizes { } {
global et_vect_multiple_sizes_saved 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*-*-*] if { ([istarget aarch64*-*-*]
|| ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok])) } { || ([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 { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
if { ([check_avx_available] && ![check_prefer_avx128]) } { 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 verbose "check_effective_target_vect_multiple_sizes:\
return $et_vect_multiple_sizes_saved 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. # Return 1 if the target supports vectors of 64 bits.
proc check_effective_target_vect64 { } { proc check_effective_target_vect64 { } {
global et_vect64_saved 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 verbose "check_effective_target_vect64: using cached result" 2
} else { } else {
set et_vect64_saved 0 set et_vect64_saved($et_index) 0
if { ([istarget arm*-*-*] if { ([istarget arm*-*-*]
&& [check_effective_target_arm_neon_ok] && [check_effective_target_arm_neon_ok]
&& [check_effective_target_arm_little_endian]) && [check_effective_target_arm_little_endian])
|| [istarget aarch64*-*-*] || [istarget aarch64*-*-*]
|| [istarget sparc*-*-*] } { || [istarget sparc*-*-*] } {
set et_vect64_saved 1 set et_vect64_saved($et_index) 1
} }
} }
verbose "check_effective_target_vect64: returning $et_vect64_saved" 2 verbose "check_effective_target_vect64:\
return $et_vect64_saved returning $et_vect64_saved($et_index)" 2
return $et_vect64_saved($et_index)
} }
# Return 1 if the target supports vector copysignf calls. # Return 1 if the target supports vector copysignf calls.
proc check_effective_target_vect_call_copysignf { } { proc check_effective_target_vect_call_copysignf { } {
global et_vect_call_copysignf_saved global et_vect_call_copysignf_saved
global et_index
if [info exists et_vect_call_copysignf_saved] { if [info exists et_vect_call_copysignf_saved($et_index)] {
verbose "check_effective_target_vect_call_copysignf: using cached result" 2 verbose "check_effective_target_vect_call_copysignf:\
using cached result" 2
} else { } else {
set et_vect_call_copysignf_saved 0 set et_vect_call_copysignf_saved($et_index) 0
if { [istarget i?86-*-*] || [istarget x86_64-*-*] if { [istarget i?86-*-*] || [istarget x86_64-*-*]
|| [istarget powerpc*-*-*] } { || [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 verbose "check_effective_target_vect_call_copysignf:\
return $et_vect_call_copysignf_saved 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. # Return 1 if the target supports hardware square root instructions.
...@@ -5465,20 +5666,22 @@ proc check_effective_target_sqrt_insn { } { ...@@ -5465,20 +5666,22 @@ proc check_effective_target_sqrt_insn { } {
proc check_effective_target_vect_call_sqrtf { } { proc check_effective_target_vect_call_sqrtf { } {
global et_vect_call_sqrtf_saved 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 verbose "check_effective_target_vect_call_sqrtf: using cached result" 2
} else { } else {
set et_vect_call_sqrtf_saved 0 set et_vect_call_sqrtf_saved($et_index) 0
if { [istarget aarch64*-*-*] if { [istarget aarch64*-*-*]
|| [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*]
|| ([istarget powerpc*-*-*] && [check_vsx_hw_available]) } { || ([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 verbose "check_effective_target_vect_call_sqrtf:\
return $et_vect_call_sqrtf_saved 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. # Return 1 if the target supports vector lrint calls.
...@@ -5498,216 +5701,243 @@ proc check_effective_target_vect_call_lrint { } { ...@@ -5498,216 +5701,243 @@ proc check_effective_target_vect_call_lrint { } {
proc check_effective_target_vect_call_btrunc { } { proc check_effective_target_vect_call_btrunc { } {
global et_vect_call_btrunc_saved global et_vect_call_btrunc_saved
global et_index
if [info exists et_vect_call_btrunc_saved] { if [info exists et_vect_call_btrunc_saved($et_index)] {
verbose "check_effective_target_vect_call_btrunc: using cached result" 2 verbose "check_effective_target_vect_call_btrunc:\
using cached result" 2
} else { } else {
set et_vect_call_btrunc_saved 0 set et_vect_call_btrunc_saved($et_index) 0
if { [istarget aarch64*-*-*] } { 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 verbose "check_effective_target_vect_call_btrunc:\
return $et_vect_call_btrunc_saved 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. # Return 1 if the target supports vector btruncf calls.
proc check_effective_target_vect_call_btruncf { } { proc check_effective_target_vect_call_btruncf { } {
global et_vect_call_btruncf_saved global et_vect_call_btruncf_saved
global et_index
if [info exists et_vect_call_btruncf_saved] { if [info exists et_vect_call_btruncf_saved($et_index)] {
verbose "check_effective_target_vect_call_btruncf: using cached result" 2 verbose "check_effective_target_vect_call_btruncf:\
using cached result" 2
} else { } else {
set et_vect_call_btruncf_saved 0 set et_vect_call_btruncf_saved($et_index) 0
if { [istarget aarch64*-*-*] } { 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 verbose "check_effective_target_vect_call_btruncf:\
return $et_vect_call_btruncf_saved 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. # Return 1 if the target supports vector ceil calls.
proc check_effective_target_vect_call_ceil { } { proc check_effective_target_vect_call_ceil { } {
global et_vect_call_ceil_saved 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 verbose "check_effective_target_vect_call_ceil: using cached result" 2
} else { } else {
set et_vect_call_ceil_saved 0 set et_vect_call_ceil_saved($et_index) 0
if { [istarget aarch64*-*-*] } { 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 verbose "check_effective_target_vect_call_ceil:\
return $et_vect_call_ceil_saved 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. # Return 1 if the target supports vector ceilf calls.
proc check_effective_target_vect_call_ceilf { } { proc check_effective_target_vect_call_ceilf { } {
global et_vect_call_ceilf_saved 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 verbose "check_effective_target_vect_call_ceilf: using cached result" 2
} else { } else {
set et_vect_call_ceilf_saved 0 set et_vect_call_ceilf_saved($et_index) 0
if { [istarget aarch64*-*-*] } { 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 verbose "check_effective_target_vect_call_ceilf:\
return $et_vect_call_ceilf_saved 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. # Return 1 if the target supports vector floor calls.
proc check_effective_target_vect_call_floor { } { proc check_effective_target_vect_call_floor { } {
global et_vect_call_floor_saved 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 verbose "check_effective_target_vect_call_floor: using cached result" 2
} else { } else {
set et_vect_call_floor_saved 0 set et_vect_call_floor_saved($et_index) 0
if { [istarget aarch64*-*-*] } { 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 verbose "check_effective_target_vect_call_floor:\
return $et_vect_call_floor_saved 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. # Return 1 if the target supports vector floorf calls.
proc check_effective_target_vect_call_floorf { } { proc check_effective_target_vect_call_floorf { } {
global et_vect_call_floorf_saved 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 verbose "check_effective_target_vect_call_floorf: using cached result" 2
} else { } else {
set et_vect_call_floorf_saved 0 set et_vect_call_floorf_saved($et_index) 0
if { [istarget aarch64*-*-*] } { 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 verbose "check_effective_target_vect_call_floorf:\
return $et_vect_call_floorf_saved 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. # Return 1 if the target supports vector lceil calls.
proc check_effective_target_vect_call_lceil { } { proc check_effective_target_vect_call_lceil { } {
global et_vect_call_lceil_saved 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 verbose "check_effective_target_vect_call_lceil: using cached result" 2
} else { } else {
set et_vect_call_lceil_saved 0 set et_vect_call_lceil_saved($et_index) 0
if { [istarget aarch64*-*-*] } { 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 verbose "check_effective_target_vect_call_lceil:\
return $et_vect_call_lceil_saved 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. # Return 1 if the target supports vector lfloor calls.
proc check_effective_target_vect_call_lfloor { } { proc check_effective_target_vect_call_lfloor { } {
global et_vect_call_lfloor_saved 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 verbose "check_effective_target_vect_call_lfloor: using cached result" 2
} else { } else {
set et_vect_call_lfloor_saved 0 set et_vect_call_lfloor_saved($et_index) 0
if { [istarget aarch64*-*-*] } { 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 verbose "check_effective_target_vect_call_lfloor:\
return $et_vect_call_lfloor_saved 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. # Return 1 if the target supports vector nearbyint calls.
proc check_effective_target_vect_call_nearbyint { } { proc check_effective_target_vect_call_nearbyint { } {
global et_vect_call_nearbyint_saved 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 verbose "check_effective_target_vect_call_nearbyint: using cached result" 2
} else { } else {
set et_vect_call_nearbyint_saved 0 set et_vect_call_nearbyint_saved($et_index) 0
if { [istarget aarch64*-*-*] } { 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 verbose "check_effective_target_vect_call_nearbyint:\
return $et_vect_call_nearbyint_saved 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. # Return 1 if the target supports vector nearbyintf calls.
proc check_effective_target_vect_call_nearbyintf { } { proc check_effective_target_vect_call_nearbyintf { } {
global et_vect_call_nearbyintf_saved global et_vect_call_nearbyintf_saved
global et_index
if [info exists et_vect_call_nearbyintf_saved] { if [info exists et_vect_call_nearbyintf_saved($et_index)] {
verbose "check_effective_target_vect_call_nearbyintf: using cached result" 2 verbose "check_effective_target_vect_call_nearbyintf:\
using cached result" 2
} else { } else {
set et_vect_call_nearbyintf_saved 0 set et_vect_call_nearbyintf_saved($et_index) 0
if { [istarget aarch64*-*-*] } { 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 verbose "check_effective_target_vect_call_nearbyintf:\
return $et_vect_call_nearbyintf_saved 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. # Return 1 if the target supports vector round calls.
proc check_effective_target_vect_call_round { } { proc check_effective_target_vect_call_round { } {
global et_vect_call_round_saved 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 verbose "check_effective_target_vect_call_round: using cached result" 2
} else { } else {
set et_vect_call_round_saved 0 set et_vect_call_round_saved($et_index) 0
if { [istarget aarch64*-*-*] } { 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 verbose "check_effective_target_vect_call_round:\
return $et_vect_call_round_saved 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. # Return 1 if the target supports vector roundf calls.
proc check_effective_target_vect_call_roundf { } { proc check_effective_target_vect_call_roundf { } {
global et_vect_call_roundf_saved 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 verbose "check_effective_target_vect_call_roundf: using cached result" 2
} else { } else {
set et_vect_call_roundf_saved 0 set et_vect_call_roundf_saved($et_index) 0
if { [istarget aarch64*-*-*] } { 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 verbose "check_effective_target_vect_call_roundf:\
return $et_vect_call_roundf_saved 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 # Return 1 if the target supports section-anchors
...@@ -6104,7 +6334,13 @@ proc check_effective_target_init_priority {} { ...@@ -6104,7 +6334,13 @@ proc check_effective_target_init_priority {} {
# arguments with keywords that pass particular arguments. # arguments with keywords that pass particular arguments.
proc is-effective-target { arg } { proc is-effective-target { arg } {
global et_index
set selected 0 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] } { if { [info procs check_effective_target_${arg}] != [list] } {
set selected [check_effective_target_${arg}] set selected [check_effective_target_${arg}]
} else { } else {
...@@ -6155,6 +6391,50 @@ proc is-effective-target-keyword { arg } { ...@@ -6155,6 +6391,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 # Return 1 if target default to short enums
proc check_effective_target_short_enums { } { proc check_effective_target_short_enums { } {
...@@ -6855,13 +7135,19 @@ proc check_effective_target_stpcpy {} { ...@@ -6855,13 +7135,19 @@ proc check_effective_target_stpcpy {} {
# Check whether the vectorizer tests are supported by the target and # Check whether the vectorizer tests are supported by the target and
# append additional target-dependent compile flags to DEFAULT_VECTCFLAGS. # 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 # Set dg-do-what-default to either compile or run, depending on target
# capabilities. Return 1 if vectorizer tests are supported by # capabilities. Do not set this if the supported target is appended to
# target, 0 otherwise. # 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 { } { proc check_vect_support_and_set_flags { } {
global DEFAULT_VECTCFLAGS global DEFAULT_VECTCFLAGS
global dg-do-what-default global dg-do-what-default
global EFFECTIVE_TARGETS
if [istarget powerpc-*paired*] { if [istarget powerpc-*paired*] {
lappend DEFAULT_VECTCFLAGS "-mpaired" lappend DEFAULT_VECTCFLAGS "-mpaired"
...@@ -6904,13 +7190,14 @@ proc check_vect_support_and_set_flags { } { ...@@ -6904,13 +7190,14 @@ proc check_vect_support_and_set_flags { } {
set dg-do-what-default compile set dg-do-what-default compile
} }
} elseif { [istarget mips*-*-*] } elseif { [istarget mips*-*-*]
&& ([check_effective_target_mpaired_single] && [check_effective_target_nomips16] } {
|| [check_effective_target_mips_loongson]) if { [check_effective_target_mpaired_single] } {
&& [check_effective_target_nomips16] } { lappend EFFECTIVE_TARGETS mpaired_single
if { [check_effective_target_mpaired_single] } { }
lappend DEFAULT_VECTCFLAGS "-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*-*-*] { } elseif [istarget sparc*-*-*] {
lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis" lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis"
if [check_effective_target_ultrasparc_hw] { if [check_effective_target_ultrasparc_hw] {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment