diff options
Diffstat (limited to 'gcc/testsuite/lib/target-supports.exp')
| -rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 136 |
1 files changed, 108 insertions, 28 deletions
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 89bb9d1ddca..8e263a352d7 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1491,18 +1491,19 @@ proc check_effective_target_vect_no_bitwise { } { # Return 1 if the target plus current options supports a vector # widening summation of *short* args into *int* result, 0 otherwise. +# A target can also support this widening summation if it can support +# promotion (unpacking) from shorts to ints. # # This won't change for different subtargets so cache the result. proc check_effective_target_vect_widen_sum_hi_to_si { } { global et_vect_widen_sum_hi_to_si - + if [info exists et_vect_widen_sum_hi_to_si_saved] { verbose "check_effective_target_vect_widen_sum_hi_to_si: using cached result" 2 } else { - set et_vect_widen_sum_hi_to_si_saved 0 - if { [istarget powerpc*-*-*] - || [istarget ia64-*-*] } { + set et_vect_widen_sum_hi_to_si_saved [check_effective_target_vect_unpack] + if { [istarget powerpc*-*-*] } { set et_vect_widen_sum_hi_to_si_saved 1 } } @@ -1512,19 +1513,21 @@ proc check_effective_target_vect_widen_sum_hi_to_si { } { # Return 1 if the target plus current options supports a vector # widening summation of *char* args into *short* result, 0 otherwise. +# A target can also support this widening summation if it can support +# promotion (unpacking) from chars to shorts. # # This won't change for different subtargets so cache the result. proc check_effective_target_vect_widen_sum_qi_to_hi { } { global et_vect_widen_sum_qi_to_hi - + if [info exists et_vect_widen_sum_qi_to_hi_saved] { verbose "check_effective_target_vect_widen_sum_qi_to_hi: using cached result" 2 } else { set et_vect_widen_sum_qi_to_hi_saved 0 - if { [istarget ia64-*-*] } { + if { [check_effective_target_vect_unpack] } { set et_vect_widen_sum_qi_to_hi_saved 1 - } + } } verbose "check_effective_target_vect_widen_sum_qi_to_hi: returning $et_vect_widen_sum_qi_to_hi_saved" 2 return $et_vect_widen_sum_qi_to_hi_saved @@ -1537,7 +1540,7 @@ proc check_effective_target_vect_widen_sum_qi_to_hi { } { proc check_effective_target_vect_widen_sum_qi_to_si { } { global et_vect_widen_sum_qi_to_si - + if [info exists et_vect_widen_sum_qi_to_si_saved] { verbose "check_effective_target_vect_widen_sum_qi_to_si: using cached result" 2 } else { @@ -1551,24 +1554,61 @@ proc check_effective_target_vect_widen_sum_qi_to_si { } { } # Return 1 if the target plus current options supports a vector -# widening summation, 0 otherwise. +# widening multiplication of *char* args into *short* result, 0 otherwise. +# A target can also support this widening multplication if it can support +# promotion (unpacking) from chars to shorts, and vect_short_mult (non-widening +# multiplication of shorts). # # This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_widen_sum { } { - global et_vect_widen_sum - - if [info exists et_vect_widen_sum_saved] { - verbose "check_effective_target_vect_widen_sum: using cached result" 2 + + +proc check_effective_target_vect_widen_mult_qi_to_hi { } { + global et_vect_widen_mult_qi_to_hi + + if [info exists et_vect_widen_mult_qi_to_hi_saved] { + verbose "check_effective_target_vect_widen_mult_qi_to_hi: using cached result" 2 } else { - set et_vect_widen_sum_saved 0 - if { [istarget powerpc*-*-*] - || [istarget ia64-*-*] } { - set et_vect_widen_sum_saved 1 + if { [check_effective_target_vect_unpack] + && [check_effective_target_vect_short_mult] } { + set et_vect_widen_mult_qi_to_hi_saved 1 + } else { + set et_vect_widen_mult_qi_to_hi_saved 0 + } + if { [istarget powerpc*-*-*] } { + set et_vect_widen_mult_qi_to_hi_saved 1 } } - verbose "check_effective_target_vect_widen_sum: returning $et_vect_widen_sum_saved" 2 - return $et_vect_widen_sum_saved + verbose "check_effective_target_vect_widen_mult_qi_to_hi: returning $et_vect_widen_mult_qi_to_hi_saved" 2 + return $et_vect_widen_mult_qi_to_hi_saved +} + +# Return 1 if the target plus current options supports a vector +# widening multiplication of *short* args into *int* result, 0 otherwise. +# A target can also support this widening multplication if it can support +# promotion (unpacking) from shorts to ints, and vect_int_mult (non-widening +# multiplication of ints). +# +# This won't change for different subtargets so cache the result. + + +proc check_effective_target_vect_widen_mult_hi_to_si { } { + global et_vect_widen_mult_hi_to_si + + if [info exists et_vect_widen_mult_hi_to_si_saved] { + verbose "check_effective_target_vect_widen_mult_hi_to_si: using cached result" 2 + } else { + if { [check_effective_target_vect_unpack] + && [check_effective_target_vect_int_mult] } { + set et_vect_widen_mult_hi_to_si_saved 1 + } else { + set et_vect_widen_mult_hi_to_si_saved 0 + } + if { [istarget powerpc*-*-*] } { + set et_vect_widen_mult_hi_to_si_saved 1 + } + } + verbose "check_effective_target_vect_widen_mult_hi_to_si: returning $et_vect_widen_mult_hi_to_si_saved" 2 + return $et_vect_widen_mult_hi_to_si_saved } # Return 1 if the target plus current options supports a vector @@ -1583,9 +1623,6 @@ proc check_effective_target_vect_sdot_qi { } { verbose "check_effective_target_vect_sdot_qi: using cached result" 2 } else { set et_vect_sdot_qi_saved 0 - if { [istarget ia64-*-*] } { - set et_vect_sdot_qi_saved 1 - } } verbose "check_effective_target_vect_sdot_qi: returning $et_vect_sdot_qi_saved" 2 return $et_vect_sdot_qi_saved @@ -1603,8 +1640,7 @@ proc check_effective_target_vect_udot_qi { } { verbose "check_effective_target_vect_udot_qi: using cached result" 2 } else { set et_vect_udot_qi_saved 0 - if { [istarget powerpc*-*-*] - || [istarget ia64-*-*] } { + if { [istarget powerpc*-*-*] } { set et_vect_udot_qi_saved 1 } } @@ -1626,8 +1662,7 @@ proc check_effective_target_vect_sdot_hi { } { set et_vect_sdot_hi_saved 0 if { [istarget powerpc*-*-*] || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || [istarget ia64-*-*] } { + || [istarget x86_64-*-*] } { set et_vect_sdot_hi_saved 1 } } @@ -1656,6 +1691,51 @@ proc check_effective_target_vect_udot_hi { } { } +# Return 1 if the target plus current options supports a vector +# demotion (packing) of shorts (to chars) and ints (to shorts) +# using modulo arithmetic, 0 otherwise. +# +# This won't change for different subtargets so cache the result. + +proc check_effective_target_vect_pack_mod { } { + global et_vect_pack_mod + + if [info exists et_vect_pack_mod_saved] { + verbose "check_effective_target_vect_pack_mod: using cached result" 2 + } else { + set et_vect_pack_mod_saved 0 + if { [istarget powerpc*-*-*] + || [istarget i?86-*-*] + || [istarget x86_64-*-*] } { + set et_vect_pack_mod_saved 1 + } + } + verbose "check_effective_target_vect_pack_mod: returning $et_vect_pack_mod_saved" 2 + return $et_vect_pack_mod_saved +} + +# Return 1 if the target plus current options supports a vector +# promotion (unpacking) of chars (to shorts) and shorts (to ints), 0 otherwise. +# +# This won't change for different subtargets so cache the result. + +proc check_effective_target_vect_unpack { } { + global et_vect_unpack + + if [info exists et_vect_unpack_saved] { + verbose "check_effective_target_vect_unpack: using cached result" 2 + } else { + set et_vect_unpack_saved 0 + if { [istarget powerpc*-*-*] + || [istarget i?86-*-*] + || [istarget x86_64-*-*] } { + set et_vect_unpack_saved 1 + } + } + verbose "check_effective_target_vect_unpack: returning $et_vect_unpack_saved" 2 + return $et_vect_unpack_saved +} + # Return 1 if the target plus current options does not support a vector # alignment mechanism, 0 otherwise. # |

